WordPress.org

Make WordPress Core

Opened 14 months ago

Closed 13 months ago

Last modified 13 months ago

#50845 closed defect (bug) (fixed)

Block patterns: Fix translatable strings (take 2)

Reported by: SergeyBiryukov Owned by: audrasjb
Milestone: 5.5.1 Priority: normal
Severity: normal Version:
Component: Editor Keywords: has-patch commit
Focuses: Cc:

Description

Background: #50842

Reported by @tobifjellner:

I got this screenshot from @nabilmoqbel
Seems to be more hardcoded stuff in sample content.

Not sure this can be addressed in time for 5.5, so setting the milestone to 5.5.1 for now.

Attachments (4)

Chapter-Buttons.jpg (172.8 KB) - added by SergeyBiryukov 14 months ago.
Read-now-button.jpg (103.2 KB) - added by nabilmoqbel 14 months ago.
Read now button
50845-1.patch (10.1 KB) - added by justinahinon 14 months ago.
Make string translatables in block patterns
50845.2.diff (10.3 KB) - added by audrasjb 14 months ago.
Editor: Transform block patterns hardcoded strings into translatable strings

Download all attachments as: .zip

Change History (14)

@nabilmoqbel
14 months ago

Read now button

#1 @justinahinon
14 months ago

Just look and yes, the strings are hardcoded. Working on a patch for the blocks in the screenshots and also looking at investigating others block patterns.

@justinahinon
14 months ago

Make string translatables in block patterns

#2 @SergeyBiryukov
14 months ago

#50904 was marked as a duplicate.

#3 @johnbillion
14 months ago

  • Keywords has-patch added

@audrasjb
14 months ago

Editor: Transform block patterns hardcoded strings into translatable strings

#4 @audrasjb
14 months ago

  • Keywords commit added
  • Owner set to audrasjb
  • Status changed from new to accepted

Thanks @justinahinon, the patch looks good to me but it wasn't generated against wordpress-develop, so it's pretty hard to apply to WP Core dev environment. I added a new patch based on what you did and I checked all the patterns: you identified all the patterns with issues regarding i18n, thanks.

Marking this for commit action.

#5 @SergeyBiryukov
14 months ago

This also needs to be fixed upstream in Gutenberg. See #50842 for example, which was a backport of https://github.com/WordPress/gutenberg/pull/24317 for https://github.com/WordPress/gutenberg/issues/24316.

#6 @justinahinon
14 months ago

Replying to SergeyBiryukov:

This also needs to be fixed upstream in Gutenberg.

Opened an issue https://github.com/WordPress/gutenberg/issues/24646.

Here's the PR: https://github.com/WordPress/gutenberg/pull/24647.

This ticket was mentioned in Slack in #core by david.baumwald. View the logs.


13 months ago

#8 @audrasjb
13 months ago

Hi,
Note: The PR has been merged, so this patch can be committed as well.

#9 @SergeyBiryukov
13 months ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 48859:

Editor: Make some hardcoded strings in block patterns translatable.

Follow-up to [48726].

Props justinahinon, audrasjb, nabilmoqbel, tobifjellner, yoavf, ramiy.
Fixes #50845.

#10 @SergeyBiryukov
13 months ago

In 48860:

Editor: Make some hardcoded strings in block patterns translatable.

Follow-up to [48726].

Props justinahinon, audrasjb, nabilmoqbel, tobifjellner, yoavf, ramiy.
Merges [48859] to the 5.5 branch.
Fixes #50845.

Note: See TracTickets for help on using tickets.