Debian Codegraph @

tools/gettext.py

raw
1 from SCons.Script import Builder
2 from SCons.Action import Action
3 def addGettextBuilder(env):
4 env.Append(BUILDERS = {
5 'Gettext': Builder(
6 action = Action("$GETTEXTCOM", "$GETTEXTCOMSTR"),
7 suffix = '.mo',
8 src_suffix = '.po',
9 single_source = True,
10 ),
11 'Xgettext': Builder(
12 action = Action("$XGETTEXTCOM", "$XGETTEXTCOMSTR"),
13 suffix = '.pot',
14 src_suffix = '.cpp',
15 single_source = False,
16 ),
17 'Msgmerge': Builder(
18 action = Action("$MSGMERGECOM", "$MSGMERGECOMSTR"),
19 suffix = '.pot',
20 src_suffix = '.pot',
21 single_source = False,
22 ),
23 'Msgcat': Builder(
24 action = Action("$MSGCATCOM", "$MSGCATCOMSTR"),
25 suffix = '.pot',
26 src_suffix = '.pot',
27 single_source = False,
28 ),
29 })
30 env["GETTEXT"] = env.Detect("msgfmt")
31 env["GETTEXTCOM"] = "$GETTEXT --check-format --check-domain -f -o $TARGET $SOURCE"
32 env["XGETTEXT"] = env.Detect("xgettext")
33 env["XGETTEXTCOM"] = "$XGETTEXT --keyword=_ --from-code utf-8 --package-name=gpick $XGETTEXT_FLAGS --output=$TARGET $SOURCES"
34 env["MSGMERGE"] = env.Detect("msgmerge")
35 env["MSGMERGECOM"] = "$MSGMERGE $MSGMERGE_FLAGS --output-file=$TARGET $SOURCES"
36 env["MSGCAT"] = env.Detect("msgcat")
37 env["MSGCATCOM"] = "$MSGCAT $MSGCAT_FLAGS --output-file=$TARGET $SOURCES"
38