mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Merge pull request #1972 from nstinus/localize_quickstart
Localize default lang and timezone in pelican-quickstart
This commit is contained in:
commit
c361246eaa
2 changed files with 19 additions and 4 deletions
|
|
@ -4,12 +4,19 @@ from __future__ import print_function, unicode_literals
|
|||
|
||||
import argparse
|
||||
import codecs
|
||||
import locale
|
||||
import os
|
||||
import string
|
||||
import sys
|
||||
|
||||
import pytz
|
||||
|
||||
try:
|
||||
import tzlocal
|
||||
_DEFAULT_TIMEZONE = tzlocal.get_localzone().zone
|
||||
except:
|
||||
_DEFAULT_TIMEZONE = 'Europe/Paris'
|
||||
|
||||
import six
|
||||
|
||||
from pelican import __version__
|
||||
|
|
@ -42,8 +49,8 @@ CONF = {
|
|||
'github_pages_branch': _GITHUB_PAGES_BRANCHES['project'],
|
||||
'default_pagination': 10,
|
||||
'siteurl': '',
|
||||
'lang': 'en',
|
||||
'timezone': 'Europe/Paris'
|
||||
'lang': locale.getlocale()[0].split('_')[0],
|
||||
'timezone': _DEFAULT_TIMEZONE
|
||||
}
|
||||
|
||||
# url for list of valid timezones
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue