summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kolesa <quaker66@gmail.com>2014-05-06 12:04:52 +0100
committerDaniel Kolesa <d.kolesa@samsung.com>2014-06-10 15:48:50 +0100
commit58409c521a3d538576e2fa24ee57638cacbd9333 (patch)
tree41eb5022a97ba513e22fd42d58099eb6f678be58
parent4dfec82877664786e487c8cee0ca982290968a90 (diff)
elua: trigger xgettext execution from xgettext.lua, which is executed by xgettext_wrapper
-rw-r--r--po/Makevars2
-rwxr-xr-xpo/xgettext_wrapper9
-rw-r--r--src/bin/elua/xgettext.lua20
3 files changed, 27 insertions, 4 deletions
diff --git a/po/Makevars b/po/Makevars
index b6ee6afb97..0b56f80f30 100644
--- a/po/Makevars
+++ b/po/Makevars
@@ -11,7 +11,7 @@ top_builddir = ..
11XGETTEXT_FALLBACK := $(XGETTEXT) 11XGETTEXT_FALLBACK := $(XGETTEXT)
12 12
13# Override xgettext with our own custom wrapper 13# Override xgettext with our own custom wrapper
14XGETTEXT = $(srcdir)/xgettext_wrapper $(XGETTEXT_FALLBACK) 14XGETTEXT = $(srcdir)/xgettext_wrapper $(top_builddir) $(XGETTEXT_FALLBACK)
15 15
16# These options get passed to xgettext. 16# These options get passed to xgettext.
17XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ --from-code=UTF-8 --foreign-user 17XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ --from-code=UTF-8 --foreign-user
diff --git a/po/xgettext_wrapper b/po/xgettext_wrapper
index 9415f2f39b..d65c8d0959 100755
--- a/po/xgettext_wrapper
+++ b/po/xgettext_wrapper
@@ -1,5 +1,10 @@
1#!/bin/sh 1#!/bin/sh
2XGETTEXT=$1 2ELUAPATH=$1/src/bin/elua
3ELUA=${ELUAPATH}/elua
4LXGETTEXT=${ELUAPATH}/xgettext.lua
5export XGETTEXT=$2
6export EFL_RUN_IN_TREE=1
3shift 7shift
4$XGETTEXT "$@" 8shift
9$ELUA $LXGETTEXT "$@"
5exit $? 10exit $?
diff --git a/src/bin/elua/xgettext.lua b/src/bin/elua/xgettext.lua
index d4a5ee9b40..b849aefb5f 100644
--- a/src/bin/elua/xgettext.lua
+++ b/src/bin/elua/xgettext.lua
@@ -120,7 +120,7 @@ local opts, args = getopt.parse {
120 { nil, "copyright-holder", true, metavar = "STRING", help = "set " 120 { nil, "copyright-holder", true, metavar = "STRING", help = "set "
121 .. "copyright holder in output" 121 .. "copyright holder in output"
122 }, 122 },
123 { nil, "foreing-user", false, help = "omit copyright in output " 123 { nil, "foreign-user", false, help = "omit copyright in output "
124 .. "for foreign user" 124 .. "for foreign user"
125 }, 125 },
126 { nil, "package-name", true, metavar = "PACKAGE", help = "set package " 126 { nil, "package-name", true, metavar = "PACKAGE", help = "set package "
@@ -158,4 +158,22 @@ local opts, args = getopt.parse {
158 } 158 }
159} 159}
160 160
161if not opts or opts["h"] or opts["v"] then
162 return true
163end
164
165local hasxgettext = os.getenv("XGETTEXT")
166if hasxgettext then
167 local gargs = { "\"" .. hasxgettext .. "\"" }
168 for i = 1, #opts do
169 gargs[#gargs + 1] = "\"" .. arg[i] .. "\""
170 end
171 for i, v in ipairs(args) do
172 if not v:match("^.+%.lua$") then
173 gargs[#gargs + 1] = v
174 end
175 end
176 os.execute(table.concat(gargs, " "))
177end
178
161return true \ No newline at end of file 179return true \ No newline at end of file