2021-12-11 15:16:14 +00:00
|
|
|
#[derive(Clone)]
|
|
|
|
pub struct Language {
|
|
|
|
pub combo_box_text: &'static str,
|
|
|
|
pub short_text: &'static str,
|
|
|
|
}
|
|
|
|
|
2021-12-21 05:35:53 +00:00
|
|
|
/// Languages should be alphabetically sorted
|
2022-01-01 14:16:00 +00:00
|
|
|
pub const LANGUAGES_ALL: [Language; 12] = [
|
2021-12-21 17:44:20 +00:00
|
|
|
Language {
|
|
|
|
combo_box_text: "English",
|
|
|
|
short_text: "en",
|
|
|
|
},
|
2022-01-05 21:47:27 +00:00
|
|
|
Language {
|
|
|
|
combo_box_text: "Français (French)",
|
|
|
|
short_text: "fr",
|
|
|
|
},
|
2021-12-21 05:35:53 +00:00
|
|
|
Language {
|
|
|
|
combo_box_text: "Italiano (Italian)",
|
|
|
|
short_text: "it",
|
|
|
|
},
|
2021-12-11 15:16:14 +00:00
|
|
|
Language {
|
2021-12-19 20:42:14 +00:00
|
|
|
combo_box_text: "Polski (Polish)",
|
2021-12-11 15:16:14 +00:00
|
|
|
short_text: "pl",
|
|
|
|
},
|
2022-01-01 09:50:11 +00:00
|
|
|
Language {
|
2022-01-01 14:16:00 +00:00
|
|
|
combo_box_text: "Česky (Czech) - Computer translation",
|
|
|
|
short_text: "cs",
|
2022-01-01 09:50:11 +00:00
|
|
|
},
|
2021-12-26 14:35:17 +00:00
|
|
|
Language {
|
|
|
|
combo_box_text: "Deutsch (German) - Computer translation",
|
|
|
|
short_text: "de",
|
|
|
|
},
|
2022-01-01 09:50:11 +00:00
|
|
|
Language {
|
|
|
|
combo_box_text: "やまと (Japanese) - Computer translation",
|
|
|
|
short_text: "ja",
|
|
|
|
},
|
2021-12-31 21:48:29 +00:00
|
|
|
Language {
|
|
|
|
combo_box_text: "Português (Portuguese) - Computer translation",
|
|
|
|
short_text: "pt",
|
|
|
|
},
|
2022-01-01 09:50:11 +00:00
|
|
|
Language {
|
|
|
|
combo_box_text: "Русский (Russian) - Computer translation",
|
|
|
|
short_text: "ru",
|
|
|
|
},
|
|
|
|
Language {
|
|
|
|
combo_box_text: "简体中文 (Simplified Chinese) - Computer translation",
|
|
|
|
short_text: "zh",
|
|
|
|
},
|
|
|
|
Language {
|
|
|
|
combo_box_text: "Español (Spanish) - Computer translation",
|
|
|
|
short_text: "es",
|
|
|
|
},
|
2022-01-01 14:16:00 +00:00
|
|
|
Language {
|
|
|
|
combo_box_text: "український (Ukrainian) - Computer translation",
|
|
|
|
short_text: "uk",
|
|
|
|
},
|
2021-12-11 15:16:14 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
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");
|
|
|
|
}
|