i18n translation not working

Author Message

Pierre SCALFATI

Thursday 16 April 2009 5:27:46 am

Hello,

I've the following code in my template :


<a href={concat( "/content/tipafriend/", $node.node_id )|ezurl} title="{'Tip a friend'|i18n( 'design/ezwebin/full/article' )}">{'Tip a friend'|i18n( 'design/ezwebin/full/article' )}</a>

In my French translation file I should get the equivalent translation, but it doesn't work. I always get the English value. All my site.ini.append.php files are correctly configured to get the French translation. Here is the content for ini files :


[RegionalSettings]
Locale=fre-FR
ContentObjectLocale=fre-FR
ShowUntranslatedObjects=disabled
SiteLanguageList[]=fre-FR
SiteLanguageList[]=eng-GB
TextTranslation=enabled
ShowUntranslatedObjects=disabled

My translation.ts file is correctly :

<message>
<source>Tip a friend</source>
<translation>Suggérer à un ami</translation>
</message>

There's only one thing I didn't understand in the translation.ts file, it's the <context> tag.

I've got many context tags corresponding to my "Tip a friend" label. Here are the different contexts :
1) <name>design/base</name>

2) <name>design/standard/content/tipafriend</name>

3) <name>kernel/content</name>

If someone can give me some explanation concerning the fact that I cannot get my translations in French.

Many thanks.

Guillaume Marty

Thursday 16 April 2009 7:05:58 am

Hello Pierre,

I don't know if I got the point but having a look to your code, it seems obvious that if you don't have a

<name>design/ezwebin/full/article</name>

in your translation file, there is no chance it will work.

The parameter given to the i18n function is the context name....

I hope this can be of some help...

Cheers

Pierre SCALFATI

Thursday 16 April 2009 7:58:32 am

Ok, many thanks, I had little doubts concerning the fact that context tag was concerned, I made the changes you mentioned and it's now working.

Many Thanks.

Best regards.

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 11:06:15
Script start
Timing: Jan 18 2025 11:06:15
Module start 'layout'
Timing: Jan 18 2025 11:06:15
Module start 'content'
Timing: Jan 18 2025 11:06:15
Module end 'content'
Timing: Jan 18 2025 11:06:15
Script end

Main resources:

Total runtime0.8179 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0078 587.9141152.6250
Module start 'layout' 0.00780.0037 740.539139.4453
Module start 'content' 0.01150.8046 779.9844473.9688
Module end 'content' 0.81610.0017 1,253.953112.1641
Script end 0.8178  1,266.1172 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00370.4563160.0002
Check MTime0.00150.1854160.0001
Mysql Total
Database connection0.00180.218510.0018
Mysqli_queries0.765593.6034570.0134
Looping result0.00050.0657550.0000
Template Total0.781695.620.3908
Template load0.00230.286220.0012
Template processing0.779395.281320.3896
Template load and register function0.00020.026910.0002
states
state_id_array0.00100.127010.0010
state_identifier_array0.00150.182720.0007
Override
Cache load0.00180.2203320.0001
Sytem overhead
Fetch class attribute can translate value0.00120.140720.0006
Fetch class attribute name0.00130.158430.0004
XML
Image XML parsing0.00020.030020.0001
class_abstraction
Instantiating content class attribute0.00000.000930.0000
General
dbfile0.00070.0854100.0001
String conversion0.00000.001240.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
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 18
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs