On Wed, 5 Feb 2014 10:56:36 +0100, 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 : > >> > >>> On Sat, Feb 1, 2014 at 9:52 PM, Saint Germain <[email protected]> > >>> wrote: > >>> > > [...] > >>> > >>> > I would like to introduce this patch for the next version as it > >>> > is quite interesting and (hopefully) doesn't introduce any > >>> > regression. > >>> > > >>> > >>> afaict , I'd be inclined to suggest committing as well well *if* > >>> dashboard widget headers are correctly localized . All other > >>> aspects are not critical and may be deferred until forthcoming > >>> release . > >>> > >>> > >> > >> 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 ! > > 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'], > (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_) > > 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) > 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 > > I confirmed 2) by replacing the widget titles by entire strings found > in Trac messages.po and they are indeed translated ! > 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 > > So it seems that we have a translation domain problem and Bloodhound > (or Trac) pick the incorrect .po/.mo file. > > Does someone has some knowledge on how this translation domain work ? > Nevermind : it was a setup problem (something with my browser caching the .po file it seems). So it works now. I'll update all the widget headers and update the patch ! Cheers,
