Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Let's initialize the LocaleBorg even with default config
  • Loading branch information
ralsina committed Jun 15, 2015
1 parent 7ca989b commit dbdcdcc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions nikola/__main__.py
Expand Up @@ -108,7 +108,8 @@ def main(args=None):
root = get_root_dir()
if root:
os.chdir(root)
needs_config_file = (argname != 'help')
# Help and imports don't require config, but can use one if it exists
needs_config_file = (argname != 'help') and not argname.startswith('import_')
else:
needs_config_file = False

Expand Down Expand Up @@ -154,7 +155,6 @@ def main(args=None):
config['__quiet__'] = quiet
config['__configuration_filename__'] = conf_filename
config['__cwd__'] = original_cwd

site = Nikola(**config)
DN = DoitNikola(site, quiet)
if _RETURN_DOITNIKOLA:
Expand Down
11 changes: 5 additions & 6 deletions nikola/nikola.py
Expand Up @@ -615,12 +615,11 @@ def __init__(self, **config):
self.default_lang = self.config['DEFAULT_LANG']
self.translations = self.config['TRANSLATIONS']

if self.configured:
locale_fallback, locale_default, locales = sanitized_locales(
self.config.get('LOCALE_FALLBACK', None),
self.config.get('LOCALE_DEFAULT', None),
self.config.get('LOCALES', {}), self.translations)
utils.LocaleBorg.initialize(locales, self.default_lang)
locale_fallback, locale_default, locales = sanitized_locales(
self.config.get('LOCALE_FALLBACK', None),
self.config.get('LOCALE_DEFAULT', None),
self.config.get('LOCALES', {}), self.translations)
utils.LocaleBorg.initialize(locales, self.default_lang)

# BASE_URL defaults to SITE_URL
if 'BASE_URL' not in self.config:
Expand Down

0 comments on commit dbdcdcc

Please sign in to comment.