Simple Multilanguage Switcher

Assuming you’re talking about the front-end and you have your strings properly internationalized, you just need to insert the load_theme_textdomain() function to tell wordpress where are your .po files. this is how the Toolbox Theme does it: /** * Make theme available for translation * Translations can be filed in the /languages/ directory * If … Read more

How to use language files in plugins?

Basically read the source for the function load_plugin_textdomain(): function load_plugin_textdomain( $domain, $abs_rel_path = false, $plugin_rel_path = false ) Ignore the second parameter, it was deprecated a long time ago. An example from my plugin T5 Taxonomy Location: protected function load_language() { load_plugin_textdomain( ‘plugin_t5_tax_location’, FALSE, plugin_basename( dirname( __FILE__ ) ) . ‘/languages’ ); } The first … Read more

Is it possible to temporarily override the language setting?

Add a locale filter add_filter(‘locale’, ‘locale_filter’); and in the filter return the locale of your choice, function locale_filter($locale) { return “whatever”; } however, this needs to be done in context, your mail sending trigger will need to know the target user and get the locale from there, not very easy, although doable.

‘Trick’ a plugin (WP-Members) to think the blog language has changed for a single page

Yes, sort of. Any localized plugin such as WP-Members runs off of the “locale” that WordPress is set to. This value can be filtered for WP as a whole using the locale filter. But it can also be filtered for plugins using plugin_locale See: https://developer.wordpress.org/reference/hooks/plugin_locale/ To use plugin_locale specific to the text domain for the … Read more

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

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!

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)