#694: Translations scaffolding
------------------------+----------------------
Reporter: olemis | Owner: olemis
Type: task | Status: assigned
Priority: minor | Milestone:
Component: trac core | Version: 0.7.0
Resolution: | Keywords: i18n
------------------------+----------------------
Changes (by olemis):
* status: needinfo => assigned
Comment:
Replying to [comment:14 SaintGermain]:
> Ok to summarize:
>
> 1) add the code snippet mentionned above everywhere (already done in the
proposed patch) or create a wrapper
> => For just one line of code, it may be better to keep it as it is
without wrapper
>
JFTR , when I refer to ''wrapper'' I'm considering that the functions
returned by `domain_functions` actually wrap `TranslationsProxy`'s methods
to scope translations lookup to a given domain . The intention is not to
create explicit wrappers on our own
;)
[...]
> 3) Duplicate translation with Trac
> => I don't understand exactly what I have to do.
> a) In Bloodhound directory I can see 5 plugins directories and one Trac
directory. I suppose that the Trac directory is directly checked out from
Trac, so the translation strings there are already in the official Trac
.po files and we just have to copy-paste them from Trac.
yes, they will be the same
> b) For the plugins directories, I will mark each string to be translated
and the string will be gathered in a domain specific .po file
ok
> c) So if some strings are both in the plugins directories and in the
Trac directory, they will appear twice (in the plugin .po file and in the
Trac .po file) and we will have to translate them twice.
>
> For 3), is there another way to proceed ?
No , that's not the idea . If a string appears twice in Trac core and in a
plugin then use
{{{#!py
from trac.util.translation import translations
...
string = translations.dtgettext('<trac_domain>', 'string')
}}}
... or alike instead of `_('string')` (<= I am omitting the previous
import statement and the call to `domain_functions` etc ...) . By using
the former syntax the last string will not be extracted from plugin code,
will not be added to plugin catalog , but still should be retrieved from
Trac translations catalog
--
Ticket URL: <https://issues.apache.org/bloodhound/ticket/694#comment:16>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker