From 741d9a26b626d4dc72d1f8873e0499997e6a7f1e Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Sat, 8 Jun 2024 13:02:56 +0200 Subject: [PATCH] Change script to write only the English translation set to JSON We will have to do this regularly in order to upload it to Crowdin (or Weblate or whatever translation system we are going to use). Unlike the non-English JSON files, the en.json file is not committed to the git repo. --- cmd/i18n/main.go | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/cmd/i18n/main.go b/cmd/i18n/main.go index 5623c53fc..f388c396b 100644 --- a/cmd/i18n/main.go +++ b/cmd/i18n/main.go @@ -18,24 +18,8 @@ func saveLanguageFileToJson(tr *i18n.TranslationSet, filepath string) error { return os.WriteFile(filepath, jsonData, 0o644) } -func saveNonEnglishLanguageFilesToJson() error { - translationSets, _ := i18n.GetTranslationSets() - for lang, tr := range translationSets { - if lang == "en" { - continue - } - - err := saveLanguageFileToJson(tr, "pkg/i18n/translations/"+lang+".json") - if err != nil { - return err - } - } - - return nil -} - func main() { - err := saveNonEnglishLanguageFilesToJson() + err := saveLanguageFileToJson(i18n.EnglishTranslationSet(), "en.json") if err != nil { log.Fatal(err) }