Myltilanguage site support solution
-
Hello there, I struggled for some hours and I found an issue about the translations loading into the plugin. The issue that I was facing was that whenever the website loaded, this plugin uses the default language of the website and not changing (I am using qtranslate-x plugin to support multilanguage wordpress site).
The problem was found into the part of the translation loading, it was running at the wp load time, while the qtranslate was not yet finalized with the current locale locading.
The resolution of that was to wrap the functionality of the translation loading and added to a wp hook in order to load that in the correct order, like below:// file: calendar.php @line:31
function custom_calendar_load_text_domain(){
$plugin_dir = plugin_basename(dirname(__FILE__));
load_plugin_textdomain(‘calendar’, false, $plugin_dir . ‘/languages’);
}
add_action( ‘plugins_loaded’, ‘custom_calendar_load_text_domain’ );Hope to be helpful.
- The topic ‘Myltilanguage site support solution’ is closed to new replies.