diff options
author | Stefan Haller <stefan@haller-berlin.de> | 2024-06-08 13:02:56 +0200 |
---|---|---|
committer | Stefan Haller <stefan@haller-berlin.de> | 2024-06-23 14:47:50 +0200 |
commit | 741d9a26b626d4dc72d1f8873e0499997e6a7f1e (patch) | |
tree | e5e6b6282ce81cc5b95486863cfe9d31d6c80d1b | |
parent | 98e5fd70fb6a1129a18e2d7283e72949ca14451b (diff) |
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.
-rw-r--r-- | cmd/i18n/main.go | 18 |
1 files changed, 1 insertions, 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) } |