forked from github/pelican
Fix locale setup in settings.py
This commit is contained in:
parent
44c1fe4840
commit
1c6ea5aab2
2 changed files with 7 additions and 2 deletions
|
|
@ -2,6 +2,8 @@
|
|||
import os
|
||||
import locale
|
||||
|
||||
from pelican import log
|
||||
|
||||
DEFAULT_THEME = os.sep.join([os.path.dirname(os.path.abspath(__file__)),
|
||||
"themes/notmyidea"])
|
||||
_DEFAULT_CONFIG = {'PATH': None,
|
||||
|
|
@ -60,6 +62,9 @@ def read_settings(filename):
|
|||
locales = [locales]
|
||||
|
||||
# try to set the different locales, fallback on the default.
|
||||
if not locales:
|
||||
locales = _DEFAULT_CONFIG['LOCALE']
|
||||
|
||||
for locale_ in locales:
|
||||
try:
|
||||
locale.setlocale(locale.LC_ALL, locale_)
|
||||
|
|
@ -67,7 +72,7 @@ def read_settings(filename):
|
|||
except locale.Error:
|
||||
pass
|
||||
else:
|
||||
warnings.warn("LOCALE option doesn't contain a correct value")
|
||||
log.warn("LOCALE option doesn't contain a correct value")
|
||||
|
||||
# set the locale
|
||||
return context
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ GITHUB_URL = 'http://github.com/ametaireau/'
|
|||
DISQUS_SITENAME = "blog-notmyidea"
|
||||
PDF_GENERATOR = False
|
||||
REVERSE_CATEGORY_ORDER = True
|
||||
LOCALE = 'fr_FR.utf-8'
|
||||
LOCALE = ""
|
||||
DEFAULT_PAGINATION = 2
|
||||
|
||||
FEED_RSS = 'feeds/all.rss.xml'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue