= Details = Applies to:: Moin 1.9, 1.8. Purpose:: Allow plugin translation with po files (no additional source code required in the plugin). Description:: This patch makes Moin load po files for domains other than !MoinMoin. This makes plugin translation ''as easy as placing a po file in `MoinMoin/i18n`, with no additional source code required in the plugin side''. This also means that plugins can change current Moin translation to what they think to be better. <
><
>This patch also fixes a problem where you cannot instantiate a `Translation` object for your own domain without overriding the cache of !MoinMoin domain, thus breaking translation. The solution adopted was attaching the domain name to the cache entry, so that you don't need to workaround it with dummy language names (e.g. `Translation('es_custom', 'SomeDomain')`). = Patch = {{attachment:MoinMoin.i18n.patch}} = Discussion = * Nice patch, but: * domains are to keep stuff separate, but you're mixing it all together in the end * usually plugins should not place stuff into MoinMoin/i18n/ (plugins are per wiki, but MoinMoin/i18n is global, access rights, ...)<
><
> * RenatoSilva - What exactly means keep stuff separate? For this patch, it means to ''attach additional translations without changing default po file'', or in other words, ''allow multiple po files for the same language''. You may want to change/expand the definition and tell that domains are not being fully implemented, but remember that currently they are not implemented ''at all''. <
>Also, I don't think mixing all domains together in `translations` object breaks the domain idea, according to the above interpretation. If you want plugins using their own translation dictionary, then they can just continue doing what they currently do. That is, this change is an ''addition'' and doesn't break current code used by plugins to load their own pos. It just adds a new feature (easy plugin translation) which will be available for those who want to use it, and which can be ''safely ignored''. The only issue would be if any current plugin is placing its po files in the root of `i18n` using the domain scheme for naming, then that file would be loaded globally. However I wonder if any existing plugin does this or if loading them would be a relevant issue. <
>Note: different directories, rather than domains, would be enough for implementing the idea (actually the pos would be better organized in that case), but I used domains for convenience and coherence with default (but unimplemented) scheme. <
>About your second point, how about the plugins dir? For example: {{{ plugins/macro/ChildPages.py plugins/macro/ChildPages.de.po plugins/macro/ChildPages.es.po plugins/macro/ChildPages.pt-br.po }}} = Plan = * Priority: * Assigned to: * Status: /* Contributed by RenatoSilva */ ---- CategoryMoinMoinPatch