Translating AJAX error messages
This topic contains 15 replies, has 4 voices, and was last updated by ismiaini 5 years, 1 month ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support TicketTagged: Ajax, Japanese, Translation
-
AuthorPosts
-
September 14, 2019 at 4:55 am #5191
I am translating the front to Japanese.
Everything is hunky-dory except the Ajax error messages.
How do I translate the Ajax Error messages?
and make sure the translation stays even when you upgrade.September 14, 2019 at 4:51 pm #5194Hi
the developer has been alerted and he will reply to your question asap.
Make sure to submit the translation to the WP repository and if approved, we’ll give you 12 months free membership to use all the add-ons.
Thanks
September 16, 2019 at 1:28 am #5196Another issue in the same context.
On the login screen, the error messages are not translated inspite of the fact they are translated on the po file.FYI: I use loco for translation
September 16, 2019 at 5:56 am #5199Hi,
Thanks for noticing the issue. Can you please mention a few of the strings you are not able to translate so that we can review and fix?
Regards,
PatrikSeptember 16, 2019 at 8:50 am #5204The one which I translated and noticed not working is:
“Error: Invalid username or Password.”
It is in the file class-forms.php on line 365.September 16, 2019 at 9:03 am #5205This reply has been marked as private.September 16, 2019 at 9:19 am #5206This is the translation as it apears in the po file:
#: includes/class-forms.php:365 includes/class-forms.php:469
msgid “Error: Invalid username or Password.”
msgstr “エラー</ strong>:ユーザー名またはパスワードが無効です。”This is where the text appears in your class-forms.php the first line in this clip is line # 364
if (is_wp_error($res)) {
$error = ‘<div class=”uwp-alert-error text-center”>’.__(‘Error: Invalid username or Password.’, ‘userswp’).'</div>’;
$uwp_notices[] = array(‘register’ => $error);
} else {
$reg_redirect_page_id = uwp_get_option(‘register_redirect_to’, ”);
$redirect_to = uwp_get_redirect_url($reg_redirect_page_id, $data);
$redirect = apply_filters(‘uwp_register_redirect’, $redirect_to);
do_action(‘uwp_after_process_register’, $data);
wp_redirect($redirect);
exit();
}September 16, 2019 at 9:43 am #5207Please note:
on the previous detailed message, some of the HTML tags are being interpreted instead of being displayed as text on the message.
Here I define the code clips properly:the po file:
#: includes/class-forms.php:365 includes/class-forms.php:469 msgid "<strong>Error</strong>: Invalid username or Password." msgstr "<strong>エラー</ strong>:ユーザー名またはパスワードが無効です。"
This is where the text appears in your class-forms.php the first line in this clip is line # 364
if (is_wp_error($res)) { $error = '<div class="uwp-alert-error text-center">'.__('<strong>Error</strong>: Invalid username or Password.', 'userswp').'</div>'; $uwp_notices[] = array('register' => $error); } else {
September 16, 2019 at 11:28 am #5211It should work as HTML tags are allowed in translation strings in WordPress. Maybe there is a space in closing tag causing issues otherwise it should work fine.
msgstr “エラー</ strong>:ユーザー名またはパスワードが無効です。”
We will be separating the HTML tags from the translation in the next release of UsersWP. For now, you can just make changes in the core file if required.
Regards,
PatrikSeptember 16, 2019 at 11:34 am #5212I noticed the space and deleted it.
It did not help.Ok I will wait for the next release.
The error messages are not that big deal.
I will submit the current completed translation to WordPress you will be able to check it.September 26, 2019 at 2:10 pm #5327Dear Paolo
I have created the Japanese translation on the Github page of the usersWP plugin. You can find a new Japanese po file
https://github.com/UsersWP/userswp/compare/master…wienerr:patch-1I have no permission to upload hence I cant upload the compiled mo file.
Please look into it and let me know if I need to to add something.
Best regards
Raphael WienerSeptember 26, 2019 at 3:17 pm #5331Hi,
thanks for that, but uploading it on github is not really as helpful for us.
We can’t verify translations (unless we speak the language), that’s why we ask to upload it on WordPress.org, because on wp.org they will be validated by a mother tongue.
Thanks
September 26, 2019 at 3:21 pm #5332Hi Paolo
Can you give me a URL so that I can upload it?September 26, 2019 at 4:50 pm #5335There you go: https://translate.wordpress.org/projects/wp-plugins/userswp/
Thanks
September 28, 2019 at 11:20 am #5361Hi Paolo
This is to inform you that the translation is waiting ready for approval.
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket