Skip to content

Commit

Permalink
(debugging in Travis)
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed May 24, 2017
1 parent 3ee9123 commit b1a7c91
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions nikola/nikola.py
Expand Up @@ -2813,18 +2813,24 @@ def guess_locale_from_lang_windows(lang):

def guess_locale_from_lang_posix(lang):
"""Guess a locale, basing on POSIX system language."""
# TESTING
locale_a = '.'.join(locale.getdefaultlocale())
locale_a1 = b'.'.join(locale.getdefaultlocale())
locale_b = str((locale.normalize(lang).split('.')[0]) + '.UTF-8')
locale_c = str((locale.normalize(lang).split('.')[0]))
print(locale_a, locale_a1, locale_b, locale_c)
# compatibility v6.0.4
if is_valid_locale(str(lang)):
locale_n = str(lang)
else:
# Guess using locale.getdefaultlocale()
try:
locale_n = '.'.join(locale.getdefaultlocale())
locale_n = b'.'.join(locale.getdefaultlocale())
except (ValueError, TypeError):
pass
# Use guess only if it’s the same language
if not locale_n.startswith(lang.lower()):
locale_n = ''
locale_n = b''
if not locale_n or not is_valid_locale(locale_n):
# this works in Travis when locale support set by Travis suggestion
locale_n = str((locale.normalize(lang).split('.')[0]) + '.UTF-8')
Expand Down

0 comments on commit b1a7c91

Please sign in to comment.