Page 1 of 1

ImageMagick-6.3.5 locale management + french.xml

Posted: 2007-09-03T11:54:50-07:00
by Gozer404
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) ?

Re: ImageMagick-6.3.5 locale management + french.xml

Posted: 2007-09-04T03:34:07-07:00
by Gozer404
Still fighting to translate english.xml to francais.xml:
a lot of messages were not found inside the code (ImageMagick-6.3.5-7) :

Code: Select all

for message in `grep "message name=" ./config/english.xml | sed -e 's/^ *<message name="//' -e 's/">.*$//' | sort -u`; do printf "+ $message : " ; grep -r $message . | egrep -v "^\.\/config|^\.\/www"  | wc -l; done
Parts of the result:
+ AnerrorHasOccurredReadingFromFile : 0
+ AnerrorHasOccurredWritingToFile : 0
+ ColorTypeNotSupported : 0
+ CompressNotValid : 0
+ DiskAllocationFailed : 0
+ DPSLibraryIsNotAvailable : 0
+ FPXLibraryIsNotAvailable : 0
+ FractalCompressNotSupported : 0
+ ImageColorspaceDiffers : 0
+ ImageExpected : 0
+ ImageInfoExpected : 0
+ ImageOpacityDiffers : 0
+ ImageResolutionNotDefined : 0
+ ImageSmallerThanKernelWidth : 0
+ IncompatibleSizeOfDouble : 0
+ InputImagesAlreadySpecified : 0
../..
+ UnsupportedLevel : 0
+ UnsupportedRLEImagefile : 0
+ XMLLibraryIsNotAvailable : 0
+ ZipCompressNotSupported : 0
In total 88 messages are not in the code...

Does this needs to be removed ?

I saw also a strange part in the xml file:
<Magnfiy>
<message name="Image">
Magnfiy image
</message>
</Magnfiy>
Shouldn't it be replaced by "magnify" ?

Re: ImageMagick-6.3.5 locale management + french.xml

Posted: 2007-09-04T06:06:07-07:00
by magick
We will fix the problems you reported in ImageMagick 6.3.5-9 Beta within a day or two. Thanks for alerting us to the problems.

Re: ImageMagick-6.3.5 locale management + french.xml

Posted: 2007-09-04T06:43:17-07:00
by Gozer404
Complete patch for the above stuff is available here :
http://rpmfarm.free.fr/src/ImageMagick-6.3.5-patch