• I’ll try to be more precise than in my first question:

    What I’ve done: Developed a custom plugin, let’s say my-plugin, for which I’ve created its translations, for example in french, via the usual approach using a my-plugin-fr_FR.mo file. Via this plugin, I’ve also coded a custom admin page Y, let’s say one with this content:

    
    <p><?php _e( 'Welcome', 'my-plugin' ); ?></p>
    <button><?php _e( 'Request', 'my-plugin' ); ?></p>
    

    The request button is used to trigger a request to the server, which should answer like this when requested:

    <?php _e( 'Hello there dear client!', 'my-plugin' ); ?>

    I won’t specify the details of the request; it’s standard wp ajax.

    Now, while in the wp admin, I change the current admin user’s language via users -> edit -> language to french. Then I go back to the custom admin page Y, and I find the “Welcome” and “Request” words properly translated in french. But, when I click on “Request” to trigger the above-mentioned request, I get ‘Hello there dear client!’ as an answer, instead of its french translation. When I disable polylang, I correctly get its french version as the server’s response, so this has to do with polylang. I’m using the free Polylang V. 3.1 (most recent), and the WP version 5.8. This never happened before, so I guess it must be related to the most recent udpate(s). The above-described applies to all of my server-client requests of my backend; I have to get rid of this problem ASAP..

    Also, please note that Polylang is the only plugin of my website, in addition to my two additional custom plugins (I’m a professional developer).

    • This topic was modified 3 years, 7 months ago by joeyojoeyo12.
  • The topic ‘Admin User Language Switch + Polylang Problem’ is closed to new replies.