Translate admin tabs (top menu items)

Author Message

Jérôme Vieilledent

Tuesday 28 September 2010 12:34:08 am

Hello

I'd like to translate top menu items (tabs) for my extension, just like the default tabs, but I cannot figure out how to do this...

In menu.ini I found this comment :

# A list of the current navigation parts and their names
# Each entry consists of the identifier as key and the name
# as value.
# Note: If you wish to have the name translatable you will
#       need to create a dummy PHP file with the following in it
# ezi18n( 'kernel/navigationpart', 'Custom navigation', 'Navigation part' );
# This will cause the ezlupdate to include it in the .ts file.
[NavigationPart]
Part[ezcontentnavigationpart]=<span class="s1">Content structure
</span>Part[ezmedianavigationpart]=<span class="s1">Media library
</span>Part[ezusernavigationpart]=<span class="s1">User accounts
</span>Part[ezshopnavigationpart]=<span class="s1">Webshop
</span>Part[ezvisualnavigationpart]=<span class="s1">Design
</span>Part[ezsetupnavigationpart]=<span class="s1">Setup
</span>Part[ezmynavigationpart]=<span class="s1">My account</span>

I'm quite confused with this :-/

Thiago Campos Viana

Friday 01 October 2010 5:24:38 am

I have an extension working, in my menu.ini.append.php I put:

...
[NavigationPart]
Part[ezitemnamenavigationpart]=Item Name Menu

[TopAdminMenu]
Tabs[]=itemname


[Topmenu_itemname]
NavigationPartIdentifier=ezitemnamenavigationpart
Name=Item Name
..

Then in my site.ini.append.php I have:

...
[RegionalSettings]
TranslationExtensions[]=yourextension
...

My translation.ts:

...
<context>
    <name>design/admin/parts/itemname/menu</name>
    <message>
        <source>Item Name</source>
        <translation>The Translation</translation>
    </message>
</context>
...

eZ Publish Certified Developer: http://auth.ez.no/certification/verify/376924

Twitter: http://twitter.com/tcv_br

Jérôme Vieilledent

Saturday 02 October 2010 1:11:17 am

Thanks Thiago for your reply.

Unfortunately this does not seem to work :(. Which eZ Publish version is your example working with ?

menu.ini.append.php :

[NavigationPart]
Part[sqliimportnavigationpart]=Import management

[TopAdminMenu]
Tabs[]=sqliimport

[Topmenu_sqliimport]
NavigationPartIdentifier=sqliimportnavigationpart
Name=Import management
Tooltip=Manage your imports

Translation.ts :

<context>
    <name>design/admin/parts/sqliimport/menu</name>
    <message>
        <source>Import management</source>
        <comment>Navigation part</comment>
        <translation>Gestion des imports</translation>
    </message>
</context>

And of course my extension is enabled for translations ;-)

Damien Pobel

Sunday 03 October 2010 12:50:18 pm

Hi Jérôme,

In ezclasslist, I use the "kernel/navigationpart" as the context name to translate the added tab in the translation file and if I remember correctly it used to work well. However, digging into the kernel, it seems that custom tabs are not translated anymore nor in topmenu operator code, nor in the template. You should open an issue in the issue tracker.

Cheers

Damien
Planet eZ Publish.fr : http://www.planet-ezpublish.fr
Certification : http://auth.ez.no/certification/verify/372448
Publications about eZ Publish : http://pwet.fr/tags/keywords/weblog/ez_publish

Andreas Adelsberger

Tuesday 15 February 2011 6:13:41 am

i checked some really early revisions of the topmenu operator and the design/admin2/templates/page_topmenuitem.tpl. There is no translation for custom tabs in it but if the translation file is missing I get a debug warning:

Missing translation for message in context: 'kernel/navigationpart' with comment: 'Navigation part'. The untranslated message is: 'MyTabName'

To me this means that translation happens somewhere but the output in the template is wrong. I am using 4.4.

There are some hints about this topic in settings/menu.ini but I couldn't find the solution yet.

cheers.

---------------------------------------
Styleflasher New Media OG
Websites. Games/Multimedia.

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