Forums / General / Translations & encoding problems (.ts files)

Translations & encoding problems (.ts files)

Author Message

Ludovic André

Thursday 08 February 2007 12:10:06 am

Hi all,

I'm currently having a problem with the translation system. I'm generating the XML translation file on a server A, and I noticed that special characters (like é, è, ...) are converted to the HEX HTML code (é, ...). So far, this is still working on my server A, sentences containing those special characters are still found by the CMS, and the translation is correctly displayed. Now, I moved my translation.ts files to a server B, and there the special characters are not found anymore, the CMS can't find the 'source' sentence in the translation.ts file, and all those messages containing the special characters are not translated anymore... (but the others are!)

Which differences between server A & B could lead to that problem?
(Please note that I opened the template file & translation file on server B to see if there was any problems after uploading the files, and there are no changes with server A, the content is the same - the eZ setup of the site itself is also the same).

Thanks for your help!

Ludovic André

Ludovic André

Thursday 08 February 2007 12:52:26 am

Some more details about my problem:

After some tests inside the eZ code, I found out this difference between server A & B, when ez is looking for the translations:

server A, running fine:

eztranslatormanager Object
(
    [Handlers] => Array
        (
            [0] => eztstranslator Object
                (
                    [IsKeyBased] => 1
                    [Messages] => Array
                        (
                            [3bf24ce0ec94cd82720184848a1d31f6] => Array
                                (
                                    [context] => bcee/dpp
                                    [source] => Demande de prêt personnel
                                    [comment] => 
                                    [translation] => Personal loan request
                                    [key] => 3bf24ce0ec94cd82720184848a1d31f6
                                )

server B, same scripts,

eztranslatormanager Object
(
    [Handlers] => Array
        (
            [0] => eztstranslator Object
                (
                    [IsKeyBased] => 1
                    [Messages] => Array
                        (
                            [f9f26a43b59903480b4f9c7e5e8cc5ed] => Array
                                (
                                    [context] => bcee/dpp
                                    [source] => Demande de prêt personnel
                                    [comment] => 
                                    [translation] => Personal loan request
                                    [key] => f9f26a43b59903480b4f9c7e5e8cc5ed
                                )

So on server B, it's not converting back the ê into " ê ", and then the md5 key is not correct anymore...

If that can help you (to help me ;) )

Thanks!

Ludovic André

Ludovic André

Thursday 08 February 2007 5:01:52 am

Ok, quick update :) I'm answering my own questions ;)

So, what I did right now, is a quick php script to convert those hex html entities to the real character behind, and then use iconv to encode the file into utf8.

As from now, everything is now running fine, my translations are correctly taken into account...

But, it would be really great If I could skip this step of converting the file... why does not ezlupdate generate directly the file into utf8 ? (like the translations.ts which come with the original distribution?)

Ludovic André