Forums / Setup & design / Translate admin tabs (top menu items)

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.

eZ debug

Timing: Jan 18 2025 00:48:16
Script start
Timing: Jan 18 2025 00:48:16
Module start 'content'
Timing: Jan 18 2025 00:48:17
Module end 'content'
Timing: Jan 18 2025 00:48:17
Script end

Main resources:

Total runtime1.0235 sec
Peak memory usage4,096.0000 KB
Database Queries205

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0098 587.8125180.8359
Module start 'content' 0.00980.9138 768.6484683.7578
Module end 'content' 0.92360.0998 1,452.4063341.0859
Script end 1.0234  1,793.4922 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00400.3940210.0002
Check MTime0.00150.1467210.0001
Mysql Total
Database connection0.00080.076110.0008
Mysqli_queries0.943592.17952050.0046
Looping result0.00190.18212030.0000
Template Total0.991096.820.4955
Template load0.00220.213720.0011
Template processing0.988896.609820.4944
Template load and register function0.00010.009810.0001
states
state_id_array0.00100.093710.0010
state_identifier_array0.00090.084920.0004
Override
Cache load0.00190.1838430.0000
Sytem overhead
Fetch class attribute can translate value0.00120.113250.0002
Fetch class attribute name0.00110.108690.0001
XML
Image XML parsing0.00220.219250.0004
class_abstraction
Instantiating content class attribute0.00000.0034100.0000
General
dbfile0.00290.2838460.0001
String conversion0.00000.000930.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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