Support » Fixing WordPress » User language settings changing wordpress options and menus but not plugins

  • Hi,
    When I switch the wordpress site language to my native language (Thai) it changes everything on the site as expected including plugins (I have the MO and PO file translations already uploaded). But when I change an individual user to English (US) it changes all the wordpress default options and menus but most of the plugins remain in Thai.

    Even If I do it the other way around its the same issue: English default and switch individual user to Thai and plugins remain in English. What is possibly going on here? Does the default wordpress site language setting for particular users only apply to wordpress settings and menus? OR have I placed the MO and PO files of the plugins in the wrong directory maybe (wpcontent>languages>plugins). This seems right because it works for global site language.

    I assume that if I purchase a plugin like WPML I may be able to manage all of this, but our site content would remain in thai and it is only the dashboard and plugin settings that need to be in english for ONE particular user that manages the site and cant read thai. So, I dont really need the plugin if the user settings should function the way I assume, unless it doesnt function this way (plugins changing language also I mean).

    I tried the plugin “english wordpress admin” and that does almost all of them, but one or 2 plugins dont switch for that partifular user.

    I read somewhere that it may be a missing “get_locale()” script in some of my plugins? If this is the case, could anyone point me in the right direction please?

    I would really appreciate someones insight on this.. Thank you!! 🙂

    • This topic was modified 1 year, 1 month ago by nimas.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator bcworkz

    (@bcworkz)

    How is switching languages for individual users managed? WP does not do this at all by default. Do you use a plugin or custom code or what? It sounds like switching is being done too late to affect plugins.

    Thread Starter nimas

    (@nimas-1)

    Hi @bcworkz
    I was under the impression that since 4.7, the individual user could select their own site language. Of course, I realize that this is referring to admin language (so, backend) but I also assumed this included plugins..too many assumptions? There isn’t much documentation I can find online so a bit confused.

    https://wptavern.com/wordpress-4-7-to-introduce-user-specific-language-setting-for-the-admin

    I tried English-WP-admin plugin (by placing plugin php file into mu-plugin folder to force this operation first) which does the job but not for the front end. When I tried JSM’s User Locale Selector for the WordPress Toolbar plugin (which has the switcher in the admin front end toolbar also) it has exactly the same issue with WPs individual user site language – core functions switched language but not plugins.

    Any suggestions of a workaround to either get jsm plugin working or a plugin suggestion? I’m Not a coder by any means, but don’t mind trying custom code either..any documentation on the subject that you know of to start looking at?

    Appreciate any help here 🙂 thanks!

    Thread Starter nimas

    (@nimas-1)

    Sorry, this includes themes also. Which for this site, happens to be divi.
    All the PO files have been fully translated and the mo files are in their correct file in the root.

    Moderator bcworkz

    (@bcworkz)

    I’m sorry, you’re right. Logged in users can select among any of the installed languages for the admin interface. I had a different situation in mind. The admin language switcher works as expected on my site. My theme and plugin are all from the WP repositories where translations are managed by the WP Polyglots team. If you’re having trouble with translations by plugin authors, that might explain things if the .mo files are not where they belong. The plugin .mo files for Polyglot translations of course belong in /wp-content/languages/plugins/. For author created .mo files, they belong in the specific plugin’s folder, for example /wp-content/plugins/my-awesome-plugin/lang/.

    Additionally, author created translations need to have their text domains loaded with load_plugin_textdomain() when “plugins_loaded” action fires. This is not required for Polyglot translations.

    Since you have trouble with all plugins and your theme, I really doubt all of them are doing it wrong. This sounds more like a systemic problem, maybe your theme or a plugin is managing the locale setting in correctly. As a test, try deactivating all plugins and switching to a default twenty* theme. The admin interface should appear in the language selected for the user, assuming all the needed language packs are in place and the text domain is loaded when required by a specific plugin.

    If the admin language appears as expected then, your problem is certainly due to an add-on module. Restore your usual theme and plugins, one by one, testing after each until you identify the problem module.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘User language settings changing wordpress options and menus but not plugins’ is closed to new replies.