Support » Plugin: amr users » Language change of meta field First Role

  • Resolved johnths2


    I have a little problem with the plugin “amr users”.

    I have translated the plugin into Dutch and it works almost fine, but there is a little bug.

    When i rebuild the cache of my users list, the fields “First Role” are in Dutch language, but after i logged off and i logged on again to my WordPress site the language in the “First Role” fields is in English and i have to rebuild the cache again to have it in Dutch.

    Do you now what good be the problem ?

    Greetings John Visbeen
    The Netherlands

Viewing 7 replies - 1 through 7 (of 7 total)
  • After rebuilding cache the fields are in Dutch
    First Role

    After logout en login to the website, the field are in English
    First Role

    Plugin Author anmari



    Shew – finally figured it out. WordPress does not load the admin text domain in the frontend.

    Plugin applies wordpress function translate_user_role to the role names. But since wp has not loaded the translation strings, when one does a refresh in front end, the roles are not translated. If it gets it from data cached in the backend, then it is translated!

    Quick Fix: add code some where – theme functions.php or custom site specific plugin? until I figure where best to add this. It is only needed when roles are being shown on frontend, so I have to decide whether to just load for everyone all the time, or put some conditional code in.

    add_action( 'init', 'load_admin_textdomain_in_front' )
    function load_admin_textdomain_in_front() {
        if ( ! is_admin() ) {
            load_textdomain( 'default', WP_LANG_DIR . '/admin-' . get_locale() . '.mo' );

    Thanks for flagging this!

    It’s not working for me.
    I have put the code on different places in my themes functions.php and when i start wordpress the page will not load.

    Plugin Author anmari


    version 4.4 with fix – working for me – just uploaded

    It works finaly.

    I put it direct after the theme setup in the function.php

    And i put “;” after
    add_action( ‘init’, ‘load_admin_textdomain_in_front’ ) ;

    It was not in the presented code.


    • This reply was modified 1 year, 2 months ago by  johnths2.


    Great version 4.4 with fix – working for me also!

    Thanks for the very fast response!!

    Problem solved!

    Greetings, John

    Plugin Author anmari


    Dang ! lost a semi-colon when pasting… thanks for picking up.

    My daughter has just started info systems as part of a commerce degree – she says to me ‘SQL is so hard – you have to have everything exactly right else it doesn’t work”

    Too right – unlike your mother who can intuit what you might mean!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Language change of meta field First Role’ is closed to new replies.