blob: bf7ad0f12554f72f32c3ff64204f003b4dbbe4fb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
import gettext
from gettext import gettext as _
import os
def C_(ctx, s):
"""Provide qualified translatable strings via context.
(copied from Orca)"""
translated = gettext.gettext('%s\x04%s' % (ctx, s))
if '\x04' in translated:
# no translation found, return input string
return s
return translated
gettext.bindtextdomain ("@GETTEXT_PACKAGE@",
os.path.join ("@prefix@", "@DATADIRNAME@", "locale"))
gettext.textdomain("@GETTEXT_PACKAGE@")
|