Advertisement
designbymerovingi

temp

May 6th, 2015
318
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.65 KB | None | 0 0
  1. /**
  2.  * Translate WooCommerce Label
  3.  * @version 1.0
  4.  */
  5. add_filter( 'mycred_parse_tags_general', 'mycred_pro_woo_translations' );
  6. function mycred_pro_woo_translations( $string ) {
  7.  
  8.     if ( $string == 'woocommerce_mycred_total_label' ) {
  9.  
  10.         // Get the translation in use
  11.         $locale = get_locale();
  12.  
  13.         // If Italian, replace TOTALLABEL with something in Italian
  14.         if ( $locale == 'it_IT' )
  15.             $string = str_replace( 'woocommerce_mycred_total_label', 'Totale Ordine in %plural%', $string );
  16.  
  17.         // Else some other language
  18.         else
  19.             $string = str_replace( 'woocommerce_mycred_total_label', 'Order Total in %plural%', $string );
  20.  
  21.     }
  22.  
  23.     return $string;
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement