Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
warn iff you try to hyphenate something and pyphen is not available
  • Loading branch information
ralsina committed Sep 10, 2015
1 parent 987eb48 commit 0a4b8cc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion nikola/post.py
Expand Up @@ -1069,7 +1069,11 @@ def hyphenate(dom, _lang):
"""Hyphenate a post."""
# circular import prevention
from .nikola import LEGAL_VALUES
lang = LEGAL_VALUES['PYPHEN_LOCALES'].get(_lang, pyphen.language_fallback(_lang))
lang = None
if pyphen is not None:
lang = LEGAL_VALUES['PYPHEN_LOCALES'].get(_lang, pyphen.language_fallback(_lang))
else:
utils.req_missing(['pyphen'], 'hyphenate texts', optional=True)
if pyphen is not None and lang is not None:
# If pyphen does exist, we tell the user when configuring the site.
# If it does not support a language, we ignore it quietly.
Expand Down

0 comments on commit 0a4b8cc

Please sign in to comment.