-
Notifications
You must be signed in to change notification settings - Fork 27
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
Provide support for plural forms i18n, make more generic tools #614
Conversation
…Removed string replacement strategy for single language (`singlelanguagetranslationservice.js`).
…n to support plural forms and non-CKEditor5 environments.
…s of MultipleLanguageTranslationSercice.
|
…he `message.id`.
…s not registered in the list of packages.
Merged the |
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.
TC:
- cd ckeditor5 # go to ckeditor 5 project
- yarn link @ckeditor/ckeditor5-dev-webpack-plugin # assuming that you already executed `yarn link` in ckeditor5-dev/packages/ckeditor5-dev-webpack-plugin
- yarn run manual -f table
I get following error:
[CKEditorWebpackPlugin] Error: Too many JS assets has been found during the compilation. You should add translation assets directly to the application from the `lang` directory or use the `allowMultipleJSOutputs` option to add translatiolanguage to all assets.
ns for the main language to all assets.
…t will output translations to all assets.
Building the docs also throws an error:
|
…uageTranslationsToAllAssets` CKEditorWebpackPlugin options.
These warnings should be fixed now after merging ckeditor/ckeditor5#6654. |
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.
All right, works well now.
Suggested merge commit message (convention)
Feature: Provided support for plural forms i18n. Closes ckeditor/ckeditor5#6526. Closes ckeditor/ckeditor5#988.
MINOR BREAKING CHANGE: Omitting the
language
property in theCKEditorWebpackPlugin
will not have any effect from now. This means that in both cases only the main language (language
) will be added to the main bundle and translations for other languages will be saved in separate files.MAJOR BREAKING CHANGE: The translation process no longer creates short ids for message strings. From now, the source code will not be changed by the translation process, translations for the main language will be added to the bundle(s) and translations for other languages will be outputted to separate executable JS files.
Additional information
The
t()
function accepts now a string or an object with the following properties:string
(required)id
- used to identify ambiguous translationsplural
- used when messages should support plural formsThis PR touches (but not resolves directly)
For example – encountered issues, assumptions you had to make, other affected tickets, etc.
Checklist
CKEditorWebpackPlugin
CKEditorWebpackPlugin
CKEditorWebpackPlugin