[wp-hackers] Improvements to the WordPress l10n framework
Nikolay Bachiyski
nbachiyski at developer.bg
Sun May 13 19:54:57 GMT 2007
2007/5/13, Omry Yadan <omry at yadan.net>:
> >
> > Using a stack we can only reassure we are not in the wrong plugin.
> > However we cannot intercept the switch between a plugin and the core.
> > Here is an example:
> > wp-content/plugins/our.php:
> > function f() {
> > ....
> > $x = comments_number();
> > ....
> > }
> >
> > In the comments_number function there are some i18n-ed strings and we
> > expect their translations to be taken from the default domain. However
> > the current context will point us to our plugin and the translation
> > will be searched for in its domain, not in the default.
> >
> > In most of the cases we can solve this problem by searching not only
> > in the plugin namespace, but on failure -- also in the default one. Of
> > course, this will work only if we are sure that one string has the
> > same translation everywhere.
>
>
> Well, I can claim this is a feature that allow plugins to override core
> translations in while their context. :)
I still don't think it is the Right Thing To Do (tm), however it could
prove sufficient for our needs.
You could start a ticket and put the code there, so that we don't
forget about it :-)
Happy hacking,
Nikolay.
More information about the wp-hackers
mailing list