#58696 closed defect (bug) (fixed)
Installation pages do not have JS translations
Reported by: | sabernhardt | Owned by: | swissspidy |
---|---|---|---|
Milestone: | 6.5 | Priority: | normal |
Severity: | normal | Version: | 5.5 |
Component: | I18N | Keywords: | has-patch has-unit-tests |
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 (32)
@
15 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
@
15 months ago
both the password toggle button and password strength meter show French text on the Profile page in WordPress 6.3
#1
@
15 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
@
15 months ago
- Component changed from Upgrade/Install to I18N
It can fit both, but yes it's probably better in i18n.
#4
@
14 months 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.
13 months ago
#7
@
13 months 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
@
13 months 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.
13 months 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
This ticket was mentioned in Slack in #core-i18n by swissspidy. View the logs.
13 months ago
#12
@
12 months ago
It looks like this PR needs review before we can move this ticket forward (cc @SergeyBiryukov, @ocean90, @costdev)
12 months ago
#13
@swissspidy Thanks for working on this! This appears to work for the password strength indicator but not for the Show/Hide button on interaction.
https://github.com/WordPress/wordpress-develop/assets/79332690/64373f93-a136-4d36-8280-f65d024ba985
#14
@
12 months ago
- Keywords needs-refresh added; needs-testing removed
- Milestone changed from 6.4 to 6.5
@swissspidy commented on PR #5121:
12 months ago
#15
@costdev Weird, I cannot reproduce this. Did you perhaps navigate forward/backward in the browser or reload the install page when you recorded this, instead of starting install from scratch? The $_REQUEST
could have been emptied.
Works fine for me:
https://github.com/WordPress/wordpress-develop/assets/841956/be78233f-a666-4aff-969b-a84b7481c1be
12 months ago
#17
@swissspidy Hmm, I'm not sure now. Might be worth getting another tester to check it in case it's maybe something going on locally for me.
@swissspidy commented on PR #5121:
11 months ago
#18
@SergeyBiryukov @ocean90 Would appreciate your review on this one so we can fix it in 6.5 🙏
#19
@
11 months ago
https://github.com/WordPress/wordpress-develop/pull/5121 is testing well for me; I've approved the PR.
This ticket was mentioned in Slack in #core-i18n by swissspidy. View the logs.
10 months ago
#23
@
9 months ago
- Owner set to swissspidy
- Resolution set to fixed
- Status changed from new to closed
In 57286:
@swissspidy commented on PR #5121:
9 months ago
#24
Committed in https://core.trac.wordpress.org/changeset/57286
installation page in WordPress 6.3 beta 2, choosing French: the password toggle button and password strength meter show English text