tommcfarlin/WordPress-Widget-Boilerplate

Localization incomplete

Closed this issue · 1 comments

Hi.
I've found the wp widget boilerplate on wptuts and I've made the "social networks" example.

As I'm not an english developer, I decided to test the localization part. All is working fine except for the widget description in the widgets menu. The description is still in english.

This seems to be because you start creating the widget before loading the correct localization file. I suggest you to put the load_plugin_textdomain function right after the init_plugin_constants function.
By doing this, the PLUGIN_LOCALE variable is instanciate and so the translation can be effective for the $widget_opts array. I've tested it and the widget description in the widgets menu appears in the correct language.

I let you try this and if I'm right, maybe update the plugin.php file.

Nice catch - updated! Also updated the way in which constants are defined and called. I also updated the example 'My Social Networks' widget.