From fa107375d03b7fe9c1aaf029083436c110474271 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sat, 28 Oct 2023 12:28:23 +1000 Subject: [PATCH] Fix handling of multi-word ftl files --- ftl/src/string/mod.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ftl/src/string/mod.rs b/ftl/src/string/mod.rs index a7946ecbf..8e1262b9c 100644 --- a/ftl/src/string/mod.rs +++ b/ftl/src/string/mod.rs @@ -74,6 +74,22 @@ fn all_langs(lang_folder: &Utf8Path) -> Result> { } fn ftl_file_from_key(old_key: &str) -> String { + for prefix in [ + "card-stats", + "card-template-rendering", + "card-templates", + "change-notetype", + "custom-study", + "database-check", + "deck-config", + "empty-cards", + "media-check", + ] { + if old_key.starts_with(&format!("{prefix}-")) { + return format!("{prefix}.ftl"); + } + } + format!("{}.ftl", old_key.split('-').next().unwrap()) }