reduxframework / redux-framework

Redux is a simple, truly extensible options framework for WordPress themes and plugins!
http://redux.io
Other
1.74k stars 583 forks source link

Translation problem via a plugin #2621

Closed nicolas92 closed 9 years ago

nicolas92 commented 9 years ago

Hello, I have created a plugin where I joined redux, but I can not translate the panel, all translations work except the panel, here is my code:

add_action( 'plugins_loaded', 'uw_core' );
function uw_core() {
    load_plugin_textdomain( 'kho', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
}

Can you help me, thank you very much :)

kprovance commented 9 years ago

This has been asked and answered multiple times. https://github.com/reduxframework/redux-framework/search?q=plugin+translation+&type=Issues&utf8=%E2%9C%93

nicolas92 commented 9 years ago

Hello, I looked at various topics and the problem is not resolved, I can not translate options panel that I created. I saw a solution to a theme but not for a plugin.

mandricmihai commented 9 years ago

What does this "panel" means?

Redux::setSection( $opt_name, array(
        'title'  => __( 'Settings for comments', $domain ),
        'id'     => 'comments',
        'desc'   => __( 'Here you can customize the settings only for comments.For posts and pages go to Settings for Posts and Pages.', $domain ),
        ));

You mean the title?Settings for comments you can't translate that? By the way use this code

load_plugin_textdomain( 'kho', FALSE, basename(plugin_dir_path( __FILE__ )). '/languages' );
nicolas92 commented 9 years ago

Hello @AlexAlexandru, yes, that's what I'd like to translate, with the code you gave me the translation is still not working.

mandricmihai commented 9 years ago

Strange for me it's working.I also use redux framework with a plugin.Is your plugin open source or on github to take a look at it?Hook it to wp_loaded instead of plugins_loaded

nicolas92 commented 9 years ago

Hi, there is a free version of the plugin: https://wordpress.org/plugins/ultimate-widgets-light/

mandricmihai commented 9 years ago

Does the translation work for anything else?

nicolas92 commented 9 years ago

Translation works for all except the panel.

mandricmihai commented 9 years ago

For me is everything is in english

nicolas92 commented 9 years ago

Yes but if you want to translate the plugin, for example in French, the translation of sentences of the panel does not.

mandricmihai commented 9 years ago

if ( function_exists( 'uwl_supports' ) && uwl_supports( 'primary', 'admin' ) ) {
    // Include the Redux options Framework
    if ( !class_exists( 'ReduxFramework' ) ) {
        require_once( UWL_PLUGIN_DIR .'/assets/admin/redux-core/framework.php' );
    }
    // Register all the main options
    require_once( UWL_PLUGIN_DIR .'/assets/admin/admin-config.php' );
    // Dashboard widget
    if ( !class_exists( 'KhoThemesDashboardWidgetUW' ) ) {
        require_once( UWL_PLUGIN_DIR .'/assets/admin/dashboard.php' );
    }
}

move this inside plugins_loaded hook

nicolas92 commented 9 years ago

What's the problem?

mandricmihai commented 9 years ago

Refresh F5

nicolas92 commented 9 years ago

Ah ok, I'll try :)

nicolas92 commented 9 years ago

it works :) Thank you very much, I would never have found it, thank you :)

mandricmihai commented 9 years ago

You welcome.

akshuvo commented 6 years ago

@mma Thanks a lot