-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Translate Verbum Block Editor Package #90462
Conversation
Jetpack Cloud live (direct link)
Automattic for Agencies live (direct link)
|
This PR does not affect the size of JS and CSS bundles shipped to the user's browser. Generated by performance advisor bot at iscalypsofastyet.com. |
…/wp-calypso into translate/verbum-block-editor
@@ -23,15 +23,17 @@ | |||
"bugs": "https://github.com/Automattic/wp-calypso/issues", | |||
"types": "dist/types", | |||
"scripts": { | |||
"clean": "rm -rf dist", | |||
"build": "NODE_ENV=production yarn dev", | |||
"clean": "", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we would need to revert this right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not now at least. If we keep this, yarn dev
will delete the dist
folder and the translations with it, and your sandbox won't have them. Once we deploy, we can put this back since yarn dev --sync
won't delete files on remote if they don't exist on your site.
}; | ||
|
||
const loadLanguageFile = async ( languageFileName: string ) => { | ||
const url = `https://widgets.wp.com/verbum-block-editor/languages/${ languageFileName }-v1.1.json`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will have to handle cache issues at some point as well
…/wp-calypso into translate/verbum-block-editor
Update: It turns out some strings are translated at module initiation time, meaning they strictly have to be translated before the JS bundle is executed at all! Loading translations during runtime of this script won't be possible. I updated this PR to only build the translations. Then, I'll send a Jetpack PR to enqueue the translations before executing this script. |
Proposed Changes
This downloads Gutenberg translations from .org's GlotPress and bundles it with VBE to be deployed in widgets.wp.com. This PR will not make the editor translate well. It just creates the translations file to be consumed later.
Testing Instructions
packages/verbum-block-editor
.yarn build
.yarn dev --sync
./dist/languages
.