[wp-hackers] Improvements to the WordPress l10n framework

Omry Yadan omry at yadan.net
Sat May 12 20:47:30 GMT 2007


Nikolay Bachiyski wrote:

> Hello guys,
>
> I was thinking for a long time of this problem and was on the verge of
> raising the issue in front of you all, but somebody got here first :-)
>
> If we are to summarize our goal: the plugin developers should not have
> to write their gettext domain name in every __/_e call.
>
> 2007/5/12, Omry Yadan <omry at yadan.net>:
>> the idea is the code that initializes the plugins initialize a global
>> called $plugin_id before calling the plugin init code.
>> when the plugin adds an action, it will pass that global to the
>> add_action function, that will use it to re-obtain context when calling
>> the actions.
>
> We cannot do this. What happens if the plugin function calls a core
> function and then it calls other plugin function? It is possible that
> either core strings are being searched for in the plugin domain or,
> worse, one plugin\s string is being looked for in other plugin's
> domain.

Good point.
it can be solved (I think) by using a stack.
instead of setting and unsetting the current plugin_id, push it and pop
it from a global stack.



More information about the wp-hackers mailing list