#694: Translations scaffolding
------------------------+----------------------
  Reporter:  olemis     |      Owner:  olemis
      Type:  task       |     Status:  assigned
  Priority:  minor      |  Milestone:
 Component:  trac core  |    Version:  0.7.0
Resolution:             |   Keywords:  i18n
------------------------+----------------------

Comment (by olemis):

 Replying to [comment:20 SaintGermain]:
 > Ok I finished the new patch (will upload this evening). The previous one
 had some errors in it anyway.
 >

 I'm taking a look into this ... What changeset did you check out to build
 the patch onto ?

 > I ended up using the plugin package name as translation domain.

 ok

 > However I could not create a bhdashboard.util.translation as there were
 already a util.py or utils.py file inside each plugin.
 > So I created a translation.py file, which means we'll use:
 > {{{from bhdashboard.translation import _}}}
 >

 I'll take a look into this and suggest something in a while .

 > One point which I am not quite satisfied. Content of translation.py is:
 > {{{#!py
 > from trac.util.translation import domain_functions
 >
 > _, ngettext, tag_, tagn_, gettext, N_, add_domain = \
 >     domain_functions('bhdashboard', ('_', 'ngettext, 'tag_', 'tagn_',
 'gettext', 'N_', 'add_domain'))
 > }}}
 >
 > I was wondering if we could find a find to get the package name inside
 this file instead of hard-coding the 'bhdashboard' ?

 I guess it's possible e.g. `__name__.split('.', 1)[0]` ? Maybe there's a
 cleaner hack using `pkg_resources` ?

-- 
Ticket URL: <https://issues.apache.org/bloodhound/ticket/694#comment:21>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker

Reply via email to