id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc,branch,changelog,apichanges,internalchanges 7497,I18N/L10N support for plugins,"Pedro Algarvio, aka, s0undt3ch",Christian Boos,"I'm opening this ticket to get some opinions on how the localization of trac plugins should be done. There are several options: * Merge trac catalogs and plugin catalogs at runtime, but this might be a disadvantage because while merging catalogs, if 2 of them share the same msgid, the one being merged will override the existing one, ie, the trac one, allowing plugins to introduce translation errors which might make users create new ticket's for trac and not the plugin in question. * Make use of `msgctxt`. Each plugin will have it's name as it's context but this might be abusing a bit of the `msgctxt`. Defenition [http://www.gnu.org/software/autoconf/manual/gettext/Contexts.html here]. * Make use of domains. Each plugin will have it's own domain, and all localization calls must include the domain. Now, some more problems: * Babel's `msgctxt` support is close to `None` currently and it's meant for 1.0, only some minor work has been done. * Genshi's `msgctxt` support is non-existant mostly because Babel does not yet support it. * Regarding the domain option, while this is easy inside python files, it won't be that easy regarding templates; perhaps a `i18n:domain` attribute should be added to genshi allowing a template to define it's domain and thus, allowing genshi to pass the domain when translating the message. I'm tending towards the `domain` option, nothing will have to change regarding Babel and changes regarding genshi shouldn't be that much. Also, regarding plugin developers, this would just mean using another translation function other than `gettext` or `_` for example, and passing an extra arg; perhaps one could even do some code magic to ease this. A new extension point would probably also be created so that plugins can register their domain and respective catalogs into trac's translator. ",enhancement,closed,high,0.12,i18n,0.12dev,critical,fixed,i18n,trac-ja@…,,,,