Skip to content

Commit

Permalink
Merge pull request #21451 from sthibaul/master
Browse files Browse the repository at this point in the history
PR: Fix language auto-configuration
  • Loading branch information
ccordoba12 committed Oct 26, 2023
2 parents 7fdb1c8 + 28c1211 commit 22ac3e5
Showing 1 changed file with 13 additions and 5 deletions.
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
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

0 comments on commit 22ac3e5

Please sign in to comment.