Skip to content

Commit

Permalink
Update supported_languages.js with new language metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
cesaregarza committed May 23, 2024
1 parent 58692ca commit f36f824
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 11 deletions.
15 changes: 15 additions & 0 deletions scripts/i18n.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,21 @@ def update_supported_languages(lang_metadata: dict) -> None:

write_supported_languages(supported_languages)

# Update supported_languages.js
supported_languages_js = {}
for metadata in lang_metadata.values():
key = metadata["splatoonLanguageKey"]
supported_languages_js[key] = metadata["languageNames"]

with open(REACT_SUPPLANG_FILE, "w") as f:
f.write(
"const SUPPORTED_LANGUAGES = "
+ orjson.dumps(
supported_languages_js, option=orjson.OPT_INDENT_2
).decode()
+ ";\n\nexport default SUPPORTED_LANGUAGES;\n"
)


def update_i18n_js(lang_metadata: dict) -> None:
with open(REACT_I18N_FILE, "r") as f:
Expand Down
28 changes: 17 additions & 11 deletions src/react_app/src/components/supported_languages.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
// IF YOU ADD A NEW LANGUAGE, YOU MUST ADD IT TO THE SUPPORTED_LANGUAGES OBJECT
const SUPPORTED_LANGUAGES = {
"en": {
"en": "English",
"es": "Spanish"
},
"es": {
"en": "Inglés",
"es": "Español"
}
}
"USen": {
"USen": "English (US)",
"USes": "Spanish (NA)",
"EUen": "English (UK)"
},
"EUen": {
"USen": "English (US)",
"USes": "Spanish (NA)",
"EUen": "English (UK)"
},
"USes": {
"USen": "Inglés (EEUU)",
"USes": "Español (LATAM)",
"EUen": "Inglés (RU)"
}
};

export default SUPPORTED_LANGUAGES;
export default SUPPORTED_LANGUAGES;

0 comments on commit f36f824

Please sign in to comment.