Change specific translated strings
Quote from Asgaros on July 22, 2017, 3:32 pmThe following code contains some examples on how to change specific translated strings to a custom one without creating/changing a complete translation file. The modified strings will not affect similar strings generated by other plugins.
As usual you have to add this code to your themes functions.php file.
add_filter('ngettext', 'change_ntranslations', 20, 5); add_filter('gettext', 'change_translations', 20, 3); function change_translations($translated_text, $untranslated_text, $domain) { if ($domain === 'asgaros-forum') { switch ($translated_text) { case 'Forum': $translated_text = 'My Board'; break; case '%s Topics': $translated_text = '%s Threads'; break; case '%s Topic': $translated_text = '%s Thread'; break; case 'Last post': $translated_text = ''; break; } } return $translated_text; } function change_ntranslations($translated_text, $single, $plural, $number, $domain) { if ($domain === 'asgaros-forum') { $translated_text = change_translations($translated_text, '', 'asgaros-forum'); } return $translated_text; }
The following code contains some examples on how to change specific translated strings to a custom one without creating/changing a complete translation file. The modified strings will not affect similar strings generated by other plugins.
As usual you have to add this code to your themes functions.php file.
add_filter('ngettext', 'change_ntranslations', 20, 5); add_filter('gettext', 'change_translations', 20, 3); function change_translations($translated_text, $untranslated_text, $domain) { if ($domain === 'asgaros-forum') { switch ($translated_text) { case 'Forum': $translated_text = 'My Board'; break; case '%s Topics': $translated_text = '%s Threads'; break; case '%s Topic': $translated_text = '%s Thread'; break; case 'Last post': $translated_text = ''; break; } } return $translated_text; } function change_ntranslations($translated_text, $single, $plural, $number, $domain) { if ($domain === 'asgaros-forum') { $translated_text = change_translations($translated_text, '', 'asgaros-forum'); } return $translated_text; }
Quote from Deleted user on September 11, 2021, 2:38 amHello Asgaros,
I´m just exploring the plugin´s characteristics before installation. Is there a way to apply these translations to a specific forum among others? Maybe using its shortcode to assign the translation specifically to it?
Julia
Hello Asgaros,
I´m just exploring the plugin´s characteristics before installation. Is there a way to apply these translations to a specific forum among others? Maybe using its shortcode to assign the translation specifically to it?
Julia
Quote from bradpitt on March 16, 2022, 9:29 amQuote from Deleted user on September 11, 2021, 2:38 amHello Asgaros,
I´m just exploring the plugin´s characteristics before installation. Is there a way to apply these translations to a specific forum among others? Maybe using its shortcode to assign the translation specifically to it?
Julia
It offers a translation management system and translation feature that helps you to create your desired language option on your website.
Quote from Deleted user on September 11, 2021, 2:38 amHello Asgaros,
I´m just exploring the plugin´s characteristics before installation. Is there a way to apply these translations to a specific forum among others? Maybe using its shortcode to assign the translation specifically to it?
Julia
It offers a translation management system and translation feature that helps you to create your desired language option on your website.
Quote from katenelson092 on December 27, 2022, 8:57 amQuote from Deleted user on September 11, 2021, 2:38 amHello Asgaros,
I´m just exploring the plugin´s characteristics before installation. Is there a way to apply these translations to a specific forum among others? Maybe using its shortcode to assign the translation specifically to it?
Julia
Before I install the plugin, I’m merely going through its features and looking at their documentation. Is there a method to apply these translations to a particular topic in addition to the ones that are available? Perhaps you could assign the translation particularly to it by utilizing the shortcode for it.
backrooms is a fun escape room game.
Quote from Deleted user on September 11, 2021, 2:38 amHello Asgaros,
I´m just exploring the plugin´s characteristics before installation. Is there a way to apply these translations to a specific forum among others? Maybe using its shortcode to assign the translation specifically to it?
Julia
Before I install the plugin, I’m merely going through its features and looking at their documentation. Is there a method to apply these translations to a particular topic in addition to the ones that are available? Perhaps you could assign the translation particularly to it by utilizing the shortcode for it.
backrooms is a fun escape room game.
Quote from daitarn3 on July 21, 2023, 1:54 pmCitazione da Asgaros il luglio 22, 2017, 3:32 pmIl codice seguente contiene alcuni esempi su come modificare stringhe tradotte specifiche in una personalizzata senza creare/modificare un file di traduzione completo. Le stringhe modificate non influiranno su stringhe simili generate da altri plugin.
Come al solito devi aggiungere questo codice al tuo file di funzioni tematiche.php.
add_filter('ngettext', 'change_ntranslations', 20, 5); add_filter('gettext', 'change_translations', 20, 3); function change_translations($translated_text, $untranslated_text, $domain) { if ($domain === 'asgaros-forum') { switch ($translated_text) { case 'Forum': $translated_text = 'My Board'; break; case '%s Topics': $translated_text = '%s Threads'; break; case '%s Topic': $translated_text = '%s Thread'; break; case 'Last post': $translated_text = ''; break; } } return $translated_text; } function change_ntranslations($translated_text, $single, $plural, $number, $domain) { if ($domain === 'asgaros-forum') { $translated_text = change_translations($translated_text, '', 'asgaros-forum'); } return $translated_text; }
good morning,
the Forum is already translated into Italian but I would like to change some words (unfortunately loco translate doesn’t change them for me).
1 – How can I find the value in php of the words to change?
I attach screenshots of the words I need.
Thanks
Citazione da Asgaros il luglio 22, 2017, 3:32 pmIl codice seguente contiene alcuni esempi su come modificare stringhe tradotte specifiche in una personalizzata senza creare/modificare un file di traduzione completo. Le stringhe modificate non influiranno su stringhe simili generate da altri plugin.
Come al solito devi aggiungere questo codice al tuo file di funzioni tematiche.php.
add_filter('ngettext', 'change_ntranslations', 20, 5); add_filter('gettext', 'change_translations', 20, 3); function change_translations($translated_text, $untranslated_text, $domain) { if ($domain === 'asgaros-forum') { switch ($translated_text) { case 'Forum': $translated_text = 'My Board'; break; case '%s Topics': $translated_text = '%s Threads'; break; case '%s Topic': $translated_text = '%s Thread'; break; case 'Last post': $translated_text = ''; break; } } return $translated_text; } function change_ntranslations($translated_text, $single, $plural, $number, $domain) { if ($domain === 'asgaros-forum') { $translated_text = change_translations($translated_text, '', 'asgaros-forum'); } return $translated_text; }
good morning,
the Forum is already translated into Italian but I would like to change some words (unfortunately loco translate doesn’t change them for me).
1 – How can I find the value in php of the words to change?
I attach screenshots of the words I need.
Thanks
Uploaded files: