Need a little help with WP

Deividas696

Power Member
Joined
Dec 6, 2017
Messages
629
Reaction score
234
Hi bros,

Maybe anyone could help me, I'm creating my website and I faced a little problem.

I'm trying translate this "checkout" word to my native language, but I can not find how to do it.

I changed everything what was in checkout_cart.php with notepad++

Other words I changed with Loco Translate plugin, but I can not find where can I translate whis "checkout" word.
 

Attachments

  • ch.png
    ch.png
    128.4 KB · Views: 5
/* Add to the functions.php file of your theme */
add_filter( 'woocommerce_order_button_text', 'woo_custom_order_button_text' );

function woo_custom_order_button_text() {
return __( 'Your New Button Text', 'woocommerce' );
}



Or

//The filters.. both are required.
add_filter('gettext', 'change_checkout_btn');
add_filter('ngettext', 'change_checkout_btn');

//function
function change_checkout_btn($checkout_btn){
$checkout_btn= str_ireplace('Checkout', 'Your New Button Text', $checkout_btn);
return $checkout_btn;
}



Or

use this plugin https://wordpress.org/plugins/say-what/
 
What theme do you have? Check for files like en_GB.po, en_GB.mo in dir

wp-content/language/ ,
themes/your-theme/language/,
plugins/woocommerce/i18n/languages/

open with POEdit (opensource) and translate string -> compile file and load it back.
 
Back
Top