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é

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 22:13:05
Script start
Timing: Jan 18 2025 22:13:05
Module start 'layout'
Timing: Jan 18 2025 22:13:05
Module start 'content'
Timing: Jan 18 2025 22:13:05
Module end 'content'
Timing: Jan 18 2025 22:13:05
Script end

Main resources:

Total runtime0.7182 sec
Peak memory usage4,096.0000 KB
Database Queries55

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0050 588.0391152.6406
Module start 'layout' 0.00500.0024 740.679739.4609
Module start 'content' 0.00750.7093 780.1406473.3281
Module end 'content' 0.71680.0014 1,253.468812.1406
Script end 0.7182  1,265.6094 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00290.4077160.0002
Check MTime0.00130.1793160.0001
Mysql Total
Database connection0.00100.137010.0010
Mysqli_queries0.673893.8151550.0123
Looping result0.00050.0762530.0000
Template Total0.689496.020.3447
Template load0.00180.257620.0009
Template processing0.687695.736120.3438
Template load and register function0.00020.027910.0002
states
state_id_array0.00130.182010.0013
state_identifier_array0.00080.104820.0004
Override
Cache load0.00150.2149230.0001
Sytem overhead
Fetch class attribute can translate value0.00060.081510.0006
Fetch class attribute name0.00110.147630.0004
XML
Image XML parsing0.00010.019110.0001
class_abstraction
Instantiating content class attribute0.00000.001230.0000
General
dbfile0.00110.1492100.0001
String conversion0.00000.000840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 14
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs