problem with i18n in my english web site

Author Message

justin kazadi

Monday 12 May 2008 4:23:52 am

hello all,

I have two siteaccess (french and english).I want to translate some words in english with the .ts file.
My primary /main language is english(eng-GB).

first of all, i have created my extension call traductionkazadi. In extension/traduction/settings/site.ini i have add TranslationExtensions[]=traductionkazadi on [RegionalSettings] section and
[TemplateSettings]
ExtensionAutoloadPath[]=traductionkazadi.

secondly i have add ActiveExtensions[]=traductionkazadi on [ExtensionSettings] section of settings/override/site.ini to activate my extension.

after this i have create a file translation.ts in extension/traductionkazadi/translations/fre-FR.
this file contains:"

<!DOCTYPE TS><TS>
<context>
<name>traductionkazadi</name>
<message>
<source>Pour creer un compte, remplir le formulaire ci-dessous:</source>
<translation>To create your account, fill the fields of the form below:</translation>
</message>
</context>
</TS>
"
in my templates i have write this:"

{"Pour creer un compte, remplir le formulaire ci-dessous:"|i18n('traductionkazadi')}

and in my french web site i have :
"to create your account ,fill the fields of the form below "
but in my english web site i have :" pour creer un compte, remplir le formulaire ci-dessous" (the words aren't translated). i don't know why it didn't works in my english web site. Please help me.
thanks in advance.

The theory is when we know everything and nothing works.
The practice is when everything works and nobody knows why.
If the practice and theory are met, nothing works and we do not know why.

Albert Einstein

Maxime Thomas

Monday 12 May 2008 11:11:18 am

Hi,

I know that in former version (3.8.x) , the english (eng-GB) was the source language. It means that it wasn't translated. i18n always returned the "operatorValue", in your case : "Pour creer un compte, remplir le formulaire ci-dessous:".

Some tips :
- use the QT Linguist translation tool : ftp://ftp.trolltech.com/qt/pre-releases/
- use the translation script made by eZ Systems (available in the share directory).
- always use english as neutral language in your templates (because you cannot translate eng-GB).

Maxime Thomas
maxime.thomas@wascou.org | www.wascou.org | http://twitter.com/wascou

Company Blog : http://www.wascou.org/eng/Company/Blog
Technical Blog : http://share.ez.no/blogs/maxime-thomas

Arnaud Lafon

Thursday 27 November 2008 9:01:23 am

Hey,

I bump this topic cuz I'd like to know why we cannot translate eng-GB (ie: I want my source language to be french and my translation in english).

Can someone explain me why there is this in kernel/common/i18n.php line 137 ?

    function eZTranslateText( $context, $source, $comment = null, $arguments = null )
    {
        $ini = eZINI::instance();
        if ( $ini->variable( 'RegionalSettings', 'Locale' ) == 'eng-GB' )
        {
            // we don't have ts-file for 'eng-GB'.
            // NOTE: don't remove this 'if'. it's needed to support dynamic switch between translations.
            return ezinsertarguments( $source, $arguments );
        }

If I remove the If, everything seems to be ok... I'm sorry I can't understand the "NOTE"...

Looking for information about SQLI ?
Looking for a new job in Paris ?
Please contact me at alafon [at] sqli [dot] com

André R.

Thursday 27 November 2008 11:42:13 am

eZ Publish uses eng-GB as the main language, if you want to use the i18n system, do so as well. (in other words have the english string in the templates and your french translation in .ts files).

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Arnaud Lafon

Friday 28 November 2008 1:34:46 am

Thx for your fast reply André.

I hope translating into eng-GB will be possible...

Looking for information about SQLI ?
Looking for a new job in Paris ?
Please contact me at alafon [at] sqli [dot] com

Gaetano Giunta

Friday 28 November 2008 1:48:47 pm

the quickest way to "fix" english translations or to have the source in other languages is to declare the site to be using eng-US intead of eng-GB. Then it will be translated.

You can copy over the eng-GB translations to the eng-US folders if you still want to keep the european version...

Principal Consultant International Business
Member of the Community Project Board

Arnaud Lafon

Monday 01 December 2008 2:24:37 am

Hey Gaetano!

Thanks for your reply. This is a good idea!

See you!

Looking for information about SQLI ?
Looking for a new job in Paris ?
Please contact me at alafon [at] sqli [dot] com

Irma Vrignaud

Tuesday 24 May 2011 6:14:04 am

Hi,

Thanks for the trick Gaetano ; I implemented it on my website (source French, translated in english) but this means I also have to add translation in eng-US for all my content in the back-office. Is there a way to define a fallback eng-US -> eng-GB as it's already the case for .ts files please?

Thanks,

Irma

Gaetano Giunta

Wednesday 25 May 2011 1:05:10 am

@Irma I do not think you need to do that. Content languages are defined independently of template language, so you can use eng-US for templates and eng-UK for content (both editing it and displaying it)

Principal Consultant International Business
Member of the Community Project Board

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