On Wed, Feb 5, 2014 at 4:56 AM, Saint Germain <[email protected]> wrote:

> On 4 February 2014 04:56, Olemis Lang <[email protected]> wrote:
> > On 2/3/14, Saint Germain <[email protected]> wrote:
> >> On Mon, 3 Feb 2014 15:26:16 -0500, Olemis Lang <[email protected]>
> >> wrote :
> >>
>
[...]

> >>
> >> Do you mean the widget headers "My Tickets" and "Active Tickets" which
> >> you have begun to work on part2 ?
> >
> > Those are for product /dashboard view only ...
> >
> >> I haven't seen other missing headers as far as I can see.
> >>
> >
> > ... but we'd also have to check for global /dashboard , and resource
> > (product , milestone, ...) dashboards as well .
> >
>
> Hello !
>
>
Hi !
:)


> I think I found the problem.
>
> In file bloodhound_dashboard/bhdashboard/web_ui.py and in the method
> expand_widget_data from DashboardModule, the widget title must be
> marked to be translated:
> return dict([k, {'title': _(data['title']),
> instead of:
> return dict([k, {'title': data['title'],
>

I'm not sure about what you did but in advance I do not think this is
accurate . Part of the goal of widgets is to implement them in components
distributed with other packages . The function _ in this case will be bound
to domain=bhdashboard so I'm not sure of whether this will be accurate for
widgets implemented outside dashboard plugin e.g. in plugins .


> (and of course the strings to be translated like "Active Tickets" must
> be marked to be extracted but not yet to be translated with the
> function N_)
>
>
ok


> However there is 2 problems:
> 1) Some titles are already translated when they arrive at this point
> (don't know if a double translation can cause a problem)
>

hmmm ... msg IDs are in English so , afaict , there's still a chance for
this to happen if translated text is a valid English expression also
included in the catalog ... but this is quite bizarre so most of the time
should not be a problem

2) Translation strings are picked up in the wront .po/.mo files:
> trac/trac/locale/fr/LC_MESSAGES/messages.po
> instead of:
> bloodhound_dashboard/bhdashboard/locale/fr/LC_MESSAGES/bhdashboard.po
>

really ? I see no modifications in /trac so I guess you are you talking
about run-time selection of translation ?

{{{#!sh

$ hg qapplied
t694/t694_r1534486_bloodhound_i18n.diff
t694/t694_r1554007_french.diff
t694/t694_r1551811_spanish.diff

$ hg dif -r qparent -r qtip trac/
}}}


> I confirmed 2) by replacing the widget titles by entire strings found
> in Trac messages.po and they are indeed translated !
>

oh !


> On the contrary, and strings which can be found in bhdashboard.po is
> not translated.
> I also tried to simply:
> print _("Active Tickets")
> And it only works with strings which are in Trac messages.po
>

/me pulling to take a look ... but got

{{{#!sh

$ hg pull --mq saintgermain
pulling from https://[email protected]/saintgermain/bloodhound-mq
searching for changes
no changes found
}}}


>
> So it seems that we have a translation domain problem and Bloodhound
> (or Trac) pick the incorrect .po/.mo file.
>

This might be related to a strange behavior I've noticed before [1]_


>
> Does someone has some knowledge on how this translation domain work ?
>
>
should forward to trac-dev , maybe better by following previous thread [1]_

.. [1] https://groups.google.com/forum/#!topic/trac-dev/akzQkqePwy8

-- 
Regards,

Olemis - @olemislc

Reply via email to