-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Using Gutenberg outside of WP #32790
Comments
Gutenberg is using this package to provide a text translation. And it's using tannin and gettext libraries in nodejs. Would you try this package and method? |
I'm trying to do the same; to use block-editor with custom blocks and a few gutenberg blocks from block-library package. I'm struggling to figure out how localization is working with exposed gutenberg blocks outside of WP scope, specifically:
|
@alanps I've managed to set locale data to be consumed by both core blocks, block inspector, and custom blocks. It ended up being very trivial, I just wasn't aware that localization can't be changed after blocks are mounted. setLocaleData({
'No block selected.': ['Select something'],
'Type / to choose a block': ['Type "/" to choose a block'],
'Block inspector': ['Block editor'],
}); This needs to be executed before components are mounted. Otherwise, once mounted, default localization, defined in the brackets, will be consumed, as locale data will be empty. Did you manage to find translation files for core blocks and components we could use to with setLocaleData? |
@alanps @ntucakovic if your problem is solved are we good to close this issue now? |
I'm going to go ahead and close this issue; feel free to open a new one if you have any further questions! |
I have the Gutenberg library that I got from Github and would like to know how to select Gutenberg language outside of Wordpress ? I saw that the translation files exist, I just didn't find a way to select them...
The text was updated successfully, but these errors were encountered: