Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad or any translation #1508

Open
khahina opened this issue Jan 27, 2025 · 5 comments
Open

Bad or any translation #1508

khahina opened this issue Jan 27, 2025 · 5 comments
Assignees

Comments

@khahina
Copy link

khahina commented Jan 27, 2025

On registration page

1/ for Name label after First name is correctly translate in french (Prénom) but Last Name , send only ‘Last’ as string and last is translate ‘Dernier’ instead ‘the good string ‘Last Name’ / ‘Nom’ in French.

Get_text on it works but not clean way. If you can send ‘Last name’ string instead only ‘Last’.

2/ The button value ‘Register’ is not translate (the translation is in po/mo php files, but did’nt work on value)

Get_text did’nt work neither .

only this work, but not clean way :

add_action(‘wp_footer’, function () { if (is_page(xxxxx)) { // Facultatif : replace xxxxx by page id ?> <script> document.addEventListener(‘DOMContentLoaded’, function () { const submitButton = document.querySelector(‘input#wp-submit[name=”wp-submit”][value=”Register”]’); if (submitButton) { submitButton.value = “S’inscrire”; } }); </script> <?php } });

Please resolve this button problem.


I already submit the problem in WordPress forum (here https://wordpress.org/support/topic/bad-or-any-translation/#post-18268565) and receive this from plugin support [aiful Islam]
==>

Hi [@khahina]

Thank you for reaching out and for providing detailed information about the issues you’re facing.

The issue arises because the plugin is likely using the string Last instead of Last Name for translation, which leads to incorrect translation in French. To resolve this:

Solution: This needs to be fixed at the plugin code level by ensuring that the string Last Name is used instead of Last for the translation function (__() or _e()). This ensures compatibility with translation files.
I recommend raising this as a feature request or bug report with the plugin’s development team so that they can implement this fix in a future update.

The issue with the “Register” button value could be because the button text is hardcoded and not wrapped in a translation function, or there might be a conflict preventing the translation from working.

Solution: Ideally, the plugin should use a proper translation function (e.g., __('Register', 'wp-user-frontend')) for the button text. I recommend reporting this issue to the GitHub repository so they can resolve it in a future update.
This ensures the button text is replaced across your site, wherever it is used. I recommend reporting both issues to the GitHub repository for a permanent fix in future releases.

Hope you understand.

Best regards,

===========
So we are agree it's a bug, a misfit from devlopment ... And this can be easily correct
Thank You
Have a nice day

@sapayth sapayth self-assigned this Jan 28, 2025
@anik-fahmid
Copy link

We are looking into this. Thank you for bringing it to our attention.

@sapayth
Copy link
Member

sapayth commented Jan 29, 2025

Hello @khahina,
Sorry for the trouble you are facing.

  1. After checking the registration form, the Last Name label is translatable. Please note that if you're referring to the input field for Last Name, you can enter any language you prefer, as it is a user-input field.
    Image

  2. The button value Register is also a user-input field. So you can enter any language you prefer.
    Image

Please let us know if you have any questions or need further assistance.

@khahina
Copy link
Author

khahina commented Jan 29, 2025

hye, I'm in free version, so i haven't this settings page.

Image
Default form, With First and Last instead First name, Last name

@sapayth
Copy link
Member

sapayth commented Jan 29, 2025

In that case, you can manually set the text to show any translated value you want.
Image

Are you using any third party plugin to translate? Here is an example of using Loco Translate.
Image

@khahina
Copy link
Author

khahina commented Jan 29, 2025

If you read my first post, i do something like that , but it's not clean . Why use 'Last' and 'first' instead good english (and well translate in your plugin ) 'First name' & 'Last name'.
And Register is translate in po/mo files but not use translation function in code (or not work )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants