WordPress.org

Ready to get started?Download WordPress

Forums

User Role Editor
[resolved] non-translatable roles/capabilities (3 posts)

  1. thomask
    Member
    Posted 1 year ago #

    I got a problem with this plugin, that it shows only english names for roles and capabilites, even when wordpress got them translated, so on every other place, where the name of role appears, it is translated.

    It is a big problem for me, as i am using custom names for roles and it does not work, your plugin show default english names and it is complete mess.

    e.g. try to use something like

    add_filter( 'init', 'change_role_names');
    function change_role_names() {
        global $wp_roles;
    
        if ( ! isset( $wp_roles ) )
            $wp_roles = new WP_Roles();
    
        $wp_roles->roles['subscriber']['name'] = 'test';
        $wp_roles->role_names['subscriber'] = 'test';
    }

    Your plugin should use name 'test' instead of subscriber, as at all other places in WP

    http://wordpress.org/extend/plugins/user-role-editor/

  2. Vladimir Garagulya
    Member
    Plugin Author

    Posted 1 year ago #

    Thank you for pointing me on the subject. Please try version 3.8.1, where I removed WordPress cache refresh before roles reading.

  3. Vladimir Garagulya
    Member
    Plugin Author

    Posted 1 year ago #

    As about role name translation. Before 3.8.1 URE used its own translation files only. With 3.8.1 Roles names translation was updated: if URE translation file doesn't exist for blog default language, URE uses WordPress internal translation now. So if the problem was just translation you should not use technique of role name change showed above.
    Be aware it has a side effect: If you modify such role (with name changed on the fly) with URE help, such role's new name will be written to the database and become permanent after you updated it.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic