Skip to content

Commit

Permalink
Use language display name instead of lang name
Browse files Browse the repository at this point in the history
Allows differentiating between different types of
the same language. Eg Chinese simplified and traditional

Needs better UI/UX.
  • Loading branch information
syeopite committed Nov 30, 2024
1 parent 9ee07f0 commit 7b1db7c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/helpers/i18n_data.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
LOCALE_DATA = {
"cs_CZ": ("Čeština", 100),
"cs_CZ": ("Čeština (česko)", 100),
"de": ("Deutsch", 37),
"en_US": ("English", 100),
"en_US": ("English (united states)", 100),
"es": ("Español", 100),
"fr": ("Français", 80),
"ja": ("日本語", 75),
"nb_NO": ("Norsk bokmål", 21),
"nb_NO": ("Norsk bokmål (norge)", 21),
"uk": ("Українська", 100),
"zh_Hans": ("中文", 54),
"zh_Hant": ("中文", 76),
"zh_Hans": ("中文 (简体)", 54),
"zh_Hant": ("中文 (繁體)", 76),
}
2 changes: 1 addition & 1 deletion utils/i18n/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
lines = []

for locale, pofile in locales_to_pofiles.items():
language_name = babel.Locale.parse(locale).get_language_name().capitalize()
language_name = babel.Locale.parse(locale).get_display_name().capitalize()
translation_percentage = int((len(pofile.translated_entries())/total_english_strings) * 100)

lines.append(f""""{locale}": ("{language_name}", {translation_percentage})""")
Expand Down

0 comments on commit 7b1db7c

Please sign in to comment.