Hi,
I need to translate some labels that still appear in English here and there on my pages. Some time ago you suggested me the following snippet but some of the strings are still not translated, maybe I am using the wrong domain names (wpv-.... or wp-.... ?) as I don't know all correct domain names. I tried some variations, but still not working. Pls let me have all correct Toolset domain names so that I can apply the right ones in the future, thanks.
add_filter( 'gettext', function( $translated_text, $text, $domain ) {
if($text == 'Search for a post' && $domain == 'wp-cred'){
$translated_text = "Cerca un post";
}
if($text == 'Please enter %NUM% or more characters' && $domain == 'wpv-views'){
$translated_text = "Digita almeno %NUM% caratteri";
}
if($text == 'Hour' && $domain == 'wpv-cred'){
$translated_text = "Ora";
}
if($text == 'Use my location' && $domain == 'wp-maps'){
$translated_text = "Usa la mia posizione";
}
if($text == 'Show/Hide coordinates' && $domain == 'wp-maps'){
$translated_text = "Mostra/Nascondi coordinate";
}
if($text == 'Get new password' && $domain == 'wpv-views'){
$translated_text = "Imposta una nuova password";
}
if($text == 'Username or Email' && $domain == 'wpv-views'){
$translated_text = "IDUtente oppure Email";
}
return $translated_text;
}, 20, 3 );
Hello. Thank you for contacting the Toolset support.
Can you please share information what text is not get translated and on what page and share admin access details and let me review what plugins are added and from where those texts are coming from.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
hidden link
Add New in Immagini field (add images)
==>
Changed the text using the gettext hook.
BTW - on this same page I have two taxonomy selects (TIpo strumento and Marca) where select_text="----SELECT---" doesn't work, why it works for fields and not for selects ?
==>
I've added the following custom JS code to your form's JS editor to add the default option:
Hi,
whatever I do now on the site gives me the following error
Parse error: syntax error, unexpected '&&' (T_BOOLEAN_AND) in /home/musicain/public_html/wp-content/themes/kadence/functions.php on line 80
There has been a critical error on this website. Please check your site admin email inbox for instructions.
Hello Minesh,
Today I found other two strings which are not translated, belonging to the relationship select:
Searching...
No results found
I tried to fix the translation myself opening my functions.php but I couldn't find your snippet in it and it isn't in toolset/settings either. Where is it ?
BTW - Could I use Loco Translate instead to translate any Toolset strings ?
thanks
Regards
Nicola
Additionally, May I kindly ask you to open a new ticket with every new question you may have. This will help other users searching on the forum as well as help us to write correct problem resolution summery. Thank you for understanding.
I've added the following gettext hook and fix all those strings which you raised.
The code is added to your theme's functions.php file at bottom of the functions.php file:
=> /public_html/wp-content/themes/kadence/functions.php
/* Translating Text using gettext hook */
add_filter( 'gettext', function( $translated_text, $text, $domain ) {
if($text == 'Search for a post' && $domain == 'wp-cred'){
$translated_text = "Seleziona una band";
}
if($text == 'No bands can be associated to' && $domain == 'wp-cred'){
$translated_text = "Nessuna band da associare a";
}
if($text == 'Enter address' && ($domain == 'toolset-maps')){
$translated_text = "Inserisci l'indirizzo";
}
if($text == 'Add new' && ($domain == 'wp-cred' or $domain = 'wpv-views')){
$translated_text = "Aggiungi";
}
if($text == 'Please enter %NUM% or more characters' && $domain == 'wpv-views'){
$translated_text = "Digita almeno %NUM% caratteri";
}
if($text == 'Hour' && $domain == 'wpv-views'){
$translated_text = "Ora";
}
if($text == 'Minute' && $domain == 'wpv-views'){
$translated_text = "Minuti";
}
//echo "<br/>".$text."===".$translated_text."===".$domain;
if($text == 'Searching...' && ($domain == 'wp-cred' or $domain == 'wpv-views' or $domain == 'toolset-maps')){
$translated_text = "Ricerca in corso ...";
}
if($text == 'No results found' && ($domain == 'wp-cred' or $domain == 'wpv-views' or $domain == 'toolset-maps')){
$translated_text = "Nessun risultato";
}
if($text == 'Use my location' && ($domain == 'wp-cred' or $domain == 'wpv-views' or $domain == 'toolset-maps')){
$translated_text = "Usa la mia posizione";
}
if($text == 'Show/Hide coordinates' && $domain == 'toolset-maps'){
$translated_text = "Mostra/Nascondi coordinate";
}
if($translated_text == 'Get New Password' and ($domain == 'wp-cred' or $domain == 'wpv-views' or $domain == 'toolset-maps')){
$translated_text = "Imposta una nuova password";
}
if($text == 'Username or Email' && $domain == 'wpv-views'){
$translated_text = "IDUtente oppure Email";
}
return $translated_text;
}, 10, 3 );
I kindly ask you to open a new ticket with every new question you may have. This will help other users searching on the forum as well as help us to write correct problem resolution summery. Thank you for understanding.
You can mark this ticket resolved with different message as "This ticket is resolved again"