What changed, and why it matters
This commit changes how language names are displayed in the Electrum wallet's settings. Previously, language names like 'French' or 'German' were run through the translation system, meaning a user viewing the app in German would see 'Französisch' instead of 'French'. The change keeps language names in English (or their native form) so users can still recognize languages when the app is in a language they don't understand. It is explicitly described by the author as a conceptual change that is effectively a no-op in practice because the translation system isn't active when this list is first loaded.
No security action required. This is a usability/localization improvement. Normal code review and merge procedures apply.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch modifies electrum/i18n.py, replacing gettext-wrapped strings ((‘Arabic’), (‘Bulgarian’), etc.) with plain English strings for the human-readable names in the languages dictionary. The ‘Default’ entry retains _() because it is a UI label, not a language name. The commit message notes the global scope of i18n.py executes before set_language() is called (see run_electrum line 422), so in practice the translated strings were never actually translated at load time, making this a conceptual cleanup rather than a functional behavior change.
Changed components
electrum/i18n.pyInspect captured patch +39 / −35
diff --git a/electrum/i18n.py b/electrum/i18n.py
index 5734f72..a56471a 100644
--- a/electrum/i18n.py
+++ b/electrum/i18n.py
@@ -125,42 +125,46 @@ def set_language(x: Optional[str]) -> None:
_language = gettext.translation('electrum', LOCALE_DIR, fallback=True, languages=[x])
+# note: The values (human-visible lang names) should be either in English or in their own lang,
+# but NOT translated to the currently selected lang.
+# e.g. "fr_FR" we could show as either "French" or "Français", or even as "French - Français",
+# but it is evil to show it as "Französisch". How am I supposed to switch back to English from Korean??? :)
languages = {
'': _('Default'),
- 'ar_SA': _('Arabic'),
- 'bg_BG': _('Bulgarian'),
- 'cs_CZ': _('Czech'),
- 'da_DK': _('Danish'),
- 'de_DE': _('German'),
- 'el_GR': _('Greek'),
- 'eo_UY': _('Esperanto'),
- 'en_UK': _('English'), # selecting this guarantees seeing the untranslated source strings
- 'es_ES': _('Spanish'),
- 'fa_IR': _('Persian'),
- 'fr_FR': _('French'),
- 'hu_HU': _('Hungarian'),
- 'hy_AM': _('Armenian'),
- 'id_ID': _('Indonesian'),
- 'it_IT': _('Italian'),
- 'ja_JP': _('Japanese'),
- 'ky_KG': _('Kyrgyz'),
- 'lv_LV': _('Latvian'),
- 'nb_NO': _('Norwegian Bokmal'),
- 'nl_NL': _('Dutch'),
- 'pl_PL': _('Polish'),
- 'pt_BR': _('Portuguese (Brazil)'),
- 'pt_PT': _('Portuguese'),
- 'ro_RO': _('Romanian'),
- 'ru_RU': _('Russian'),
- 'sk_SK': _('Slovak'),
- 'sl_SI': _('Slovenian'),
- 'sv_SE': _('Swedish'),
- 'ta_IN': _('Tamil'),
- 'th_TH': _('Thai'),
- 'tr_TR': _('Turkish'),
- 'uk_UA': _('Ukrainian'),
- 'vi_VN': _('Vietnamese'),
- 'zh_CN': _('Chinese Simplified'),
- 'zh_TW': _('Chinese Traditional')
+ 'ar_SA': 'Arabic',
+ 'bg_BG': 'Bulgarian',
+ 'cs_CZ': 'Czech',
+ 'da_DK': 'Danish',
+ 'de_DE': 'German',
+ 'el_GR': 'Greek',
+ 'eo_UY': 'Esperanto',
+ 'en_UK': 'English', # selecting this guarantees seeing the untranslated source strings
+ 'es_ES': 'Spanish',
+ 'fa_IR': 'Persian',
+ 'fr_FR': 'French',
+ 'hu_HU': 'Hungarian',
+ 'hy_AM': 'Armenian',
+ 'id_ID': 'Indonesian',
+ 'it_IT': 'Italian',
+ 'ja_JP': 'Japanese',
+ 'ky_KG': 'Kyrgyz',
+ 'lv_LV': 'Latvian',
+ 'nb_NO': 'Norwegian Bokmal',
+ 'nl_NL': 'Dutch',
+ 'pl_PL': 'Polish',
+ 'pt_BR': 'Portuguese (Brazil)',
+ 'pt_PT': 'Portuguese',
+ 'ro_RO': 'Romanian',
+ 'ru_RU': 'Russian',
+ 'sk_SK': 'Slovak',
+ 'sl_SI': 'Slovenian',
+ 'sv_SE': 'Swedish',
+ 'ta_IN': 'Tamil',
+ 'th_TH': 'Thai',
+ 'tr_TR': 'Turkish',
+ 'uk_UA': 'Ukrainian',
+ 'vi_VN': 'Vietnamese',
+ 'zh_CN': 'Chinese Simplified',
+ 'zh_TW': 'Chinese Traditional',
}
assert '' in languages
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.