You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you are adding a translations please have a look at [`docs/translations.md`](https://github.com/rpsychologist/rpsychologist-com/blob/master/docs/translation.md)
Copy file name to clipboardexpand all lines: docs/translation.md
+42-9
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,25 @@
1
1
# Help to translate
2
2
3
+
Currently the [Cohen's *d* visualization](https://rpsychologist.com/cohend) has i18n support, and any help to translate the contents is very appreciated!
3
4
5
+
## GitHub workflow
6
+
The preferred workflow is using GitHub PRs (however using GitHub is _not_ a requirement to contribute)
7
+
- Check if there's an open PR for your language, and check [this issue](https://github.com/rpsychologist/rpsychologist-com/issues/12)
8
+
+ If someone is already working on a translation reach out to them and collaborate
9
+
- Fork this repo
10
+
- Create a **Draft Pull Request**
11
+
+ Make sure to check **Allow edits from maintainers**
12
+
- When the translation is complete change the status to **Ready for review**
4
13
5
-
Currently the Cohen's *d* visualization has i18n support, and any help to translate the contents is very appreciated!
14
+
If you create a draft pull request as soon as you start working on a translation, it will make it easier for others to avoid doing duplicate work.
6
15
16
+
## Which files to translate
7
17
The translations are identified using the two-letter country code `lang_code`:
8
18
9
19
-`lang_code`: The ISO 3166-1 alpha-2 two-letter country code, Wikipedia has a [list with country codes](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
10
20
11
-
12
21
## JSON files
13
-
There's some common UI elements that need to be translated in `gatsby-theme-rpsych/i18n/react-i18next`, these are `JSON` files with the following structure
22
+
There are some common UI elements that need to be translated in `gatsby-theme-rpsych/i18n/react-i18next`,
14
23
15
24
```
16
25
.
@@ -26,7 +35,7 @@ There's some common UI elements that need to be translated in `gatsby-theme-rpsy
26
35
└── blog.json
27
36
28
37
```
29
-
The translations are identified using the keys in the JSON files. You can copy the `en` folder and replace the english text with your translations (but don't change the keys!)
38
+
The phrases are identified using the keys in the JSON files. You can copy the `en` folder and replace the English text with your translations (but don't change the keys!), the `JSON` files have the following structure
30
39
31
40
```JSON
32
41
{
@@ -67,10 +76,34 @@ Some of the content are sourced from markdown/MDX files, these need to be transl
67
76
```
68
77
The files in `FAQ` and `intro` also needs to be translated
69
78
70
-
## How to share your translations with me
71
-
If you know how to use git then fork the repo and send a pull request when your are done.
79
+
### Checklist
80
+
For a complete translation you will have the following modified (M) and added (A) files
81
+
82
+
```bash
83
+
M gatsby-theme-rpsych/assets/availableTranslations.yml
84
+
85
+
M gatsby-theme-rpsych/i18n/config.json
86
+
87
+
A gatsby-theme-rpsych/i18n/react-i18next/<lang_code>/404.json
88
+
A gatsby-theme-rpsych/i18n/react-i18next/<lang_code>/blog.json
89
+
90
+
A gatsby-theme-rpsych-cohend/i18n/react-i18next/<lang_code>/cohend.json
91
+
92
+
A gatsby-theme-rpsych-cohend/content/cohend/intro/intro.<lang_code>.mdx
93
+
94
+
A gatsby-theme-rpsych-cohend/content/cohend/FAQ/0_help/0_help.<lang_code>.md
95
+
A gatsby-theme-rpsych-cohend/content/cohend/FAQ/1_formulas/1_formulas.<lang_code>.md
96
+
A gatsby-theme-rpsych-cohend/content/cohend/FAQ/2_citation/2_citation.<lang_code>.mdx
97
+
A gatsby-theme-rpsych-cohend/content/cohend/FAQ/3_bug/3_bug.<lang_code>.md
98
+
A gatsby-theme-rpsych-cohend/content/cohend/FAQ/4_load/4_load.<lang_code>.md
99
+
A gatsby-theme-rpsych-cohend/content/cohend/FAQ/5_overlap/5_overlap.<lang_code>.md
100
+
A gatsby-theme-rpsych-cohend/content/cohend/FAQ/6_viz_license/6_viz_license.<lang_code>.md
101
+
102
+
A gatsby-theme-rpsych-cohend/content/cohend/common-language/common-language.<lang_code>.mdx
103
+
```
72
104
73
-
If you are unfamiliar with git then you can download the files, add your translations, and email them to me.
105
+
## I want to help but I don't know how to use git
106
+
If you are unfamiliar with git then you can download the files, add your translations, and email them to me (or share the files using your preferred cloud storage).
74
107
75
108
## Preview your translations
76
109
If you don't want to/don't know how to preview the site locally, then just ask me to send you a preview link after you've added your translation.
@@ -79,12 +112,12 @@ The easiest way to start a local development copy is to use `docker-compose`:
79
112
80
113
```
81
114
docker-compose build
82
-
docker-compose run
115
+
docker-compose up
83
116
```
84
117
Then you can view the page at `http://localhost:8000/cohend`
85
118
86
119
## Attribution
87
-
The translation will be attributed to you on the translated page, e.g. "translated by Your Name". I can link to your webpage and/or Twitter if you'd like.
120
+
The translation will be attributed to you on the translated page, e.g., "translated by Your Name". I can link to your webpage and/or Twitter if you'd like.
88
121
89
122
Let me know if you don't want to be mentioned as a translator.
0 commit comments