-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Align docs to the new Translation Service #694
Conversation
toolbar: [ 'headings', 'bold', 'italic', 'custombutton' ], | ||
|
||
// UI language. Language codes follow the https://en.wikipedia.org/wiki/ISO_639-1 format. | ||
lang: 'en' |
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.
One problem I see here is that the editor's config option is called lang
while the Webpack plugin's language
. This will lead people misconfiguring one or the other.
Since additionalLangs
and langs
sound at least bad, I think it'll be better if we used the full language
word in all cases. So we need to change it in the editor's code.
docs/features/ui-language.md
Outdated
@@ -15,7 +15,7 @@ See the demo of the editor in German: | |||
|
|||
## Building the editor using a specific language | |||
|
|||
Currently, it is only possible to change the UI language at the build stage. A single build of the editor supports only the language which was defined in the [CKEditor 5 webpack plugin](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-webpack-plugin)'s configuration. | |||
Currently, it is possible to change the UI language at the build stage and after the build. A single build of the editor supports the language which was defined in the [CKEditor 5 webpack plugin](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-webpack-plugin)'s configuration. See the whole translation process to see how you can change the language later. |
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.
This guide needs to be pretty much rewritten rather than patched. Since the whole picture changed dramatically we need to put focus on different things.
-
The current intro can stay.
-
But then we should explain how to initialize the editor from CDN/zip/npm with a different language. This is what most people will want to do. Please also review other guides like
installation.md
and other places where we list files available in a build because that list needs to be updated (and perhaps link to the ui-language.md guide): -
Then we can provide a few more details on what other options people have:
- compiling an optimised editor (single language case),
- compiling a subset of languages (TBH, I'm not sure what's the use case for that – perhaps speeding up the process and reducing the number of files – but let's mention it anyway),
- handling multiple entry points scenario (as @ma2ciek noticed that has certain limitations)
-
At the end we can mention that compiling editor translations is only available for Webpack and we will be extending support for other bundlers in the future. If we want to mention those tickets about translations services we should explain why we mention them. Something like – if you'd like to tinker with one of the bundlers you can read about CKEditor 5's translation service here and here.
docs/features/ui-language.md
Outdated
outputDirectory: 'lang', | ||
|
||
// Optional flag indicates breaking the build process when the error is found. | ||
throwErrorOnMissingTranslation: false |
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.
Is false
a default value? In documentation, in code samples, we should present real usage and no one will change false
to false
:P Plus, the comment above is unclear now – if you'd turn it on here, we could simply document that it "Will cause the building process to fail if a translation for one of the strings is missing".
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.
Ok. I just wanted to list available options with their default values.
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.
You can mention the default value of each option in a comment.
docs/features/ui-language.md
Outdated
<script src="../build/ckeditor.js"></script> | ||
<script src="../build/lang/pl.js"></script> | ||
<script> | ||
ClassicEditor.create( document.querySelector( '#editor' ), { |
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.
Better Consistent formatting:
ClassicEditor
.create( {
} )
.then()
.catch();
npm-debug.log
Outdated
@@ -0,0 +1,45 @@ | |||
0 info it worked if it ends with ok |
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 dunno why I was reading this commit but this caught my attention :): npm-debug.log
docs/features/ui-language.md
Outdated
|
||
### CDN | ||
|
||
To use different language than default one, you need to load the editor together with the preferred language: |
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 can specify, that English will be the main language at CDN.
Suggested merge commit message (convention)
Docs: Aligned docs and snippets to the Translation Service v2. Closes #624.
Additional information
Requires ckeditor/ckeditor5-dev#314.
TODO: Update snippet-adapter's dependencies after
ckeditor5-dev
releases.TODO: Update package.json after
ckeditor5-dev
releases.