How to translate
-
In your Docs (https://docs.woocommerce.com/document/measurement-price-calculator/#section-29) you are explaining how to translate labels without wpml. I also found out by now, that I have to add this code for example via the pluign “code snippets”. My question:
I specifically want to translate the Output/Label “Product Price” (see here: https://galand.inseo.work/produkt/royal-grass-test/?v=fa868488740a) to “Gesamtpreis” as the website is in German. What do I have to do?
I altered the code from your docs to the following, but it doesn’t work:
——————————————-
function sv_mpc_measurement_label( $label ) {
if ( ‘de_DE’ === get_locale() ) {
$label = str_replace( ‘Required Width’, ‘Ben?tigte Breite’, $label );
$label = str_replace( ‘Width’, ‘Breite’, $label );
$label = str_replace( ‘Product Price’, ‘Gesamtpreis’, $label );
}return $label;
}
add_filter( ‘wc_measurement_price_calculator_label’, ‘sv_mpc_measurement_label’ );
add_filter( ‘wc_measurement_price_calculator_unit_label’, ‘sv_mpc_measurement_label’ );———————————————–
The page I need help with: [log in to see the link]
- The topic ‘How to translate’ is closed to new replies.