Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a72eb96

Browse files
committedMar 17, 2018
Handle absolute paths in TRANSLATIONS (Issue #2982)
1 parent 08528e4 commit a72eb96

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed
 

‎CHANGES.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ Features
3434
Bugfixes
3535
--------
3636

37-
* Handle '/' and other absolute paths better in POSTS / PAGES
37+
* Handle '/' and other absolute paths better in POSTS / PAGES / TRANSLATIONS
38+
(Issue #2982)
3839
* Support KaTeX for reST display math (Issue #2888)
3940
* Use npm for asset management instead of bower, which was deprecated
4041
(Issue #2790)

‎nikola/nikola.py

+4
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,10 @@ def __init__(self, **config):
617617
# Translatability configuration.
618618
self.config['TRANSLATIONS'] = self.config.get('TRANSLATIONS',
619619
{self.config['DEFAULT_LANG']: ''})
620+
for k, v in self.config['TRANSLATIONS'].items():
621+
if os.path.isabs(v):
622+
self.config['TRANSLATIONS'][k] = os.path.relpath(v, '/')
623+
620624
utils.TranslatableSetting.default_lang = self.config['DEFAULT_LANG']
621625

622626
self.TRANSLATABLE_SETTINGS = ('BLOG_AUTHOR',

0 commit comments

Comments
 (0)
Please sign in to comment.