• Resolved David Perroud

    (@davidperroud)


    Dear,
    i have a website in EN and DE.
    I put this : Registration & Materiel Fee in the plugin.
    I need to have this translater in german for the website.

    I found this line in the plugin:
    __($extra_fee_option_label, ‘woocommerce’)

    but i don’t fing how to get the label translated on the website.
    Thank you very much for your help.

Viewing 1 replies (of 1 total)
  • Thread Starter David Perroud

    (@davidperroud)

    I don’t know if it’s the correct way to do it but i used this function in function.php and it works.

    add_filter('gettext', 'translate_reply');
    add_filter('ngettext', 'translate_reply');
    function translate_reply($translated) {
    	$lang = pll_get_post_language(get_the_ID());
    	if($lang == 'en'){
    		//$translated = 'Registration fee & material';
    	}
    	if($lang == 'de'){
    		$translated = str_ireplace('Registration fee & material', 'Anmeldung & Material', $translated);
    	}
    return $translated;
    }
Viewing 1 replies (of 1 total)
  • The topic ‘How to get label translated’ is closed to new replies.