-
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
Add support for the translationsOutputFile
option allowing specifying target bundle for translations
#662
Conversation
translationsOutputFile
option allowing specifying target bundle for translationstranslationsOutputFile
option allowing specifying target bundle for translations
@pomek, could you test it on the Vue integration by following the steps from https://github.com/ckeditor/ckeditor5/pull/7755/files#diff-0acf7b6d2c9b5050039b3d5741919a61? I mean both modes ( |
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.
I need to figure out how to reproduce the an that the PR should fix. However, cosmetic changes could be applied.
packages/ckeditor5-dev-utils/lib/translations/multiplelanguagetranslationservice.js
Outdated
Show resolved
Hide resolved
/** | ||
* @param {Object} options | ||
* @param {String} options.outputDirectory Output directory for the translation files relative to the output. | ||
* @param {String[]} options.compilationAssetNames Original asset names from the compiler (e.g. Webpack). |
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.
s/String[]/Array.<String>
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.
Missing the @returns
tag.
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 sure if we document the return
everywhere. Especially for such places that the code is rather internal. I can specify only the type as the function name suggests what it returns.
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.
If it returns Object, just put @returns {Object}
. We don't need digging into its details.
packages/ckeditor5-dev-utils/lib/translations/multiplelanguagetranslationservice.js
Outdated
Show resolved
Hide resolved
packages/ckeditor5-dev-utils/lib/translations/multiplelanguagetranslationservice.js
Show resolved
Hide resolved
/** | ||
* | ||
* @param {String|((name: string) => boolean)|RegExp} predicate | ||
* @param {String[]} options | ||
* @returns {String|undefined} | ||
*/ |
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.
String|RegExp|Function
would be enough. OTOH, why do we need to support such complex construction?
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.
s/String[]/Array.<String>
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 need to support at least strings and regexps. We need strings for specifying the name that might not exist and regexp for matching the existing name. I added support for function as it always allows for full customization.
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.
I would put the comment in the code. In the future, it might help when we will be wondering why it's done this way and what we wanted to resolve.
packages/ckeditor5-dev-utils/lib/translations/multiplelanguagetranslationservice.js
Outdated
Show resolved
Hide resolved
packages/ckeditor5-dev-utils/lib/translations/multiplelanguagetranslationservice.js
Outdated
Show resolved
Hide resolved
packages/ckeditor5-dev-utils/lib/translations/multiplelanguagetranslationservice.js
Outdated
Show resolved
Hide resolved
…translationservice.js Co-authored-by: Kamil Piechaczek <pomek@users.noreply.github.com>
Suggested merge commit message (convention)
Feature: Add support for the
translationsOutputFile
option forCKEditorWebpackPlugin
allowing specifying the target bundle for translations. Closes ckeditor/ckeditor5#7688.Additional information
CKEditorWebpackPlugin
won't longer complain when no asset will be available during the build