transutils.py 424 B

12345678910111213
  1. """Translation related utilities. When imported, injects _ to builtins"""
  2. # Copyright (c) Jupyter Development Team.
  3. # Distributed under the terms of the Modified BSD License.
  4. import os
  5. import gettext
  6. # Set up message catalog access
  7. base_dir = os.path.realpath(os.path.join(__file__, '..', '..'))
  8. trans = gettext.translation('notebook', localedir=os.path.join(base_dir, 'notebook/i18n'), fallback=True)
  9. _ = trans.gettext