Opened 7 months ago
Closed 7 months ago
#60825 closed defect (bug) (fixed)
Menu item label "Appearance > Patterns" not properly translated
Reported by: | jdy68 | Owned by: | audrasjb |
---|---|---|---|
Milestone: | 6.5 | Priority: | normal |
Severity: | normal | Version: | 6.5 |
Component: | Administration | Keywords: | has-patch fixed-major dev-reviewed |
Focuses: | Cc: |
Description
Bug Report
Description
The string "Patterns" under Appearance menu is not translated, but the translation exists.
Environment
- WordPress: 6.5-RC3-57856
- PHP: 8.1.15
- Server: Apache/2.4.54 (Win64) OpenSSL/1.1.1q mod_fcgid/2.3.10-dev
- Database: mysqli (Server: 8.0.30 / Client: mysqlnd 8.1.15)
- Browser: Chrome 122.0.0.0 (Windows 10/11)
- Theme: Twenty Fifteen 3.6
- MU-Plugins: Aucune activée
- Plugins:
- WordPress Beta Tester 3.5.5
Steps to Reproduce
1.Install WordPress 6.5-RC3
2.Install a classic theme like Twenty-Twenty
3.Select Français/French or Espanol or Deutsch in Settings > General > Site Language
🐞 Go to Appearance menu and see that "Patterns" is not translated.
Expected Results
- ✅ "Patterns" must be translated.
Actual Results
- ❌ "Patterns" is not translated even though the translation exists.
For example in fr_FR locale:
https://translate.wordpress.org/projects/wp/dev/fr/default/?filters%5Bstatus%5D=either&filters%5Boriginal_id%5D=10187524&filters%5Btranslation_id%5D=76090580
Attachments (1)
Change History (26)
#1
@
7 months ago
- Milestone changed from Awaiting Review to 6.5
- Priority changed from normal to high
I can reproduce the issue on my side. But after looking on the code at a glance, I can't see how it's happening.
Moving to 6.5 as it is a very annoying issue since the interface won't be consistent on a large amount of websites ("Patterns" is not used anywhere else in the interface on localized installations).
Ping @swissspidy: it would be nice to fix this before RC4.
#3
@
7 months ago
Introduced in https://core.trac.wordpress.org/changeset/57543
#4
in reply to:
↑ 2
@
7 months ago
Replying to audrasjb:
Ah probably we should just replace
__
function with_x
🙃
Or add a translators comment to __( 'Patterns' )
like /* Translators: Admin menu item. */
or similar.
#5
@
7 months ago
Hopefully replacing __
with _x
wouldn't cause any string change, but I'm not sure about this :)
Edit: no the string will probably be fuzzied.
Note: Even if there is a string change, I think it's worth fixing this issue.
This ticket was mentioned in PR #6307 on WordPress/wordpress-develop by @kebbet.
7 months ago
#6
- Keywords has-patch added; needs-patch removed
@swissspidy commented on PR #6307:
7 months ago
#7
We should just use _x( 'Patterns', 'site editor menu item' )
instead of __( 'Patterns', 'site editor menu item' )
No translator comment or anything
#8
@
7 months ago
Heya, yes let's use _x( 'Patterns', 'site editor menu item' )
here like it was intended.
It will cause a new translation string to appear but that will basically have the same translation as the others, so should be fine.
Alternatively, if we're worried about that, we simply remove the text domain for 6.5 and in 6.5.1 we use the proper context. Then there won't be a string change in 6.5
7 months ago
#9
Doing some research on swedish translations, I think no comment at all shuld be best, as _x
will genereate a new string
@swissspidy commented on PR #6307:
7 months ago
#10
That is correct. See the discussion on the ticket about that. We have a couple of options here.
#11
@
7 months ago
sv_SE has been translated fully for 6.5
.
Testing the options:
_x( 'Patterns', 'site editor menu item' )
displaysPatterns
in admin menu.__( 'Patterns' )
displaysMönster
in admin menu.
So going with __()
is my suggestion.
#12
follow-up:
↓ 14
@
7 months ago
But the code is already
( 'Patterns' )
and it doesn't work
#13
@
7 months ago
Yeah, using __( 'Patterns' )
would indeed fix the issue without introducing any string change.
@swissspidy another option would be:
- Use
__( 'Patterns' )
as a quick fix for RC4, so we don't get a fuzzy string - Replace it with
_x
in 6.5.1 so we get the translator comment back
Note: if we're already going to have other string changes in RC4, we can probably afford to introduce a fuzzy string, though.
#14
in reply to:
↑ 12
@
7 months ago
Replying to jdy68:
But the code is already
__( 'Patterns' )
and it doesn't work
The current code is __( 'Patterns', 'site editor menu item' )
.
It doesn't work because __()
is not supposed to have a translator comment as a second parameter. The second parameter of __()
is the text domain, see https://developer.wordpress.org/reference/functions/__/.
#15
@
7 months ago
another option would be:
Yes that's what I meant above.
Note: if we're already going to have other string changes in RC4, we can probably afford to introduce a fuzzy string, though.
I think so too. Looks like we're changing some strings on the about page.
@audrasjb commented on PR #6307:
7 months ago
#16
Using __( 'Patterns' )
looks like our best option there.
Approving this for commit
.
#17
@
7 months ago
- Summary changed from Translation of menu "Appearance > Patterns" not taken into account to Menu item label "Appearance > Patterns" not properly translated
#18
@
7 months ago
- Keywords commit added
- Owner set to audrasjb
- Status changed from new to accepted
I think we're good to go with the proposed PR.
#20
@
7 months ago
- Keywords fixed-major dev-feedback added; commit removed
- Resolution fixed deleted
- Status changed from closed to reopened
Reopening for backport consideration.
@swissspidy can you sign-off this for 6.5 please?
#21
@
7 months ago
- Keywords dev-reviewed added; dev-feedback removed
@audrasjb Are you handling the follow-up as well?
screenshot of Appearance menu with Patterns not translated