Skip to content

Commit

Permalink
Omit Korean from New Test Suite dialog, because RF 7.0.1 does not sup…
Browse files Browse the repository at this point in the history
…port yet
  • Loading branch information
HelioGuilherme66 committed Aug 15, 2024
1 parent 4889b8d commit f87a6f4
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/robotide/ui/filedialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
from robot.conf.languages import Language
except ImportError:
try:
from robotide.lib.compat.parsing.languages import Language
from ..lib.compat.parsing.languages import Language
except ImportError:
Language = None

Expand Down Expand Up @@ -129,6 +129,10 @@ def _create_lang_chooser(self, sizer):
languages = read_languages()
if languages[0] != '':
languages.insert(0, '')
# Remove non-existing language, Korean
for value in languages:
if value == 'Korean':
languages.remove(value)
if isinstance(lang, list) and len(lang) > 0:
_settings[DOC_LANGUAGE] = lang[0]
lang = lang[0]
Expand Down Expand Up @@ -242,8 +246,12 @@ def selected_language(self):
lang = lang[0]
if lang in ('en',): # We will only consider English as the effective setting
return ['en']
mlang = Language.from_name(lang.replace('_', '-'))
set_lang[0] = mlang.code.replace('-', '_')
try:
mlang = Language.from_name(lang.replace('_', '-'))
set_lang[0] = mlang.code.replace('-', '_')
except ValueError: # For the case of missing language, like Ko
set_lang[0] = 'en'
return ['en']
else:
return [set_lang[0]]
return [mlang.name]
Expand Down

0 comments on commit f87a6f4

Please sign in to comment.