1
0
Fork 0
mirror of synced 2024-04-29 18:13:47 +12:00
czkawka/czkawka_gui/src/language_functions.rs
Rafał Mikrut 5db5d17afb
Use max line length 180 instead 250 (#515)
This was a little too big value.
I don't like too much too small values, because code looks ugly.
2021-12-21 18:44:20 +01:00

32 lines
717 B
Rust

#[derive(Clone)]
pub struct Language {
pub combo_box_text: &'static str,
pub short_text: &'static str,
}
/// Languages should be alphabetically sorted
pub const LANGUAGES_ALL: [Language; 3] = [
Language {
combo_box_text: "English",
short_text: "en",
},
Language {
combo_box_text: "Italiano (Italian)",
short_text: "it",
},
Language {
combo_box_text: "Polski (Polish)",
short_text: "pl",
},
];
pub fn get_language_from_combo_box_text(combo_box_text: String) -> Language {
for lang in LANGUAGES_ALL {
if lang.combo_box_text == combo_box_text {
return lang;
}
}
panic!("Not found proper text");
}