|
@@ -1,12 +1,12 @@
|
1
|
|
-## Tracim internationalization
|
|
1
|
+# Tracim internationalization
|
2
|
2
|
|
3
|
|
-### How to for Frontend part
|
|
3
|
+## How to for Frontend part
|
4
|
4
|
|
5
|
5
|
In each frontend repo (frontend, frontend_app_..., frontend_lib), there is a folder i18next.scanner that holds every translation files in JSON.
|
6
|
6
|
|
7
|
7
|
___
|
8
|
8
|
|
9
|
|
-#### I have found a translation error, how do I fix it ?
|
|
9
|
+### I have found a translation error, how do I fix it ?
|
10
|
10
|
|
11
|
11
|
**If the error is in any language other than english:**
|
12
|
12
|
|
|
@@ -32,15 +32,15 @@ This will add your new key in the translation files and remove the old one.
|
32
|
32
|
|
33
|
33
|
___
|
34
|
34
|
|
35
|
|
-#### I have found an untranslated key in a language, how do I fix it ?
|
|
35
|
+### I have found an untranslated key in a language, how do I fix it ?
|
36
|
36
|
|
37
|
|
-It means you have found an english text although you have selected another language.
|
|
37
|
+It means you have found an english text even though you have selected another language.
|
38
|
38
|
|
39
|
|
-Do task a) and b) in the according .json file. In folder i18next.scanner.
|
|
39
|
+Do task a) and b) in the according .json file, in folder i18next.scanner.
|
40
|
40
|
|
41
|
41
|
___
|
42
|
42
|
|
43
|
|
-#### I have found untranslated key in a language but the key does not appear in the .json file.
|
|
43
|
+### I have found an untranslated key in a language but the key does not appear in the .json file.
|
44
|
44
|
|
45
|
45
|
Do step 3).
|
46
|
46
|
|
|
@@ -57,12 +57,13 @@ Exemple: `<div>My untranslated key</div>` will become `<div>{this.props.t('My un
|
57
|
57
|
III) Check that `t` in available in your component, meanings your component must be wraped in the `translate()` higher order function
|
58
|
58
|
|
59
|
59
|
``` javascript
|
|
60
|
+import React from 'react'
|
60
|
61
|
import { translate } from 'react-i18next'
|
61
|
62
|
|
62
|
63
|
class MyComponent extends React.Component {
|
63
|
|
- render () {
|
64
|
|
- return (<div>{this.props.t('My untranslated key')}</div>)
|
65
|
|
- }
|
|
64
|
+ render () {
|
|
65
|
+ return (<div>{this.props.t('My untranslated key')}</div>)
|
|
66
|
+ }
|
66
|
67
|
}
|
67
|
68
|
|
68
|
69
|
export default translate()(MyComponent)
|