Language override
-
Dear all,
sorry for this type of question but i have problem with translation woocommerce for some sentence in my language (Slovakia). Due to law in our country is needed to change text for one field. I used loco for translation fields what works perfect but my main problem is that after some time my translation is override somehow (i didn’t do any updaet update theme i don’t do anything just leave my whole web untouched) to original slovak translation, where my translated string are overriden. I already used your help page with translation:
// Code to be placed in functions.php of your theme or a custom plugin file.
add_filter( ‘load_textdomain_mofile’, ‘load_custom_plugin_translation_file’, 10, 2 );/*
* Replace ‘textdomain’ with your plugin’s textdomain. e.g. ‘woocommerce’.
* File to be named, for example, yourtranslationfile-en_GB.mo
* File to be placed, for example, wp-content/lanaguages/textdomain/yourtranslationfile-en_GB.mo
*/
function load_custom_plugin_translation_file( $mofile, $domain ) {
if ( ‘textdomain’ === $domain ) {
$mofile = WP_LANG_DIR . ‘/textdomain/yourtranslationfile-‘ . get_locale() . ‘.mo’;
}
return $mofile;
}but this unfortunatelly didn’t worked.
I tried to change permission of translated file to only read but was overrided again due to woocommerce was installed under server permission.
I really don’t know where problem could be and i really appreciate your helps or advice.
Many thanks
- The topic ‘Language override’ is closed to new replies.