getherbert / herbert

The WordPress Plugin Framework:
http://getherbert.com/
634 stars 95 forks source link

I18n problem in panels.php #179

Closed angelocala94 closed 7 years ago

angelocala94 commented 7 years ago

Hi, I have a problem with i18n in panels.php. If I use for example, this __('Dashboard','my-text-domain') on other parts of my plugin, it works and return the translated string. If I use the same function (__('Dashboard','my-text-domain')) in panels.php, then it return only the default language.

Why this is happening? I'm loading my text domains with the plugins_loaded hook.

ghost commented 7 years ago

I haven't tried to use i18 with GetHerbert yet but I would take a look at the panel class to see how it's being instantiated using a hook: https://github.com/getherbert/framework/blob/dev/Herbert/Framework/Panel.php

wordpress-core-load-lifecycle

angelocala94 commented 7 years ago

Solved by calling load_plugin_textdomain in plugin.php