Skip to content

Commit

Permalink
Eliminate language.py logspam
Browse files Browse the repository at this point in the history
Don't log confusing "Skipping English..." message
Don't log _attempts_ to load translators
Log successful attempts as debug messages
  • Loading branch information
ferdnyc committed Jul 3, 2018
1 parent 34fb6e5 commit 3f453de
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/classes/language.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ def init_language():

# Don't try on default locale, since it fails to load what is the default language
if QLocale().system().name() in locale_name:
log.info("Skipping English language (no need for translation): {}".format(locale_name))
continue

# Go through each translator and try to add for current locale
Expand Down Expand Up @@ -160,10 +159,9 @@ def find_language_match(pattern, path, translator, locale_name):
i = len(locale_parts)
while not success and i > 0:
formatted_name = pattern % "_".join(locale_parts[:i])
log.info('Attempting to load {} in \'{}\''.format(formatted_name, path))
success = translator.load(formatted_name, path)
if success:
log.info('Successfully loaded {} in \'{}\''.format(formatted_name, path))
log.debug('Successfully loaded {} in \'{}\''.format(formatted_name, path))
i -= 1

return success
Expand Down

0 comments on commit 3f453de

Please sign in to comment.