How to extend an existing translation context

Author Message

Piotrek Karaƛ

Saturday 12 January 2008 10:42:53 am

Hello everyone,

How does the translation system work when it comes to extensions? Is it possible to extend existing contexts from within extension's translation files? Should the second instance of the same translation context override (destroy) the primary one completely, or just override new translation phrases, or maybe only fill in the new sources, or not work at all?

Example. There is this tab part:

<context>
    <name>kernel/navigationpart</name>
    <message>
        <source>Content structure</source>
        <comment>Navigation part</comment>
        <translation type="unfinished"></translation>
    </message>
(...)
    <message>
        <source>My account</source>
        <comment>Navigation part</comment>
        <translation type="unfinished"></translation>
    </message>
</context>

What should happen when I declare my own extension with regional settings on, just like this:

<context>
    <name>kernel/navigationpart</name>
    <message>
        <source>My custom tab</source>
        <comment>Navigation part</comment>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <source>My account</source>
        <comment>Navigation part</comment>
        <translation>My super account</translation>
    </message>
</context>

1) The original 'kernel/navigationpart' context gets destroyed?
2) The original gets extended only with 'My custom tab'?
3) The original gets overridden only with 'My super account'?
4) The original gets overridden only with both new values?
5) Nothing happens - you cannot redeclare a context?

I believe understanding this is crucial for developing self-sufficient extensions for admin interface and my tests led me to no single answer...

Thanks!

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu

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:25:52
Script start
Timing: Jan 18 2025 19:25:52
Module start 'layout'
Timing: Jan 18 2025 19:25:52
Module start 'content'
Timing: Jan 18 2025 19:25:53
Module end 'content'
Timing: Jan 18 2025 19:25:53
Script end

Main resources:

Total runtime1.0855 sec
Peak memory usage4,096.0000 KB
Database Queries46

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0048 588.0469152.6406
Module start 'layout' 0.00480.0031 740.687539.4766
Module start 'content' 0.00791.0761 780.1641474.2344
Module end 'content' 1.08400.0015 1,254.39848.1250
Script end 1.0854  1,262.5234 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00370.3400160.0002
Check MTime0.00130.1234160.0001
Mysql Total
Database connection0.00060.059510.0006
Mysqli_queries1.041695.9537460.0226
Looping result0.00050.0448440.0000
Template Total1.050096.720.5250
Template load0.00220.198220.0011
Template processing1.047996.534420.5239
Template load and register function0.00020.015010.0002
states
state_id_array0.00120.111810.0012
state_identifier_array0.00170.153620.0008
Override
Cache load0.00170.1594170.0001
Sytem overhead
Fetch class attribute can translate value0.00040.039610.0004
Fetch class attribute name0.00080.072420.0004
XML
Image XML parsing0.00120.114010.0012
class_abstraction
Instantiating content class attribute0.00000.000520.0000
General
dbfile0.00160.1449170.0001
String conversion0.00000.000540.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
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/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: 10
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs