Hi there,
This is a fairly complex development topic. I’m going to leave it open for a bit to see if anyone is able to chime in to help you out.
I can also recommend the WooCommerce Developer Resources Portal for resources on developing for WooCommerce.
You can also visit the WooCommerce Facebook group or the #developers channel of the WooCommerce Community Slack. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.
Ok thanks for the links!
Just a recap there was a little error in my text, this is the code I tried:
<?php e_(‘Aggiungi’, ‘theme’); ?>
Hey @carlo12teca,
Is there a particular reason you’re adding this code to your site as the Add To Cart buttons within WooCommerce are fully translatable by default?
You can tramslate text within WordPress plugins and themes by using a free translation plugin like Loco Translate.
Hi @stuartduff , yes there is a reason because for now, I want to build a fake eCommerce.
Are you sure I’ll able to translate this button with Loco Translate(I want to buy Polylang Pro to translate all the site)?
Thanks for the comment:)
Carlo
Plugin Support
slash1andy
(@slash1andy)
Automattic Happiness Engineer
The string there is completely translate ready. You can translate it using any of the standard methods for translating text in a WordPress site.
Hi @slash1andy if I insert _e instead of __ now the term is translatable, but I have a bug because in the output code the word is separated from the button.
function nlwc_custom_button_text() {
return _e('Show more ', 'theme');
}
I have a screenshot about it, but I don’t find how I can post it.
-
This reply was modified 5 years, 8 months ago by
CarlVarsh.
Hi guys, I’m so happy because I find the solution
function nlwc_custom_button_text() {
return esc_html__('Show more ', 'theme');
}
Now is translatable!:)