summaryrefslogtreecommitdiff
path: root/locale/tools
diff options
context:
space:
mode:
Diffstat (limited to 'locale/tools')
-rw-r--r--locale/tools/src/main.rs23
1 files changed, 22 insertions, 1 deletions
diff --git a/locale/tools/src/main.rs b/locale/tools/src/main.rs
index 1ae59c83..1082581e 100644
--- a/locale/tools/src/main.rs
+++ b/locale/tools/src/main.rs
@@ -31,6 +31,23 @@ enum Args {
},
}
+static NATIVE_LANGUAGE_NAMES: &[(&'static str, &'static str)] = &[
+ ("en", "English"),
+ ("de", "Deutsch"),
+ ("fr", "Français"),
+ ("es", "Español"),
+ ("eu", "euskara"),
+ ("ja", "日本語"),
+ ("he", "עִברִית"),
+ ("tr", "Türkçe"),
+ ("fi", "suomen"),
+ ("ar", "العربية"),
+ ("zh_Hans", "中文 (简化字)"),
+ ("zh_Hant", "中文 (繁體字)"),
+ ("pl", "Polski"),
+ ("pt", "Português"),
+];
+
fn main() -> Result<()> {
let args = Args::parse();
match args {
@@ -39,9 +56,13 @@ fn main() -> Result<()> {
input,
output,
} => {
- let ini = load_ini(&input)?;
+ let mut ini = load_ini(&input)?;
let id_map = id_map.map(|path| load_ini(&path)).transpose()?;
+ for &(code, name) in NATIVE_LANGUAGE_NAMES {
+ ini.insert(format!("c.settings.ui.language.{code}"), name.to_owned());
+ }
+
File::create(output)?.write_all(
format!(
r#"