Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Handle absolute paths in TRANSLATIONS (Issue #2982) (#2989)
  • Loading branch information
ralsina committed Mar 17, 2018
1 parent 064d63f commit cc82f60
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGES.txt
Expand Up @@ -34,8 +34,9 @@ Features
Bugfixes
--------

* Handle '/' and other absolute paths better in POSTS / PAGES / TRANSLATIONS
(Issue #2982)
* Fix loading non-default languages
* Handle '/' and other absolute paths better in POSTS / PAGES
* Support KaTeX for reST display math (Issue #2888)
* Use npm for asset management instead of bower, which was deprecated
(Issue #2790)
Expand Down
4 changes: 4 additions & 0 deletions nikola/nikola.py
Expand Up @@ -617,6 +617,10 @@ def __init__(self, **config):
# Translatability configuration.
self.config['TRANSLATIONS'] = self.config.get('TRANSLATIONS',
{self.config['DEFAULT_LANG']: ''})
for k, v in self.config['TRANSLATIONS'].items():
if os.path.isabs(v):
self.config['TRANSLATIONS'][k] = os.path.relpath(v, '/')

utils.TranslatableSetting.default_lang = self.config['DEFAULT_LANG']

self.TRANSLATABLE_SETTINGS = ('BLOG_AUTHOR',
Expand Down

0 comments on commit cc82f60

Please sign in to comment.