mirror of
https://github.com/jesseduffield/lazygit.git
synced 2024-11-21 17:57:00 +02:00
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.
This commit is contained in:
parent
98e5fd70fb
commit
741d9a26b6
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user