Merge pull request #2799 from hroncok/transutils

Have _ defined in notebook.transutils
pull/2802/head
Thomas Kluyver 9 years ago committed by GitHub
commit daeb0a401b

@ -345,3 +345,6 @@ intersphinx_mapping = {
spelling_lang='en_US'
spelling_word_list_filename='spelling_wordlist.txt'
# import before any doc is built, so _ is guaranteed to be injected
import notebook.transutils

@ -35,11 +35,7 @@ except ImportError: #PY2
from jinja2 import Environment, FileSystemLoader
# Set up message catalog access
base_dir = os.path.realpath(os.path.join(__file__, '..', '..'))
trans = gettext.translation('notebook', localedir=os.path.join(base_dir, 'notebook/i18n'), fallback=True)
trans.install()
_ = trans.gettext
from notebook.transutils import trans, _
# Install the pyzmq ioloop. This has to be done before anything else from
# tornado is imported.

@ -0,0 +1,14 @@
"""Translation related utilities. When imported, injects _ to builtins"""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import os
import gettext
# Set up message catalog access
base_dir = os.path.realpath(os.path.join(__file__, '..', '..'))
trans = gettext.translation('notebook', localedir=os.path.join(base_dir, 'notebook/i18n'), fallback=True)
trans.install()
_ = trans.gettext
Loading…
Cancel
Save