# How to set up WPLANG in wp-config.php for 4 languages?

Good day! I don't know much code so I've been researching on how to modify my wp-config.php file so that the content and widgets of my site will show in the four languages (aside from English) I have on there. I don't care about translating the WP interface, just the content. The WP .mo files in the languages in question are already in the wp-content/languages folder. How would I define 4 languages in wp-config.php? Like this?

define ('WPLANG', 'es_ES'); ('WPLANG', 'de_DE'); ('WPLANG', 'fr_FR'); ('WPLANG', 'ca_CA')

I've been trying things out (only way for me to learn) but ended up destroying the file and having to restore it. Besides, like I said, no reliable info on the net. Cheers :)

-
That won't work, there's no functionality in WordPress that allows you to edit a post in more than one language anyway. To do this find a multilingual plugin to install, like this one –  onetrickpony Jun 23 '11 at 2:09
as @One-Trick-Pony says, defining it like you want in the wp-config.php is impossible. I would like to suggest another multilingual plugin though: WPML (wpml.org) –  Piet Jun 23 '11 at 2:42

I just found this which I applied and works perfectly:

If you have your blogs installed in subdirectories you could use this solution:

if (strpos(\$_SERVER['REQUEST_URI'], '/enblog') === 0) {
define ('WPLANG', 'en_US');
} else {
define ('WPLANG', 'pl_PL');
}


... and so on. Good luck!

-

if you are somehow using .mo files to translate the content strings (and your theme is calling the necessary __() or _e() functions) then you could possibly get away with a much simpler option than wpml.

You could use the simple but effective plugin http://www.viper007bond.com/wordpress-plugins/other-plugins/in-their-language/

it detects language of browser if possible and then sets the wp locale accordingly.

-