From 4cbeaa185521297c97ea02cba1baee291df822ef Mon Sep 17 00:00:00 2001 From: Chris Warrick Date: Fri, 15 Jul 2016 16:06:21 +0200 Subject: [PATCH] Add more informative warnings about locale errors Signed-off-by: Chris Warrick --- nikola/conf.py.in | 4 ++++ nikola/nikola.py | 3 +++ 2 files changed, 7 insertions(+) diff --git a/nikola/conf.py.in b/nikola/conf.py.in index 41f53d1b5a..4057582953 100644 --- a/nikola/conf.py.in +++ b/nikola/conf.py.in @@ -170,6 +170,10 @@ TIMEZONE = ${TIMEZONE} # LOCALE_DEFAULT = locale to use for languages not mentioned in LOCALES; if # not set the default Nikola mapping is used. +# LOCALES = {} +# LOCALE_FALLBACK = None +# LOCALE_DEFAULT = None + # One or more folders containing files to be copied as-is into the output. # The format is a dictionary of {source: relative destination}. # Default is: diff --git a/nikola/nikola.py b/nikola/nikola.py index 8fe5cf2a88..2d7efcc128 100644 --- a/nikola/nikola.py +++ b/nikola/nikola.py @@ -2375,6 +2375,9 @@ def sanitized_locales(locale_fallback, locale_default, locales, translations): locale_n = locale_fallback msg = "Could not guess locale for language {0}, using locale {1}" utils.LOGGER.warn(msg.format(lang, locale_n)) + utils.LOGGER.warn("Please fix your OS locale configuration or use the LOCALES option in conf.py to specify your preferred locale.") + if sys.platform != 'win32': + utils.LOGGER.warn("Make sure to use an UTF-8 locale to ensure Unicode support.") locales[lang] = locale_n return locale_fallback, locale_default, locales