aboutsummaryrefslogtreecommitdiff
path: root/locale/tools
diff options
context:
space:
mode:
Diffstat (limited to 'locale/tools')
-rw-r--r--locale/tools/src/main.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/locale/tools/src/main.rs b/locale/tools/src/main.rs
index 1082581e..68805b99 100644
--- a/locale/tools/src/main.rs
+++ b/locale/tools/src/main.rs
@@ -26,6 +26,8 @@ enum Args {
ExportPo {
#[arg(long)]
remap_ids: Option<PathBuf>,
+ #[arg(long)]
+ fallback: Option<PathBuf>,
input: PathBuf,
output: PathBuf,
},
@@ -55,9 +57,19 @@ fn main() -> Result<()> {
remap_ids: id_map,
input,
output,
+ fallback,
} => {
let mut ini = load_ini(&input)?;
let id_map = id_map.map(|path| load_ini(&path)).transpose()?;
+ if let Some(fallback) = fallback {
+ let f = load_ini(&fallback)?;
+ for (k, v) in f {
+ if !ini.contains_key(&k) {
+ eprintln!("fallback: key {k:?} is missing");
+ ini.insert(k, v);
+ }
+ }
+ }
for &(code, name) in NATIVE_LANGUAGE_NAMES {
ini.insert(format!("c.settings.ui.language.{code}"), name.to_owned());