Translation of "Dashboard" in the breadcrumb

2,042 views
Skip to first unread message

Cédric Valcke

unread,
Apr 26, 2012, 9:29:28 AM4/26/12
to sonata...@googlegroups.com
Hi,

I am not able to translate the first item of the breadcrumb.

My admin use the selected culture (FR) file but the "Dashboard" word is not translated although there is a node in the SonataAdminBundle.fr.xliff file.

Here is the node :
<trans-unit id="link_breadcrumb_dashboard">
    <source>breadcrumb.link_dashboard</source>
    <target>&#8962;</target>
</trans-unit>

I tried to put this node in my own translation file but nothing happens.

is there something I have forgot ?

Regs

Jakala

unread,
Apr 26, 2012, 10:06:09 AM4/26/12
to sonata...@googlegroups.com
hi,

do you try to clean cache?
sometimes is needed to clean cache. Always when you change somethings in your catalogs.

Cédric Valcke

unread,
Apr 26, 2012, 10:13:45 AM4/26/12
to sonata...@googlegroups.com
Yes I did it but nothing is changing .. 

It's like it didn't find the node in the translation file.

Here is the code that add the 'Dashboard' at the beginning of the breadcrumb:

//SonataAdminBundle/Admin/Admin.php

...
 $child = $menu->addChild(
            $this->trans($this->getLabelTranslatorStrategy()->getLabel('dashboard', 'breadcrumb', 'link'), array(), 'SonataAdminBundle'),
            array('uri' => $this->routeGenerator->generate('sonata_admin_dashboard'))
        );
...

When I try to change the first parameter of the getLabel (just for debugging) it works.

Perhaps I should down deeper in the getLabel method to understand.

Regs

Cédric Valcke

unread,
Apr 26, 2012, 11:17:56 AM4/26/12
to sonata...@googlegroups.com
One step more .. when I add the following node in the SonataAdminBundle translation file it works .... I think that I have a $domain problem.... to be continued...

             <trans-unit id="Dashboard">
                <source>Dashboard</source>
                <target>Tableau de Bord</target>
            </trans-unit>

Cédric Valcke

unread,
Apr 26, 2012, 11:26:48 AM4/26/12
to sonata...@googlegroups.com
Ok .. I hadn't read the (..) manual on the translation domain .. I have created the right SonataAdminBundle.fr.xliff in my Bundle and it's work.
Reply all
Reply to author
Forward
0 new messages