Commit 346b1a34 authored by Wolfgang Rohdewald's avatar Wolfgang Rohdewald
Browse files

MLocale.availableLanguages: optimize, less debug output

parent 2a30b4d5
......@@ -280,15 +280,13 @@ class MLocale:
languages.append(_[0])
if Debug.i18n:
Internal.logger.debug('languages from locale: %s', ','.join(languages) if languages else None)
Internal.logger.debug('looking for translations in %s', ','.join(cls.localeDirectories()))
installed_languages = set()
for resourceDir in cls.localeDirectories():
for sysLanguage in sorted(os.listdir(resourceDir)):
if cls.__isLanguageInstalledForKajongg(sysLanguage):
languages.append(sysLanguage)
if sysLanguage not in languages:
if Debug.i18n:
Internal.logger.debug(
'I am in %s. language %s not installed in %s',
os.getcwd(), sysLanguage, ','.join(cls.localeDirectories()))
installed_languages |= set(os.listdir(resourceDir))
for sysLanguage in sorted(installed_languages):
if cls.__isLanguageInstalledForKajongg(sysLanguage):
languages.append(sysLanguage)
if languages:
languages = uniqueList(cls.extendRegionLanguages(languages))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment