Translating AJAX error messages

This topic contains 15 replies, has 4 voices, and was last updated by  ismiaini 3 weeks ago.

  • Author
    Posts
  • #5191

    Raphael Wiener
    Buyer
    Post count: 14

    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.

    #5194

    Paolo
    Site Admin
    Post count: 31142

    Hi

    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

    #5196

    Raphael Wiener
    Buyer
    Post count: 14

    Another 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

    #5199

    patrik
    Moderator
    Post count: 1385

    Hi,

    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,
    Patrik

    #5204

    Raphael Wiener
    Buyer
    Post count: 14

    The 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.

    #5205

    patrik
    Moderator
    Post count: 1385
    This reply has been marked as private.
    #5206

    Raphael Wiener
    Buyer
    Post count: 14

    This 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();
    }

    #5207

    Raphael Wiener
    Buyer
    Post count: 14

    Please 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 {
    
    #5211

    patrik
    Moderator
    Post count: 1385

    It 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,
    Patrik

    #5212

    Raphael Wiener
    Buyer
    Post count: 14

    I 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.

    #5327

    Raphael Wiener
    Buyer
    Post count: 14

    Dear 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-1

    I 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 Wiener

    #5331

    Paolo
    Site Admin
    Post count: 31142

    Hi,

    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

    #5332

    Raphael Wiener
    Buyer
    Post count: 14

    Hi Paolo
    Can you give me a URL so that I can upload it?

    #5335

    Paolo
    Site Admin
    Post count: 31142
    #5361

    Raphael Wiener
    Buyer
    Post count: 14

    Hi Paolo

    This is to inform you that the translation is waiting ready for approval.

Viewing 15 posts - 1 through 15 (of 16 total)

You must be logged in to reply to this topic.