2012-03-24, 10:29:44
mvlcek Wrote:Where have you added this code?
Looking at the plugin, it should be at the top of the function show_login_box(), welcome_message_login(), etc.
The order in which functionalities are executed:
- plugins are loaded, language is not known, thus putting the code at the top of the plugin file won't work
- on the index-pretemplate hook I18N determines the best language,
- thus it is known at the beginning of the template
- plugin functions like show_login_box are called, the language is known here, too
Hope this helps.
Yeah this helped a lot actually. I have it working now. This plugin has some login logic in the function user_login_check(), and the language preference is not visible there. I have extended the code in this function to give user feedback upon invalid usernames etc so I was using the i18n_r() function there, but this was giving me problems. I just set code names for certain events in user_login_check(), and evaluated them in show_login_box().
Thanks so much for the help!