ImageMagick-6.3.5 locale management + french.xml
Posted: 2007-09-03T11:54:50-07:00
Edit: As it may not be so clear, the bug is: translations are not taken in account unless you used the patch shown at the end...
I discovered in ImageMagick-6.3.5 the new (?) locale and i18n stuff, I updated some config files and tried
to have a working translation.
Here are some changes I've done:
--- ImageMagick-6.3.5/config/locale.xml.EL 2005-08-11 04:21:51.000000000 +0200
+++ ImageMagick-6.3.5/config/locale.xml 2007-08-23 13:04:13.000000000 +0200
@@ -17,6 +17,7 @@
<include locale="et_EE.ISO-8859-1" file="estonian.xml" />
<include locale="fi_FI.ISO-8859-1" file="finnish.xml" />
<include locale="fr_FR.ISO-8859-1" file="francais.xml" />
+ <include locale="fr_FR.UTF-8" file="francais.xml" />
<include locale="fr_FR.ISO-8859-1" file="french.xml" />
<include locale="gl_ES.ISO-8859-1" file="galego.xml" />
<include locale="gl_ES.ISO-8859-1" file="galician.xml" />
--- ImageMagick-6.3.5/config/Makefile.am.EL 2007-01-21 02:58:31.000000000 +0100
+++ ImageMagick-6.3.5/config/Makefile.am 2007-08-23 13:04:13.000000000 +0200
@@ -33,6 +33,7 @@
config/configure.xml \
config/delegates.xml \
config/english.xml \
+ config/francais.xml \
config/locale.xml \
config/type.xml \
config/type-ghostscript.xml \
Then I created francais.xml (available on request !) ... but nothing was translated :-<
My final patch to have this working is:
--- ImageMagick-6.3.5/magick/locale.c.EL 2007-06-05 20:48:46.000000000 +0200
+++ ImageMagick-6.3.5/magick/locale.c 2007-08-23 13:04:13.000000000 +0200
@@ -589,6 +589,13 @@
register const char
*p;
+ /* LANG=C man 3 setlocale:
+ * On startup of the main program, the portable "C" locale is selected as
+ * default. A program may be made portable to all locales by calling set-
+ * locale(LC_ALL, "" ) after program initialization [../..]
+ */
+ (void)setlocale(LC_ALL, "");
+
locale=(char *) NULL;
p=setlocale(LC_CTYPE,(const char *) NULL);
if (p != (const char *) NULL)
What do you think of this change ? Is it really correct (the info in comments are from the manpage of setlocale) ?
I discovered in ImageMagick-6.3.5 the new (?) locale and i18n stuff, I updated some config files and tried
to have a working translation.
Here are some changes I've done:
--- ImageMagick-6.3.5/config/locale.xml.EL 2005-08-11 04:21:51.000000000 +0200
+++ ImageMagick-6.3.5/config/locale.xml 2007-08-23 13:04:13.000000000 +0200
@@ -17,6 +17,7 @@
<include locale="et_EE.ISO-8859-1" file="estonian.xml" />
<include locale="fi_FI.ISO-8859-1" file="finnish.xml" />
<include locale="fr_FR.ISO-8859-1" file="francais.xml" />
+ <include locale="fr_FR.UTF-8" file="francais.xml" />
<include locale="fr_FR.ISO-8859-1" file="french.xml" />
<include locale="gl_ES.ISO-8859-1" file="galego.xml" />
<include locale="gl_ES.ISO-8859-1" file="galician.xml" />
--- ImageMagick-6.3.5/config/Makefile.am.EL 2007-01-21 02:58:31.000000000 +0100
+++ ImageMagick-6.3.5/config/Makefile.am 2007-08-23 13:04:13.000000000 +0200
@@ -33,6 +33,7 @@
config/configure.xml \
config/delegates.xml \
config/english.xml \
+ config/francais.xml \
config/locale.xml \
config/type.xml \
config/type-ghostscript.xml \
Then I created francais.xml (available on request !) ... but nothing was translated :-<
My final patch to have this working is:
--- ImageMagick-6.3.5/magick/locale.c.EL 2007-06-05 20:48:46.000000000 +0200
+++ ImageMagick-6.3.5/magick/locale.c 2007-08-23 13:04:13.000000000 +0200
@@ -589,6 +589,13 @@
register const char
*p;
+ /* LANG=C man 3 setlocale:
+ * On startup of the main program, the portable "C" locale is selected as
+ * default. A program may be made portable to all locales by calling set-
+ * locale(LC_ALL, "" ) after program initialization [../..]
+ */
+ (void)setlocale(LC_ALL, "");
+
locale=(char *) NULL;
p=setlocale(LC_CTYPE,(const char *) NULL);
if (p != (const char *) NULL)
What do you think of this change ? Is it really correct (the info in comments are from the manpage of setlocale) ?