Skip to content

Commit 819f506

Browse files
echarlesRosio Reyes
authored andcommitted
add transutils
1 parent 080380d commit 819f506

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

nbclassic/transutils.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
"""Translation related utilities. When imported, injects _ to builtins"""
2+
3+
# Copyright (c) Jupyter Development Team.
4+
# Distributed under the terms of the Modified BSD License.
5+
6+
import os
7+
import gettext
8+
9+
10+
# Set up message catalog access
11+
base_dir = os.path.realpath(os.path.join(__file__, '..', '..'))
12+
trans = gettext.translation('notebook', localedir=os.path.join(base_dir, 'notebook/i18n'), fallback=True)
13+
_ = trans.gettext

0 commit comments

Comments
 (0)