pub const LANG_ATTRS: [&str; 7] = [
"hangul", "latin", "hanja", "japanese", "other", "symbol", "user",
];
pub const LANG_LABELS_KO: [&str; 7] = ["한글", "영어", "한자", "일어", "기타", "기호", "사용자"];
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct LangSlot {
pub index: u8,
pub attr: &'static str,
pub label_ko: &'static str,
}
pub const LANG_SLOTS: [LangSlot; 7] = [
LangSlot {
index: 0,
attr: "hangul",
label_ko: "한글",
},
LangSlot {
index: 1,
attr: "latin",
label_ko: "영어",
},
LangSlot {
index: 2,
attr: "hanja",
label_ko: "한자",
},
LangSlot {
index: 3,
attr: "japanese",
label_ko: "일어",
},
LangSlot {
index: 4,
attr: "other",
label_ko: "기타",
},
LangSlot {
index: 5,
attr: "symbol",
label_ko: "기호",
},
LangSlot {
index: 6,
attr: "user",
label_ko: "사용자",
},
];
pub fn lang_index(attr: &str) -> Option<usize> {
LANG_ATTRS.iter().position(|name| *name == attr)
}