Skip to content
Browse files
warn iff you try to hyphenate something and pyphen is not available
  • Loading branch information
ralsina committed Sep 10, 2015
1 parent 987eb48 commit 0a4b8cced3397dc4c442f013f3d5426131925c00
Showing 1 changed file with 5 additions and 1 deletion.
@@ -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))
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.

0 comments on commit 0a4b8cc

Please sign in to comment.