3

I am curious to know if setting 'WPLANG' in wp-config.php just effects the admin language or does it have other consequences?

I run a blog in a foreign language but use English in my admin. I initially set the WPLANG to the foreign language a while ago and used a plugin (admin in English) to keep the English admin interface whilst using an .mo file to translate the theme.

I now use 'WPML' to manage the translations. I was wondering whether my WPLANG setting is still relevant and what it really means to the site?

Thanks

  • Check the messages you get when you post a comment. I believe they depend on the WPLANG setting, and don't always get provided by your theme. Sentences like "Your comment is awaiting moderation." – Jan Fabry Nov 14 '10 at 18:23
  • An additional consequence is that it sets the lang attribute on the HTML element of your pages, including admin pages; WPML overrides that on the front end but the admin side preserves the WPLANG setting. Amongst other things, it affects the language used by spelling checkers for form input fields. – webaware Dec 15 '13 at 7:06
3

WPLANG effects the whole site not just the admin section, you can use it in conjunction with WPML. It basically sets what language you have translations for but you must include a languages folder inside wp-include with the appropriate .mo and .po files.

You can also set WPML to use the default languages directory ( which is set up by defining the language(s) in wp-config as I said above).

  • Thanks for the answer. I found the problem with WPML is that it seems to assume the template you are using is in the same language as the default admin language. Have checked on their forum and seems to be a known issue that they may fix in the future. – chentudou Nov 16 '10 at 6:44
  • I'm using WPLANG to use custom theme translations (same theme on different servers) and it seems to work O.K. What doesn't work is when certain filter is fired, all the text received via email are in english. How would i force the use of WPLANG there for i18n strings ? – trainoasis Mar 20 '18 at 13:47
2

Please see the plugin WP Native Dashboard, this has solutions for use a custom language on backend of WordPress; very fine plugin.

  • your url does not exist anymore – edelwater Nov 15 '10 at 23:08
  • sorry, now the url works fine – bueltge Nov 15 '10 at 23:44
  • thanks, yes i'm able to change the backend language, was just curious of the WPLANG functions. – chentudou Nov 16 '10 at 6:46
0

'WPLANG' in wp-config.php will apply as default language for both theme and admin.

Admin in English will check if it is in admin first. Then use add_filter() to hook on the locale call and changed the returned $locale to code who ask for it.

It use similar concept of interrupt in DOS.

Based on the concept above, if it is not in admin, then $locale shouldn't be changed.

Different Languages in WordPress Theme and Admin provides a step by step and explain if you want to read more.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.