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

Discussion/i18n: Localising blocks in FSE themes #36061

Open
tomjn opened this issue Oct 28, 2021 · 3 comments
Open

Discussion/i18n: Localising blocks in FSE themes #36061

tomjn opened this issue Oct 28, 2021 · 3 comments
Labels
[Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") Internationalization (i18n) Issues or PRs related to internationalization efforts [Type] Discussion For issues that are high-level and not yet ready to implement.

Comments

@tomjn
Copy link
Contributor

tomjn commented Oct 28, 2021

Currently for twentytwentytwo a workaround is being considered involving the core/pattern block in #33217 combined with use of __() when registering the pattern. While this achieves the goal it's a short term workaround.

For the longterm solution, I've created this issue to discuss.

@tomjn
Copy link
Contributor Author

tomjn commented Oct 28, 2021

I've a suggestion!

Localised attributes:

    title: {
        type: 'string',
        localisable: true,
    },

with a textdomain attribute. WP can then run through each attribute, extract its value, and translate via the textdomain and pass the localised versions via filters, or swap the original value in the rendered string.

The textdomain would appear under the advanced panel alongside classes, with the intention that it wouldn't be used in post content, but somebody building templates in the site editor could make use of it.

The localisable flag would ensure that WP doesn't try to localise JSON, non-text values, or strings that shouldn't be localised such as a first name attribute or an address.

@jffng
Copy link
Contributor

jffng commented Oct 29, 2021

Thanks @tomjn , just linking a couple related issues:

#27402
#21204

@iandunn
Copy link
Member

iandunn commented Dec 29, 2021

#21932 also seems related

@annezazu annezazu added [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") and removed [Feature] Full Site Editing labels Jul 24, 2023
@jordesign jordesign added the [Type] Discussion For issues that are high-level and not yet ready to implement. label Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") Internationalization (i18n) Issues or PRs related to internationalization efforts [Type] Discussion For issues that are high-level and not yet ready to implement.
Projects
None yet
Development

No branches or pull requests

6 participants