mirror of
https://github.com/anomalyco/hex.git
synced 2026-11-28 13:02:21 +01:00
* Use speech models already on this computer (#594) * Keep found-model state together * CLI copy for found models * Docs and onboarding hold test for models found on this computer
55 lines
1.3 KiB
Rust
55 lines
1.3 KiB
Rust
//! The languages Hex names, in the order Settings offers them.
|
|
|
|
use super::models::AUTO_LANGUAGE;
|
|
|
|
pub const LANGUAGES: &[(&str, &str)] = &[
|
|
(AUTO_LANGUAGE, "Auto"),
|
|
("en", "English"),
|
|
("zh", "Mandarin Chinese"),
|
|
("yue", "Cantonese"),
|
|
("ja", "Japanese"),
|
|
("ko", "Korean"),
|
|
("es", "Spanish"),
|
|
("fr", "French"),
|
|
("de", "German"),
|
|
("pt", "Portuguese"),
|
|
("it", "Italian"),
|
|
("ar", "Arabic"),
|
|
("hi", "Hindi"),
|
|
("bn", "Bangla"),
|
|
("vi", "Vietnamese"),
|
|
("ru", "Russian"),
|
|
("uk", "Ukrainian"),
|
|
("nl", "Dutch"),
|
|
("pl", "Polish"),
|
|
("tr", "Turkish"),
|
|
("sv", "Swedish"),
|
|
("da", "Danish"),
|
|
("fi", "Finnish"),
|
|
("cs", "Czech"),
|
|
("el", "Greek"),
|
|
("ro", "Romanian"),
|
|
("hu", "Hungarian"),
|
|
("id", "Indonesian"),
|
|
("ms", "Malay"),
|
|
("th", "Thai"),
|
|
("fa", "Persian"),
|
|
("he", "Hebrew"),
|
|
("bg", "Bulgarian"),
|
|
("hr", "Croatian"),
|
|
("et", "Estonian"),
|
|
("lv", "Latvian"),
|
|
("lt", "Lithuanian"),
|
|
("mt", "Maltese"),
|
|
("sk", "Slovak"),
|
|
("sl", "Slovenian"),
|
|
("mk", "Macedonian"),
|
|
("fil", "Filipino"),
|
|
];
|
|
|
|
pub fn language_name(code: &str) -> &str {
|
|
LANGUAGES
|
|
.iter()
|
|
.find_map(|(candidate, name)| (*candidate == code).then_some(*name))
|
|
.unwrap_or(code)
|
|
}
|