forked from enlightenment/efl
elua: trigger xgettext execution from xgettext.lua, which is executed by xgettext_wrapper
This commit is contained in:
parent
4dfec82877
commit
58409c521a
|
@ -11,7 +11,7 @@ top_builddir = ..
|
|||
XGETTEXT_FALLBACK := $(XGETTEXT)
|
||||
|
||||
# Override xgettext with our own custom wrapper
|
||||
XGETTEXT = $(srcdir)/xgettext_wrapper $(XGETTEXT_FALLBACK)
|
||||
XGETTEXT = $(srcdir)/xgettext_wrapper $(top_builddir) $(XGETTEXT_FALLBACK)
|
||||
|
||||
# These options get passed to xgettext.
|
||||
XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ --from-code=UTF-8 --foreign-user
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
#!/bin/sh
|
||||
XGETTEXT=$1
|
||||
ELUAPATH=$1/src/bin/elua
|
||||
ELUA=${ELUAPATH}/elua
|
||||
LXGETTEXT=${ELUAPATH}/xgettext.lua
|
||||
export XGETTEXT=$2
|
||||
export EFL_RUN_IN_TREE=1
|
||||
shift
|
||||
$XGETTEXT "$@"
|
||||
shift
|
||||
$ELUA $LXGETTEXT "$@"
|
||||
exit $?
|
||||
|
|
|
@ -120,7 +120,7 @@ local opts, args = getopt.parse {
|
|||
{ nil, "copyright-holder", true, metavar = "STRING", help = "set "
|
||||
.. "copyright holder in output"
|
||||
},
|
||||
{ nil, "foreing-user", false, help = "omit copyright in output "
|
||||
{ nil, "foreign-user", false, help = "omit copyright in output "
|
||||
.. "for foreign user"
|
||||
},
|
||||
{ nil, "package-name", true, metavar = "PACKAGE", help = "set package "
|
||||
|
@ -158,4 +158,22 @@ local opts, args = getopt.parse {
|
|||
}
|
||||
}
|
||||
|
||||
if not opts or opts["h"] or opts["v"] then
|
||||
return true
|
||||
end
|
||||
|
||||
local hasxgettext = os.getenv("XGETTEXT")
|
||||
if hasxgettext then
|
||||
local gargs = { "\"" .. hasxgettext .. "\"" }
|
||||
for i = 1, #opts do
|
||||
gargs[#gargs + 1] = "\"" .. arg[i] .. "\""
|
||||
end
|
||||
for i, v in ipairs(args) do
|
||||
if not v:match("^.+%.lua$") then
|
||||
gargs[#gargs + 1] = v
|
||||
end
|
||||
end
|
||||
os.execute(table.concat(gargs, " "))
|
||||
end
|
||||
|
||||
return true
|
Loading…
Reference in New Issue