8
0
Просмотр исходного кода

Changes to 'Setting the UI language' feature documentation.

Szymon Kupś 8 лет назад
Родитель
Сommit
2e7b446509
2 измененных файлов с 96 добавлено и 0 удалено
  1. 51 0
      docs/features/ui-language.md
  2. 45 0
      npm-debug.log

+ 51 - 0
docs/features/ui-language.md

@@ -13,6 +13,57 @@ See the demo of the editor in German:
 
 {@snippet features/ui-language}
 
+## Loading additional languages from CDN, npm and zip file
+
+You can load additional languages using:
+* [CDN](#CDN),
+* [npm](#npm),
+* [Zip download](#Zip).
+
+Next, configure the editor to use chosen language:
+
+```js
+ClassicEditor
+	.create( document.querySelector( '#editor' ), {
+		language: 'de'
+	} )
+	.then( editor => {
+		console.log( editor );
+	} )
+	.catch( error => {
+		console.error( error );
+	} );
+```
+
+### CDN
+
+To use different language than default one, you need to load the editor together with the preferred language:
+
+```html
+<script src="https://cdn.ckeditor.com/ckeditor5/[version.number]/[distribution]/ckeditor.js"></script>
+<script src="https://cdn.ckeditor.com/ckeditor5/[version.number]/[distribution]/lang/de.js"></script>
+```
+
+See {@link builds/guides/integration/installation#CDN CDN installation guides} for more information.
+
+### npm
+
+After installing the build from npm, languages will be available at `node_modules/@ckeditor/ckeditor5-build-[name]/build/lang/`.
+Single language can be imported directly to your code by `'@ckeditor/ckeditor5-build-[name]/build/lang/de.js' )`.
+
+See {@link builds/guides/integration/installation#npm npm installation guides} for more information.
+
+### Zip
+
+All additional languages are included in `.zip` file. You need to include `ckeditor.js` file together with language file:
+
+```js
+<script src="[ckeditor-path]/ckeditor.js"></script>
+<script src="[ckeditor-path]/lang/de.js"></script>
+```
+
+See {@link builds/guides/integration/installation#Zip-download zip installation guides} for more information.
+
 ## Building the editor using a specific language
 
 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.

+ 45 - 0
npm-debug.log

@@ -0,0 +1,45 @@
+0 info it worked if it ends with ok
+1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'docs' ]
+2 info using npm@3.10.10
+3 info using node@v6.10.0
+4 verbose run-script [ 'predocs', 'docs', 'postdocs' ]
+5 info lifecycle ckeditor5@1.0.0-alpha.2~predocs: ckeditor5@1.0.0-alpha.2
+6 silly lifecycle ckeditor5@1.0.0-alpha.2~predocs: no script for predocs, continuing
+7 info lifecycle ckeditor5@1.0.0-alpha.2~docs: ckeditor5@1.0.0-alpha.2
+8 verbose lifecycle ckeditor5@1.0.0-alpha.2~docs: unsafe-perm in lifecycle true
+9 verbose lifecycle ckeditor5@1.0.0-alpha.2~docs: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/home/szymon/projects/ckeditor5/node_modules/.bin:/home/szymon/bin:/home/szymon/.local/bin:/home/szymon/bin:/home/szymon/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
+10 verbose lifecycle ckeditor5@1.0.0-alpha.2~docs: CWD: /home/szymon/projects/ckeditor5
+11 silly lifecycle ckeditor5@1.0.0-alpha.2~docs: Args: [ '-c', 'node ./scripts/docs/build-docs.js' ]
+12 silly lifecycle ckeditor5@1.0.0-alpha.2~docs: Returned: code: 1  signal: null
+13 info lifecycle ckeditor5@1.0.0-alpha.2~docs: Failed to exec docs script
+14 verbose stack Error: ckeditor5@1.0.0-alpha.2 docs: `node ./scripts/docs/build-docs.js`
+14 verbose stack Exit status 1
+14 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:255:16)
+14 verbose stack     at emitTwo (events.js:106:13)
+14 verbose stack     at EventEmitter.emit (events.js:191:7)
+14 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14)
+14 verbose stack     at emitTwo (events.js:106:13)
+14 verbose stack     at ChildProcess.emit (events.js:191:7)
+14 verbose stack     at maybeClose (internal/child_process.js:877:16)
+14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
+15 verbose pkgid ckeditor5@1.0.0-alpha.2
+16 verbose cwd /home/szymon/projects/ckeditor5
+17 error Linux 4.13.0-17-generic
+18 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "docs"
+19 error node v6.10.0
+20 error npm  v3.10.10
+21 error code ELIFECYCLE
+22 error ckeditor5@1.0.0-alpha.2 docs: `node ./scripts/docs/build-docs.js`
+22 error Exit status 1
+23 error Failed at the ckeditor5@1.0.0-alpha.2 docs script 'node ./scripts/docs/build-docs.js'.
+23 error Make sure you have the latest version of node.js and npm installed.
+23 error If you do, this is most likely a problem with the ckeditor5 package,
+23 error not with npm itself.
+23 error Tell the author that this fails on your system:
+23 error     node ./scripts/docs/build-docs.js
+23 error You can get information on how to open an issue for this project with:
+23 error     npm bugs ckeditor5
+23 error Or if that isn't available, you can get their info via:
+23 error     npm owner ls ckeditor5
+23 error There is likely additional logging output above.
+24 verbose exit [ 1, true ]