Skip to content

Commit 186464d

Browse files
committed
Update docs
1 parent cefaf19 commit 186464d

File tree

2 files changed

+46
-9
lines changed

2 files changed

+46
-9
lines changed

CONTRIBUTING.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Contributions are welcome!
2+
3+
# Translations
4+
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)

docs/translation.md

+42-9
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,25 @@
11
# Help to translate
22

3+
Currently the [Cohen's *d* visualization](https://rpsychologist.com/cohend) has i18n support, and any help to translate the contents is very appreciated!
34

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**
413

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.
615

16+
## Which files to translate
717
The translations are identified using the two-letter country code `lang_code`:
818

919
- `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)
1020

11-
1221
## 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`,
1423

1524
```
1625
.
@@ -26,7 +35,7 @@ There's some common UI elements that need to be translated in `gatsby-theme-rpsy
2635
└── blog.json
2736
2837
```
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
3039

3140
```JSON
3241
{
@@ -67,10 +76,34 @@ Some of the content are sourced from markdown/MDX files, these need to be transl
6776
```
6877
The files in `FAQ` and `intro` also needs to be translated
6978

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+
```
72104

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).
74107

75108
## Preview your translations
76109
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`:
79112

80113
```
81114
docker-compose build
82-
docker-compose run
115+
docker-compose up
83116
```
84117
Then you can view the page at `http://localhost:8000/cohend`
85118

86119
## 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.
88121

89122
Let me know if you don't want to be mentioned as a translator.
90123

0 commit comments

Comments
 (0)