<URL: http://bugs.freeciv.org/Ticket/Display.html?id=39589 >

There are currently two problems with gettext when compiling Freeciv on
Windows. The first problem is that gettext.m4 doesn't detect external
gettext (in libintl), because the symbol it is looking for
(_nl_msg_cat_cntr) is not defined in the gettext-dev binary release from
ftp://ftp.gtk.org/pub/gtk/v2.10/win32/dependencies/ . I've been working
around this problem in the past by patching gettext.m4 to not to look
for this symbol, but was now able to create a better patch after having
a look at the new glib-gettext.m4 from trunk which takes care of a
similar problem on Solaris. Patches for S2_0, S2_1 and trunk are attached.

The second problem are some msgmft error messages that appear on
Windows, but not on Linux, although the command line looks the same on
both platforms:

(S2_1)

file=./`echo de | sed 's,.*/,,'`.gmo \
  && rm -f $file && /mingw/bin/msgfmt -c --statistics -o $file de.po
de.po:988: number of format specifications in 'msgid' and 'msgstr[0]'
does not match
de.po:3911: number of format specifications in 'msgid' and 'msgstr[0]'
does not match
de.po:6644: number of format specifications in 'msgid' and 'msgstr[0]'
does not match
de.po:7508: number of format specifications in 'msgid' and 'msgstr[0]'
does not match
de.po:8429: number of format specifications in 'msgid' and 'msgstr[0]'
does not match
de.po:8710: number of format specifications in 'msgid' and 'msgstr[0]'
does not match
de.po:9897: number of format specifications in 'msgid' and 'msgstr[0]'
does not match
de.po:11564: number of format specifications in 'msgid' and 'msgstr[0]'
does not match
de.po:14110: number of format specifications in 'msgid' and 'msgstr[0]'
does not match
de.po:14149: number of format specifications in 'msgid' and 'msgstr[0]'
does not match
de.po:16334: number of format specifications in 'msgid' and 'msgstr[0]'
does not match

file=./`echo he | sed 's,.*/,,'`.gmo \
  && rm -f $file && /mingw/bin/msgfmt -c --statistics -o $file he.po
he.po:953: number of format specifications in 'msgid' and 'msgstr[0]'
does not match
he.po:960: number of format specifications in 'msgid' and 'msgstr[0]'
does not match
he.po:3536: number of format specifications in 'msgid' and 'msgstr[0]'
does not match
he.po:5883: number of format specifications in 'msgid' and 'msgstr[0]'
does not match
he.po:8977: number of format specifications in 'msgid' and 'msgstr[0]'
does not match
he.po:8984: number of format specifications in 'msgid' and 'msgstr[0]'
does not match
he.po:8994: number of format specifications in 'msgid' and 'msgstr[0]'
does not match
he.po:13149: number of format specifications in 'msgid' and 'msgstr[0]'
does not match
he.po:13240: number of format specifications in 'msgid' and 'msgstr[0]'
does not match
he.po:14325: number of format specifications in 'msgid' and 'msgstr[0]'
does not match
he.po:15266: number of format specifications in 'msgid' and 'msgstr[0]'
does not match

file=./`echo nl | sed 's,.*/,,'`.gmo \
  && rm -f $file && /mingw/bin/msgfmt -c --statistics -o $file nl.po
nl.po:1885: number of format specifications in 'msgid' and 'msgstr[0]'
does not match
nl.po:9889: number of format specifications in 'msgid' and 'msgstr[0]'
does not match
nl.po:9906: number of format specifications in 'msgid' and 'msgstr[0]'
does not match


My workaround so far was to remove the "-c" argument from the msgfmt
command in po/Makefile.in.in, but perhaps there's really a problem with
the .po files (but then I don't know why it's not reported on Linux). A
quick look at the reported locations showed translated strings that omit
the format placeholder of the original string and write a fixed number
instead (e.g. %d -> 1 or a word expressing the number 1). If the .po
files are ok, we'd need to either remove the "-c" argument completely or
add some kind of platform check that removes the argument only on Windows.


Index: m4/gettext.m4
===================================================================
--- m4/gettext.m4	(revision 13356)
+++ m4/gettext.m4	(working copy)
@@ -95,7 +95,14 @@
 		  [bindtextdomain ("", "");
 return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
 		  gt_cv_func_gnugettext_libintl=yes,
-		  gt_cv_func_gnugettext_libintl=no)
+		  [case $host in
+	            *mingw*)
+	              gt_cv_func_gnugettext_libintl=yes
+                      ;;
+	            *)
+	              gt_cv_func_gnugettext_libintl=no
+	              ;;
+	          esac])
 		LIBS="$gt_save_LIBS"])
 	   fi
 
Index: m4/glib-gettext.m4
===================================================================
--- m4/glib-gettext.m4	(revision 13356)
+++ m4/glib-gettext.m4	(working copy)
@@ -240,6 +240,10 @@
 	      [CATOBJEXT=.mo
                DATADIRNAME=lib])
 	    ;;
+	    *mingw*)
+	    CATOBJEXT=.gmo
+            DATADIRNAME=share
+            ;;
 	    *)
 	    CATOBJEXT=.mo
             DATADIRNAME=lib
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to