Skip to content

Instantly share code, notes, and snippets.

@MrThiemann
Last active August 24, 2020 05:01
Show Gist options
  • Save MrThiemann/02072cba206dbc5f3a4369efc917c7e1 to your computer and use it in GitHub Desktop.
Save MrThiemann/02072cba206dbc5f3a4369efc917c7e1 to your computer and use it in GitHub Desktop.
woo-translation
<?php
add_filter( 'woocommerce_product_add_to_cart_text', function( $text ) {
if ( 'Read more' == $text ) {
$text = __( 'More Info', 'woocommerce' );
}
return $text;
} );
<?php
// Übersetzungen und Texte anpassen
add_filter('gettext', 'translate_text');
add_filter('ngettext', 'translate_text');
function translate_text($translated) {
$translated = str_ireplace('view details', 'Weiterlesen', $translated);
$translated = str_ireplace('Add to Card', 'in den Warenkorb', $translated);
return $translated;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment