-
Notifications
You must be signed in to change notification settings - Fork 0
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
Internationalize and localize the Post Edit block ( oik-sb/sb-post-edit-block
)
#5
Comments
The post edit block is currently produced as
There should be entries in the |
In the The
I then checked what the md5 value should be for build/index.js and found that
Then I re-read the issue bobbingwide/sb-breadcrumbs-block#1 Now I reckon that I can implement a filter function for
With the filter function changing relative to |
For the sb-post-edit-block plugin it wasn't necessary to implement the filter hook. But the code doesn't cater for the translatable fields in I'm going to see what happens with the latest version of
The plugin created by @wordpress/create-block is not internationalised. |
It seems that the i18n package on wp-cli v2.5.0 is not the latest.
|
Having installed the latest version of the wp-cli i18n command I was able to get the strings from For plugins where the
To
This will enable the routine to find the block.json files but ignore the source Javascript files. |
Summary
then you need to implement a filter hook for Each time you change a translatable string in the JavaScript source you need to rebuild the language files
If you just change a string in a PHP file or The npm commands are defined in
See bobbingwide/oik-i18n#6 for an explanation of these commands. |
Regarding I don't yet know how to ensure that these get translated. |
When building the The workaround was to
|
This didn't resolve the problem of the strings from Reinstating this attribute in the block.json file after it's been parsed by makepot could be used as a workaround. Or can I remove |
No. So why doesn't |
It looks like there's a runtime workaround using the
If the |
The link text attribute called The official documentation for Metadata indicates that |
The solution is to not use default values for attributes and set the default value when the attribute is not set or completely empty. |
Try translating in a filter run for Questions:
|
The Post Edit block is registered from
block.json
but the internationalization and localization doesn't work.This is a simpler version of the problem reported in bobbingwide/oik#177 (comment)
Requirement
__()
block.json
Proposed solution
wp_set_script_translations
. Find out what value for the$handle
parameter should be.The text was updated successfully, but these errors were encountered: