Forums / Developer / i18n translation not working

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

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.