Skip to content

Commit 28ec2b3

Browse files
authored
Enhance Readme To Explain How To Contribute Translations (#4918)
* feature/translations-contribution adding steps on how to contribute a translation * feature/translations-contribution added fruther detail of location of json file * feature/translations-contribution updating snapshots * feature/translations-contribution adding step to run updating snapshot command * feature/translations-contribution reverting snapshot changes * feature/translations-contribution reverting snapshot changes
1 parent 134422d commit 28ec2b3

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,19 @@ Before checking in commits, run `make ci`, which is similar to the `.gitlab-ci.y
138138

139139
### Translating
140140

141-
Help translate Focalboard! The plugin is already translated into several languages. We welcome corrections and new language translations submitted against the [appropriate language JSON file](https://github.com/mattermost/focalboard/tree/main/webapp/i18n) in this repository.
141+
Help translate Focalboard! The plugin is already translated into several languages. We welcome corrections and new language translations submitted against the [appropriate language JSON file](https://github.com/mattermost/focalboard/tree/main/webapp/i18n) in this repository. To add a new language, follow the steps below:
142+
143+
- Create a new file with the language code (I.E. `en.json`) inside `webapp/i18n` directory
144+
- Copy the contents of the en.json file into your newly created file
145+
- Leave the keys in this file as they are and replace all the values with the translated strings
146+
- Go to `webapp/src/constants.ts` and add an entry for the language you are translating into under the **languages** array
147+
- This array needs to consist of three keys: the language code, the name of the language and the display name of the language
148+
- Go to `webapp/src/i18n.tsx`:
149+
- import the json of the language translation you have just added
150+
- Add the language code to the `supportedLanguages` array
151+
- Add another case to the switch case matching the language you added inside `getMessages`
152+
- Once you are done, you need to update the snapshot by using this command `npm run updatesnapshot`
153+
142154

143155
### Staying informed
144156

0 commit comments

Comments
 (0)