• Resolved jmviade

    (@jmviade)


    I’m developing a little widget in english and I added a translation to spanish.

    The translation works perfectly for all strings but it doesn’t work with the name of widget and the description of the widget that remain shown in english in the widget dashboard.

    the code is that I’m using for creating the widget is


    function __construct() {
    $title = __('English Name', 'plugin_lang');
    $descrip = __('English description.', 'plugin_lang' );
    parent::__construct( 'quotes', $title, array( 'description' => $description ) );
    ...etc...
    }

    and outside the class I load the plugin textdomain translation.

    When I load and activate the plugin in a WP spanish installation, all strings are translated correctly but the widgetname and the widget description remain in english.

    Any suggestion?

    Thanks.

Viewing 1 replies (of 1 total)
  • Thread Starter jmviade

    (@jmviade)

    I found the solution,

    I was loading the plugin_textdomain adding an action to ‘init’ actionhook and it’s necessary to load the languages using the ‘plugins_loaded’ actionhook.

    I hope to help someone else.

Viewing 1 replies (of 1 total)
  • The topic ‘Widget title translation issue’ is closed to new replies.