Skip to content

Commit

Permalink
Address issue #4268
Browse files Browse the repository at this point in the history
  • Loading branch information
loonycyborg committed Aug 24, 2019
1 parent b4c65f1 commit c71d57a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion po/SConscript
Expand Up @@ -98,7 +98,8 @@ if "update-po" in COMMAND_LINE_TARGETS or "pot-update" in COMMAND_LINE_TARGETS o
for lingua in linguas:
update_po = env.MsgInitMerge(
os.path.join(domain, lingua),
os.path.join(domain, domain)
os.path.join(domain, domain),
MSGINIT_LINGUA = lingua
)
env.Precious(update_po)
NoClean(update_po)
Expand Down
9 changes: 5 additions & 4 deletions scons/gettext_tool.py
Expand Up @@ -30,19 +30,20 @@ def generate(env):

env["MSGINIT"] = WhereIs("msginit")
msginit = Builder(
action = "$MSGINIT -i $SOURCE -o $TARGET --no-translator",
action = "$MSGINIT -i $SOURCE -o $TARGET -l $MSGINIT_LINGUA --no-translator",
src_suffix = ".pot",
suffix = ".po",
single_source = True
)
env["BUILDERS"]["MsgInit"] = msginit
env["ENV"]["LANG"] = os.environ.get("LANG")
env["MSGINIT_LINGUA"] = "C"

def MsgInitMerge(env, target, source):
def MsgInitMerge(env, target, source, **kw):
if os.path.exists(target + ".po"):
return env.MsgMerge(target, source)
return env.MsgMerge(target, source, **kw)
else:
return env.MsgInit(target, source)
return env.MsgInit(target, source, **kw)
env.AddMethod(MsgInitMerge)

env["PO4A_GETTEXTIZE"] = WhereIs("po4a-gettextize")
Expand Down

0 comments on commit c71d57a

Please sign in to comment.