Opened 3 months ago
Last modified 5 days ago
#58696 new defect (bug)
Installation pages do not have JS translations
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 6.4 | Priority: | normal |
Severity: | normal | Version: | 5.5 |
Component: | I18N | Keywords: | has-patch needs-testing |
Focuses: | javascript | Cc: |
Description
The password toggle buttons on install.php
and setup-config.php
have translated visible text and aria-label
when the page loads, but then the visible text becomes "Show" or "Hide" when I click on the button (the aria-label
becomes "Show password" or "Hide password"). The setup-config.php
toggle was just added in [56008], but the install.php
page apparently has had trouble with those buttons and/or the password strength meter for several releases.
Attachments (6)
Change History (17)
@
3 months ago
in WordPress 5.5, the installation page password visibility toggle button showed English text with interaction, but password strength meter had French translation
@
3 months ago
both the password toggle button and password strength meter show French text on the Profile page in WordPress 6.3
#1
@
3 months ago
The password toggle buttons and strength meters work for me on the Login, New User, User Profile and Writing Settings pages. Those use wp_enqueue_script()
; Install and Setup Config pages use wp_print_scripts()
.
script from Install page in WordPress 5.4.2:
/* <![CDATA[ */ var userProfileL10n = {"warn":"Votre nouveau mot de passe n\u2019a pas \u00e9t\u00e9 enregistr\u00e9.","warnWeak":"Confirmer l\u2019utilisation du mot de passe faible","show":"Afficher","hide":"Cacher","cancel":"Annuler","ariaShow":"Afficher le mot de passe","ariaHide":"Cacher le mot de passe"}; /* ]]> */ </script> <script type='text/javascript' src='http://localhost/wp54/wp-admin/js/user-profile.js?ver=5.4.2'></script>
script from Install page in WordPress 5.5:
<script type='text/javascript' id='user-profile-js-translations'> ( function( domain, translations ) { var localeData = translations.locale_data[ domain ] || translations.locale_data.messages; localeData[""].domain = domain; wp.i18n.setLocaleData( localeData, domain ); } )( "default", { "locale_data": { "messages": { "": {} } } } ); </script> <script type='text/javascript' src='http://localhost/wp55/wp-admin/js/user-profile.js?ver=5.5' id='user-profile-js'></script>
[52937] removed the empty translations script later
#3
@
3 months ago
- Component changed from Upgrade/Install to I18N
It can fit both, but yes it's probably better in i18n.
#4
@
8 weeks ago
I have taken screenshots from @sabernhardt video's since this kept bugging out on VLC and my computer... As a polyglot, I find this kind of things quite important to fix.
Currently, the issue is only showing when you are installing WP and not on other labels.
I also tested this with my locale nl_BE and had the exact same behavior. So, it doesn't look like a problem with the translations themselves.
Since, they are in the pack...
And as in the example:
The labels for the password strength: https://translate.wordpress.org/projects/wp/dev/nl-be/default/?filters%5Bterm%5D=password+strength&filters%5Bterm_scope%5D=scope_context&filters%5Bstatus%5D=current&filters%5Buser_login%5D=&filter=Apply+Filters&sort%5Bby%5D=translation_date_modified&sort%5Bhow%5D=desc
Also, is it me or is the label not in bold during the install and in the UI it is in bold...?
This ticket was mentioned in Slack in #core-performance by joemcgill. View the logs.
5 weeks ago
#7
@
5 weeks ago
- Milestone changed from Awaiting Review to 6.4
This is currently blocking #57157, per this comment. Moving into the 6.4 milestone for visibility.
#8
@
5 weeks ago
The main culprit for this bug is that all the blocks are registered on init
, even when WP is not installed yet.
Because blocks register scripts, that causes WP_Scripts
to be initialized very early, triggering script localization of the password meter.
Because of the way wp-admin/install.php
loads translations, it's actually too early, and when the script localization happens it still thinks the locale is en_US.
Not registering any blocks would automatically solve this issue.
An alternative solution is to adjust determine_locale()
to detect the current locale on the install screen. That's what my PR does.
This ticket was mentioned in PR #5121 on WordPress/wordpress-develop by @swissspidy.
5 weeks ago
#10
Works around issues with script localization happening too early because of blocks being registered.
Trac ticket: https://core.trac.wordpress.org/ticket/58696
installation page in WordPress 6.3 beta 2, choosing French: the password toggle button and password strength meter show English text