Sfoglia il codice sorgente

Merge branch 'master' into t/1151

Aleksander Nowodzinski 6 anni fa
parent
commit
90220ee99d

+ 80 - 0
docs/builds/guides/frameworks/vuejs.md

@@ -388,6 +388,86 @@ Since accessing the editor toolbar is not possible until after the editor instan
 </script>
 ```
 
+## Localization
+
+CKEditor 5 supports {@link features/ui-language multiple UI languages}, and so does the official Vue.js component. Follow the instructions below to translate CKEditor 5 in your Vue.js application.
+
+### Ready-to-use builds
+
+When using one of the {@link builds/guides/overview#available-builds official editor builds}, you need to import the translations first.
+
+* When using a [direct script include](#direct-script-include):
+	```html
+	<!-- Import translations for the German language. -->
+	<script src="../node_modules/@ckeditor/ckeditor5-build-classic/build/translations/de.js"></script>
+	<script src="../node_modules/@ckeditor/ckeditor5-build-classic/build/ckeditor.js"></script>
+	<script src="../node_modules/@ckeditor/ckeditor5-vue/dist/ckeditor.js"></script>
+	```
+* When using [ES6 modules](#using-es6-modules):
+	```js
+	import ClassicEditor from '@ckeditor/ckeditor5-build-classic';
+
+	// Import translations for the German language.
+	import '@ckeditor/ckeditor5-build-classic/build/translations/de';
+	```
+
+Then, {@link builds/guides/integration/configuration configure} the language of the editor in the component:
+
+```html
+<ckeditor :editor="editor" v-model="editorData" :config="editorConfig"></ckeditor>
+```
+
+```js
+export default {
+	name: 'app',
+	data() {
+		return {
+			editor: ClassicEditor,
+			editorData: '<p>Content of the editor.</p>',
+			editorConfig: {
+				// Run the editor with the German UI.
+				language: 'de'
+			}
+		};
+	}
+}
+```
+
+For more information, please refer to the {@link features/ui-language "Setting UI language"} guide.
+
+### CKEditor 5 built from source
+
+Using the editor [built from source](#using-ckeditor-from-source) requires you to modify the webpack configuration. Pass the `language` (also `additionalLanguages`) to the constructor of  [`CKEditorWebpackPlugin`](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-webpack-plugin) to localize your editor:
+
+```js
+// vue.config.js
+// ...
+
+const CKEditorWebpackPlugin = require( '@ckeditor/ckeditor5-dev-webpack-plugin' );
+
+// ...
+
+module.exports = {
+	// ...
+
+	configureWebpack: {
+		plugins: [
+			// CKEditor needs its own plugin to be built using webpack.
+			new CKEditorWebpackPlugin( {
+				// The UI language. Language codes follow the https://en.wikipedia.org/wiki/ISO_639-1 format.
+				language: 'de'
+			} )
+		]
+	},
+
+	// ...
+}
+```
+
+After building the application, CKEditor 5 will run with the UI translated to the specified language.
+
+For more information, please refer to the {@link features/ui-language "Setting UI language"} guide.
+
 ## Component directives
 
 ### `editor`

+ 5 - 5
docs/features/image-upload.md

@@ -8,16 +8,16 @@ order: 10
 
 Inserting images into content created with CKEditor 5 is a very common task. In a properly configured rich-text editor, there are several ways for the end user to insert images:
 
-* **Pasting** it from the clipboard.
+* **Pasting** an image from the clipboard.
 * **Dragging** a file from the file system.
-* Selecting it through a **file system dialog**.
-* Selecting it from a **media management tool** in your application.
+* Selecting an image through a **file system dialog**.
+* Selecting an image from a **media management tool** in your application.
 
 Excluding the last option, all other ways require the image to be uploaded to a server. The server will then be responsible for providing the image URL used by CKEditor 5 to display the image in the document.
 
 {@img assets/img/image-upload-animation.svg 650 The visualization of the image upload process in a WYSIWYG editor.}
 
-The software that makes the image upload possible is called an **upload adapter**. It is a callback which tells the editor how to send the file to the server. There are two main strategies of getting the image upload work you can adopt in your project:
+The software that makes the image upload possible is called an **upload adapter**. It is a callback that tells the WYSIWYG editor how to send the file to the server. There are two main strategies of getting the image upload to work that you can adopt in your project:
 
 * [**Official upload adapters**](#official-upload-adapters) &ndash; There are several features providing upload adapters developed and maintained by the CKEditor team. Pick the best one for your integration and let it handle the image upload in your project.
 * [**Custom upload adapters**](#implementing-your-own-upload-adapter) &ndash; Create your own upload adapter from scratch using the open API architecture of CKEditor 5.
@@ -40,7 +40,7 @@ The demo below uses the {@link builds/guides/overview#classic-editor Classic edi
 
 CKEditor 5 introduces a new way of handling images, with a strong focus on the end–user experience. This feature is called {@link features/easy-image Easy Image} and its goal is to make the image upload as effortless and intuitive as possible.
 
-Easy Image is part of the [CKEditor Cloud Services](https://ckeditor.com/ckeditor-cloud-services/) offer. It is a <abbr title="Software as a service">SaaS</abbr> product which:
+Easy Image is part of the [CKEditor Cloud Services](https://ckeditor.com/ckeditor-cloud-services/) offer. It is a <abbr title="Software as a service">SaaS</abbr> product that:
 
 * securely uploads images,
 * takes care of rescaling and optimizing them as well as providing various image sizes (responsive images),

+ 2 - 1
docs/umberto.json

@@ -24,7 +24,8 @@
 		"features/image-upload.html": "features/image-upload/image-upload.html",
 		"features/ckfinder.html": "features/image-upload/ckfinder.html",
 		"features/easy-image.html": "features/image-upload/easy-image.html",
-		"features/collaboration/comments/integrate-comments-with-application.html": "features/collaboration/comments/comments-integration.html"
+		"features/collaboration/comments/integrate-comments-with-application.html": "features/collaboration/comments/comments-integration.html",
+		"features/collaboration/track-changes.html": "features/collaboration/track-changes/track-changes.html"
 	},
 	"scripts": {
 		"snippet-adapter": "../scripts/docs/snippetadapter",

+ 1 - 0
mrgit.json

@@ -1,6 +1,7 @@
 {
   "packages": "packages/",
   "packagesPrefix": "@ckeditor/ckeditor5-",
+  "baseBranches": [ "master", "stable" ],
   "dependencies": {
     "@ckeditor/ckeditor5-adapter-ckfinder": "ckeditor/ckeditor5-adapter-ckfinder",
     "@ckeditor/ckeditor5-alignment": "ckeditor/ckeditor5-alignment#t/ckeditor5/1151",

+ 0 - 39
scripts/release/update-mgit-branches.js

@@ -1,39 +0,0 @@
-#!/usr/bin/env node
-
-/**
- * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
-
-/* eslint-env node */
-
-'use strict';
-
-const branchName = process.argv[ 2 ];
-
-if ( !branchName ) {
-	throw new Error( 'Missing branch name.' );
-}
-
-const path = require( 'path' );
-const { tools, logger } = require( '@ckeditor/ckeditor5-dev-utils' );
-const log = logger();
-const mrgitJsonPath = path.resolve( __dirname, '..', '..', 'mrgit.json' );
-
-log.info( 'Updating the "mrgit.json"...' );
-
-tools.updateJSONFile( mrgitJsonPath, mrgitJson => {
-	const dependencies = mrgitJson.dependencies;
-
-	for ( const packageName of Object.keys( dependencies ) ) {
-		dependencies[ packageName ] = dependencies[ packageName ].split( '#' )[ 0 ];
-
-		if ( branchName !== 'master' ) {
-			dependencies[ packageName ] += '#' + branchName;
-		}
-	}
-
-	return mrgitJson;
-} );
-
-log.info( `Done. "mrgit.json" uses the "${ branchName }" branch now.` );

+ 6 - 18
scripts/update-stable-branches.sh

@@ -10,28 +10,16 @@ echo ""
 
 if [[ $REPLY =~ ^[Yy]$ ]]
 then
-	# Update the `stable` branch in the ckeditor5 repository.
+	# Update the `stable` branch in the `ckeditor5` repository.
 	git checkout stable && git merge master && git checkout master
 
-	# Add `stable` branches in all repos which don't have them yet.
-	mrgit exec 'git checkout -b stable 2> /dev/null && git push origin stable && git checkout master'
+	# Add `#stable` branches in all repos which don't have them yet.
+	mgit exec 'git checkout -b stable 2> /dev/null && git push origin stable && git checkout master'
 
-	# Update all `stable` branches in all packages.
-	mrgit exec 'git checkout stable && git pull origin stable && git merge master && git checkout master'
+	# Update all `#stable` branches in all packages.
+	mgit exec 'git checkout stable && git pull origin stable && git merge master && git checkout master'
 
-	# Make sure that `mrgit.json` for `stable` and `master` branches is correct.
-	# `stable` branch.
-	git checkout stable && \
-	node ./scripts/release/update-mrgit-branches stable && \
-	git commit -a -m "Internal: Use stable branches. [skip ci]"
-
-	# `master` branch.
-	git checkout master && \
-	git merge stable && \
-	node ./scripts/release/update-mrgit-branches master && \
-	git commit -a -m "Internal: Use master branches. [skip ci]"
-
-	# Push the `stable` branches.
+	# Push the `#stable` branches.
 	git push origin stable master && \
 	mrgit exec 'git push origin stable'