Forums / Developer / How to extend an existing translation context

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