• Resolved dgoethals

    (@dgoethals)


    Hi,

    I’m using a French version of WP (latest version + latest version of UM).

    When I edit a post, the options to restrict user access are displayed at the bottom of the screen. See https://imgur.com/a/QB2vlMf
    Is there a way to have the native WP roles displayed in French?

    Thanks for your help

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @dgoethals

    Please try this code snippet below:

    add_filter("um_admin_access_settings_fields","um_120721_translate_roles");
    function um_120721_translate_roles( $args ){
    
        foreach( $args as $k => $d ){
            if( "_um_access_roles" === $d['id'] ){
                $arr_roles = $d['options'];
                foreach( $arr_roles as $kk => $rr ){
                    $args[ $k ]['options'][$kk] = __( $rr );
                }
            }
        }
    
        return $args;
    }

    The above code will add __() to translate the roles. You can add the code to your theme/child-theme’s functions.php file or use the Code Snippet plugin to run the code.

    Regards,

    Thread Starter dgoethals

    (@dgoethals)

    Hi @champsupertramp

    On a test site, here is the look before activating the snippet: https://imgur.com/a/lWt5YO6

    After activating the snippet with the plugin, only Author is translated: https://imgur.com/a/2hpdRM4

    Regards

    @dgoethals

    Install the “WPFront User Role Editor” plugin, where you can rename all Roles except Administrator and after saving the new Role Names you can deactivate the plugin.

    https://wordpress.org/plugins/wpfront-user-role-editor/

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hey there!

    This thread has been inactive for a while so we’re going to go ahead and mark it Resolved.

    Please feel free to re-open this thread by changing the Topic Status to ‘Not Resolved’ if any other questions come up and we’d be happy to help. 🙂

    Regards,

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Translation of WP roles when restricting access at the bottom of a post’ is closed to new replies.