Skip to content
This repository has been archived by the owner on May 28, 2022. It is now read-only.

Commit

Permalink
rc
Browse files Browse the repository at this point in the history
  • Loading branch information
Cryspia committed Nov 13, 2014
1 parent ae66e6a commit 7e96e53
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 4 deletions.
3 changes: 0 additions & 3 deletions src/freeseer/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,8 @@ def detect_system_language():
translation = 'tr_{}'.format(QLocale.system().name())
translation_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'frontend', 'qtcommon', 'languages')
translation_country_language = os.path.join(translation_path, '{}.ts'.format(translation))
translation_language = os.path.join(translation_path, '{}.ts'.format(translation.split('-')[0]))
if os.path.isfile(translation_country_language):
return '{}.qm'.format(translation)
elif os.path.isfile(translation_language):
return '{}.qm'.format(translation.split('-')[0])
else:
return 'tr_en_US.qm'

Expand Down
2 changes: 1 addition & 1 deletion src/freeseer/tests/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class TestSettings:

def test_detect_system_language_translation_found(self, monkeypatch):
"""Tests detect_system_language() returns the appropriate translation filename for the system language."""
locales = ("ar_EG", "de_DE", "en_US", "fr_CA", "ja", "nl_NL", "sv_SE", "zh_CN", "zh_HK")
locales = ("ar_EG", "de_DE", "en_US", "fr_CA", "ja_JP", "nl_NL", "sv_SE", "zh_CN", "zh_HK")
for locale in locales:
monkeypatch.setattr(QLocale, "name", lambda x: locale)
assert detect_system_language() == "tr_{}.qm".format(locale)
Expand Down

0 comments on commit 7e96e53

Please sign in to comment.