Translation trouble

Author Message

Christian Johansen

Thursday 05 July 2007 7:25:01 am

I'm having some trouble with translation on a site. Even though everything <i>seems</i> right, only template text strings are translated, not regular content.

I have this:

settings/override/site.ini:

[SiteSettings]
DefaultAccess=mysite_no
SiteList[]=mysite_no
SiteList[]=mysite_en

settings/siteaccess/mysite_en/site.ini.append:

[RegionalSettings]
Locale=eng-GB
ContentObjectLocale=eng-GB

[ExtensionSettings]
ActiveExtensions[]=mysite_site
# This doesn't seem right, but settings aren't properly read
# from the extension without it. Putting it in override/site.ini
# 'destroys' the admin...
ActiveAccessExtensions[]=mysite_site

In extenstion/mysite_site/settings/site.ini.append:

[RegionalSettings]
ShowUntranslatedObjects=enabled
SiteLanguageList[]=nor-NO
SiteLanguageList[]=eng-GB
TextTranslation=enabled
TranslationExtensions[]=mysite_site

The text strings from extension/mysite_site/translation/eng-GB/translation.ts make their way into the GUI (ie they work). However, all content is displayed in nor-NO, even content that has been translated. I have a siteaccess with the exact same setup and locales nor-NO, which work (ie, all text and content is norwegian).

All content has been added in norwegian, then translated, may that have something to do with this?

Also, showing the guts of a node with attribute(show) tells me (among other things) this:

name 	string 	'Norskt navn'
default_language 	string 	'eng-GB'
current_language 	string 	'nor-NO'
language_js_array 	string 	'[ { locale: 'nor-NO', name: 'Norsk (Bokmål)' }, { locale: 'eng-GB', name: 'English (United Kingdom)' } ]'

Anyone spot any errors on my end?

André R.

Thursday 05 July 2007 7:56:39 am

try switching the order:

SiteLanguageList[]=eng-GB
SiteLanguageList[]=nor-NO

EDIT: and shouldn't 'extenstion/mysite_site/settings/site.ini.append:' be mysite_en ?

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

Christian Johansen

Thursday 05 July 2007 2:19:15 pm

Ah, thanks alot, that did the trick. Actually I had to move the settings from the extension into each siteaccess since it needs to be different for norwegian and english siteaccsesses.

The extension contains all the common settings etc, so each siteaccess now consist only of one file - site.ini.appen with the following content:

#?ini charset="utf-8"?

[SiteSettings]
SiteName=Mysite
SiteURL=www.example.com
IndexPage=/content/view/full/59/
DefaultPage=/content/view/full/59/

[SiteAccessSettings]
RelatedSiteAccessList[]=mysite_no

[RegionalSettings]
Locale=eng-GB
SiteLanguageList[]=eng-GB
SiteLanguageList[]=nor-NO
ContentObjectLocale=eng-GB

[ExtensionSettings]
ActiveExtensions[]=mysite
ActiveAccessExtensions[]=mysite

Both site accesses use this extension which really holds all the normal things - translations, design, settings - all collected in one single place.

It's working like a charm and I'm really satisfied with the results as the settings/templates are really DRY now :)

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