i need some translation string for custom plugin
-
hi, I make a little plugin but I need some translation string. Someone can help me (maybe most are already present in WP).
// String translation (you can edit). $clw_hello = "Ciao"; // Hello $clw_welcome = "Benvenuto Visitatore"; // Welcome Guest $clw_profile = "Vai al Profilo"; // View Profile $clw_login = "Accedi"; // Login $clw_logout = "Esci"; // Logout $clw_register = "Registrati"; // Register $clw_passwlost = "Password Persa?"; // Password Lostthanks in advance
-
Take a look at the documentation here which describes how to store translatable texts in plugins and themes: https://developer.ww.wp.xz.cn/plugins/internationalization/how-to-internationalize-your-plugin/
yep, but I mean if this string maybe are already included so, I can simply use __(‘Login’) and similar (I think exist for login, logout, Register and password lost. Cannot found for Welcome and Hello.
If you use one of the translation functions without your own text domain, WordPress uses its own text domain from the WordPress core. Any text that is not present in it will therefore not be translated. You would have to make it translatable with your own text domain or use a different text for this.
yep, I know, but if are already present I don’t need to make a translation. Maybe is there any url to check translation string in default WP core? I can check and verify. Ty.
You can view and search the translations of the Core in Italian here: https://translate.ww.wp.xz.cn/projects/wp/dev/it/default/
The texts can also be found in the .po file in your WordPress installation under wp-content/languages/.
Ok, found some valid string eg:
msgctxt "block title" msgid "Login/out" msgstr "Accedi/Esci"now I need to understand how insert in plugin (tried with ” . __(‘Login/out’) . ” But remain untranslated).
Curiously “Log in” and “Log out” will be translated, but not “Login/out”. They all occur in the same .po file. I don’t really understand gettext translations, but one difference is “Login/out” occurs in a .json file and the other two that do work occur in .php files. I suspect “Login/out” would translate in React but the other two would not. I suppose you could do:
echo __("Log in"),'/',__("Log out");πthanks for reply. I’ll try π
so good, found all useful string and make my little login plugin.
if someone want see:
https://salvatorenoschese.it/wordpress-custom-login-widget-shortcode-gutenberg/
best regards π
The topic ‘i need some translation string for custom plugin’ is closed to new replies.