Skip to content

Commit

Permalink
Add more informative warnings about locale errors
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Jul 15, 2016
1 parent 451c51f commit 4cbeaa1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions nikola/conf.py.in
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions nikola/nikola.py
Expand Up @@ -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
Expand Down

0 comments on commit 4cbeaa1

Please sign in to comment.