浏览代码

Added Localization section to the React Integration guide.

Kamil Piechaczek 6 年之前
父节点
当前提交
5e9b00ba3f
共有 1 个文件被更改,包括 31 次插入0 次删除
  1. 31 0
      docs/builds/guides/frameworks/react.md

+ 31 - 0
docs/builds/guides/frameworks/react.md

@@ -559,6 +559,37 @@ class App extends Component {
 export default App;
 ```
 
+## Localization
+
+The CKEditor 5 component can be localized in two steps.
+
+### 1. Loading translation files
+
+First, you need to add translation files to the bundle. 
+
+```js
+import '@ckeditor/ckeditor5-build-classic/build/translations/de';
+import ClassicEditor from '@ckeditor/ckeditor5-build-classic';
+// ...
+```
+
+### 2. Configuring the language
+
+Then, you need to configure the editor to use the given language:
+
+```jsx
+<CKEditor
+    config={ {
+        language: 'de',
+        // ...
+    } }
+	editor={ ClassicEditor }
+	data="<p>Hello from CKEditor 5!</p>"
+/>
+```
+
+For advanced usage see the {@link features/ui-language Setting UI language} guide.
+
 ## Contributing and reporting issues
 
 The source code of rich text editor component for React is available on GitHub in https://github.com/ckeditor/ckeditor5-react.