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.

eZ debug

Timing: Jan 18 2025 04:25:59
Script start
Timing: Jan 18 2025 04:25:59
Module start 'layout'
Timing: Jan 18 2025 04:25:59
Module start 'content'
Timing: Jan 18 2025 04:26:00
Module end 'content'
Timing: Jan 18 2025 04:26:00
Script end

Main resources:

Total runtime0.9797 sec
Peak memory usage4,096.0000 KB
Database Queries68

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0060 589.1484152.6406
Module start 'layout' 0.00600.0026 741.789139.4688
Module start 'content' 0.00860.9699 781.2578680.5938
Module end 'content' 0.97850.0012 1,461.851616.1563
Script end 0.9797  1,478.0078 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.3389160.0002
Check MTime0.00140.1443160.0001
Mysql Total
Database connection0.00080.085110.0008
Mysqli_queries0.911793.0612680.0134
Looping result0.00090.0923660.0000
Template Total0.945296.520.4726
Template load0.00220.228320.0011
Template processing0.942996.244320.4715
Template load and register function0.00010.010510.0001
states
state_id_array0.00090.093010.0009
state_identifier_array0.00140.139320.0007
Override
Cache load0.00190.1977430.0000
Sytem overhead
Fetch class attribute can translate value0.00060.056240.0001
Fetch class attribute name0.00100.100290.0001
XML
Image XML parsing0.00230.231140.0006
class_abstraction
Instantiating content class attribute0.00000.0016100.0000
General
dbfile0.00140.1479350.0000
String conversion0.00000.000740.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
13content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
7content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
2content/datatype/view/ezxmltags/strong.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/strong.tplEdit templateOverride template
1content/datatype/view/ezxmltags/link.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/link.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 35
 Number of unique templates used: 8

Time used to render debug report: 0.0001 secs