Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR: Fix interface language auto-configuration #21451

Merged
merged 2 commits into from
Oct 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 13 additions & 5 deletions spyder/config/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,11 +360,15 @@ def is_py2exe_or_cx_Freeze():
'zh_CN': u'简体中文',
'ja': u'日本語',
'de': u'Deutsch',
'pl': u'Polski'
'pl': u'Polski',
'fa': u'Persian',
'hr': u'Croatian',
'te': u'Telugu',
'uk': u'Ukrainian',
}

# Disabled languages because their translations are outdated or incomplete
sthibaul marked this conversation as resolved.
Show resolved Hide resolved
DISABLED_LANGUAGES = ['hu', 'pl']
DISABLED_LANGUAGES = ['fa', 'hr', 'hu', 'pl', 'te', 'uk']


def get_available_translations():
Expand All @@ -385,14 +389,18 @@ def get_available_translations():

# Check that there is a language code available in case a new translation
# is added, to ensure LANGUAGE_CODES is updated.
retlangs = []
for lang in langs:
if lang not in LANGUAGE_CODES:
if DEV:
error = ('Update LANGUAGE_CODES (inside config/base.py) if a '
'new translation has been added to Spyder')
'new translation has been added to Spyder. '
'Currently missing ' + lang)
print(error) # spyder: test-skip
return ['en']
return langs
return ['en']
else:
retlangs.append(lang)
return retlangs


def get_interface_language():
Expand Down