Author: cazfi
Date: Mon Dec 29 04:05:36 2014
New Revision: 27434

URL: http://svn.gna.org/viewcvs/freeciv?rev=27434&view=rev
Log:
Replaced hack to edit xgettext keywords in the Makefiles with sed
by cleanly defining them in the Makevars

See patch #5612

Modified:
    trunk/configure.ac
    trunk/translations/freeciv/Makevars
    trunk/translations/nations/Makevars
    trunk/translations/ruledit/Makevars

Modified: trunk/configure.ac
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/configure.ac?rev=27434&r1=27433&r2=27434&view=diff
==============================================================================
--- trunk/configure.ac  (original)
+++ trunk/configure.ac  Mon Dec 29 04:05:36 2014
@@ -1301,34 +1301,6 @@
 TOLUA_LIBS="\$(top_builddir)/dependencies/tolua-5.2/src/lib/libtolua.la"
 AC_SUBST([TOLUA_CFLAGS])
 AC_SUBST([TOLUA_LIBS])
-
-dnl Freeciv uses a non-standard macro, Q_(), to handle cases of qualified
-dnl translatable strings and macro PL_() to handle plural forms.
-dnl Since the Gettext supplied Autoconf support
-dnl doesn't seem to have a way to add new keywords to its xgettext call,
-dnl we do the following.
-dnl The Gettext supplied Autoconf support starts with
-dnl 'translations/<domain>/Makefile.in.in', and builds
-dnl 'translations/<domain>/Makefile.in' then 'translations/<domain>/Makefile'.
-dnl In order for the commonly used _() and N_() macros to work, there
-dnl should be somewhere in that 'translations/<domain>/Makefile' a call
-dnl to xgettext with "--keyword=_" and "--keyword=N_" as arguments.
-dnl To support Q_() and PL_(), the following simply replaces instances of 
-dnl "--keyword=N_" with "--keyword=N_ --keyword=Q_ --keyword=PL_:1,2"
-dnl in the 'translations/<domain>/Makefile' file.
-AC_CONFIG_COMMANDS([fc_default-1],[[for domain in $PODOMAINS ; do
-   if test -f translations/${domain}/Makefile ; then
-     if grep 'keyword=N_ --keyword=Q_ --keyword=PL_:1,2' 
translations/${domain}/Makefile >/dev/null 2>&1 ; then
-       # has already been extended
-       :
-     else
-       echo extending translations/${domain}/Makefile
-       mv -f translations/${domain}/Makefile 
translations/${domain}/Makefile.tmp
-       sed -e 's/--keyword=N_/--keyword=N_ --keyword=Q_ --keyword=PL_:1,2/g' 
translations/${domain}/Makefile.tmp > translations/${domain}/Makefile
-       rm translations/${domain}/Makefile.tmp
-     fi
-   fi
- done]],[PODOMAINS="$PODOMAINS"])
 
 dnl Vast quantities of meaningless errors from xgettext is also annoying.
 dnl We fix this by forcing xgettext to assume all files are C source files.

Modified: trunk/translations/freeciv/Makevars
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/translations/freeciv/Makevars?rev=27434&r1=27433&r2=27434&view=diff
==============================================================================
--- trunk/translations/freeciv/Makevars (original)
+++ trunk/translations/freeciv/Makevars Mon Dec 29 04:05:36 2014
@@ -11,6 +11,7 @@
 XGETTEXT_OPTIONS = \
   --keyword=_ --flag=_:1:pass-c-format \
   --keyword=N_ --flag=N_:1:pass-c-format \
+  --keyword=--keyword=Q_ --keyword=PL_:1,2 \
   --flag=error:3:c-format --flag=error_at_line:5:c-format
 
 # This is the copyright holder that gets inserted into the header of the

Modified: trunk/translations/nations/Makevars
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/translations/nations/Makevars?rev=27434&r1=27433&r2=27434&view=diff
==============================================================================
--- trunk/translations/nations/Makevars (original)
+++ trunk/translations/nations/Makevars Mon Dec 29 04:05:36 2014
@@ -11,6 +11,7 @@
 XGETTEXT_OPTIONS = \
   --keyword=_ --flag=_:1:pass-c-format \
   --keyword=N_ --flag=N_:1:pass-c-format \
+  --keyword=--keyword=Q_ --keyword=PL_:1,2 \
   --flag=error:3:c-format --flag=error_at_line:5:c-format
 
 # This is the copyright holder that gets inserted into the header of the

Modified: trunk/translations/ruledit/Makevars
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/translations/ruledit/Makevars?rev=27434&r1=27433&r2=27434&view=diff
==============================================================================
--- trunk/translations/ruledit/Makevars (original)
+++ trunk/translations/ruledit/Makevars Mon Dec 29 04:05:36 2014
@@ -11,6 +11,7 @@
 XGETTEXT_OPTIONS = \
   --keyword=_ --flag=_:1:pass-c-format \
   --keyword=N_ --flag=N_:1:pass-c-format \
+  --keyword=--keyword=Q_ --keyword=PL_:1,2 \
   --keyword=R__ \
   --flag=error:3:c-format --flag=error_at_line:5:c-format
 


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to