template operator i18n

Author Message

justin kazadi

Wednesday 07 May 2008 5:21:55 am

hello ,

I have two siteaccess eng(english ) and fre (french). the primary language is english.
i have write in one of my template this line :

{"Pour creer un compte, remplir le formulaire ci-dessous:"|i18n} .

but on english and frnch i have the same string.

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

Gaetano Giunta

Wednesday 07 May 2008 5:55:18 am

A - did you create your translation files with the two versions of the text? Translation does not happen magically on its own

B - there is an ini setting that allows/disallows the translation of the templates (which is different from translation of object content)

Principal Consultant International Business
Member of the Community Project Board

justin kazadi

Wednesday 07 May 2008 6:16:49 am

hi,
no i didn't create the translation files and i don't know what ini settings files to use. Please can 't you explain me what to do exactly.

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

Gaetano Giunta

Wednesday 07 May 2008 11:58:58 am

I think you can find some good explanations on setting up template translations in the existing forum posts.

A cursory search turned up eg. this one: http://ez.no/developer/forum/setup_design/define_words_and_use_them_in_different_languages/re_define_words_and_use_them_in_different_lang

The ini setting is TextTranslation, in the RegionalSettings section of site.ini. By default it is set to enabled

Principal Consultant International Business
Member of the Community Project Board

justin kazadi

Thursday 08 May 2008 4:22:12 am

hi,
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')}

but this text aren't translated.

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

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 20 2025 17:37:51
Script start
Timing: Jan 20 2025 17:37:51
Module start 'layout'
Timing: Jan 20 2025 17:37:51
Module start 'content'
Timing: Jan 20 2025 17:37:52
Module end 'content'
Timing: Jan 20 2025 17:37:52
Script end

Main resources:

Total runtime1.0088 sec
Peak memory usage4,096.0000 KB
Database Queries63

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0054 587.9063151.2109
Module start 'layout' 0.00540.0023 739.117236.6328
Module start 'content' 0.00771.0002 775.7500592.5625
Module end 'content' 1.00780.0009 1,368.312515.8750
Script end 1.0087  1,384.1875 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00370.3693160.0002
Check MTime0.00140.1349160.0001
Mysql Total
Database connection0.00070.069210.0007
Mysqli_queries0.949794.1489630.0151
Looping result0.00060.0599610.0000
Template Total0.975896.720.4879
Template load0.00220.219220.0011
Template processing0.973696.516920.4868
Template load and register function0.00010.009710.0001
states
state_id_array0.00140.138810.0014
state_identifier_array0.00120.117620.0006
Override
Cache load0.00180.1826440.0000
Sytem overhead
Fetch class attribute can translate value0.00060.055620.0003
Fetch class attribute name0.00110.109970.0002
XML
Image XML parsing0.00130.131420.0007
class_abstraction
Instantiating content class attribute0.00000.0029100.0000
General
dbfile0.00100.0945220.0000
String conversion0.00000.000640.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
5content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
5content/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
5content/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: 25
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs