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.

eZ debug

Timing: Jan 18 2025 19:32:18
Script start
Timing: Jan 18 2025 19:32:18
Module start 'layout'
Timing: Jan 18 2025 19:32:18
Module start 'content'
Timing: Jan 18 2025 19:32:19
Module end 'content'
Timing: Jan 18 2025 19:32:19
Script end

Main resources:

Total runtime0.7066 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.0074 587.9063152.6250
Module start 'layout' 0.00740.0144 740.531339.4297
Module start 'content' 0.02180.6832 779.9609547.5469
Module end 'content' 0.70510.0015 1,327.507812.1875
Script end 0.7066  1,339.6953 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.4907160.0002
Check MTime0.00140.2003160.0001
Mysql Total
Database connection0.00180.257710.0018
Mysqli_queries0.639390.4712570.0112
Looping result0.00060.0826550.0000
Template Total0.659593.320.3298
Template load0.00240.340420.0012
Template processing0.657192.987420.3285
Template load and register function0.00020.034410.0002
states
state_id_array0.00120.173410.0012
state_identifier_array0.00100.147020.0005
Override
Cache load0.00200.2880270.0001
Sytem overhead
Fetch class attribute can translate value0.00080.118620.0004
Fetch class attribute name0.00140.203640.0004
XML
Image XML parsing0.00060.088220.0003
class_abstraction
Instantiating content class attribute0.00000.001240.0000
General
dbfile0.00100.1416170.0001
String conversion0.00000.001040.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
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
6content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 21
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs