Skip to content
Permalink
Browse files

(debugging in Travis)

Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed May 24, 2017
1 parent 3ee9123 commit b1a7c91696a5843ed177b7aa7305e4fd32eb76ea
Showing with 8 additions and 2 deletions.
  1. +8 −2 nikola/nikola.py
@@ -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')

0 comments on commit b1a7c91

Please sign in to comment.