Skip to content
This repository was archived by the owner on Feb 6, 2024. It is now read-only.

Commit 05c44e8

Browse files
docs: editor translation how-to
1 parent bdc79b9 commit 05c44e8

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

CONTRIBUTING.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,17 @@ We would be grateful to get your help to translate our apps!
4646

4747
### Editor
4848

49-
The selection or detection of the language is not yet implemented in our editor. As soon as someone contributes with a language other than English, we will be happy to develop such function.
49+
The online editor ([studio](https://github.com/deckgo/deckdeckgo/tree/master/studio)) can be translated as following:
5050

51-
Meanwhile, the online editor ([studio](https://github.com/deckgo/deckdeckgo/tree/master/studio)) can be translated as following:
51+
1. Copy [en.json](https://github.com/deckgo/deckdeckgo/blob/master/studio/src/assets/i18n/en.json) to a new filename reflecting the language (such as for example `fr.json` for French)
52+
2. Translate each keys of the newly created file
53+
3. Provide a PR
5254

53-
1. Translate each keys in [en.json](https://github.com/deckgo/deckdeckgo/blob/master/studio/src/assets/i18n/en.json)
54-
2. Once finished, copy this file to a new filename reflecting the language (such as for example `fr.json` for French)
55-
3. Revert the changes in `en.json`
56-
4. Provide a PR
55+
If you would like to test your translations, either test these by overwriting temporarily [en.json](https://github.com/deckgo/deckdeckgo/blob/master/studio/src/assets/i18n/en.json) or add the new language as following:
56+
57+
1. Add it the to the list of supported languages in [languages.d.ts](https://github.com/deckgo/deckdeckgo/blob/main/studio/src/app/definitions/languages.d.ts)
58+
2. Add a related dynamic import in the state management [i18n.store.ts](https://github.com/deckgo/deckdeckgo/blob/bdc79b9cd1f52171bab2f772fa6905c710f3b2e0/studio/src/app/stores/i18n.store.ts#L11)
59+
3. Add it to the default language detection list in [lang.service.ts](https://github.com/deckgo/deckdeckgo/blob/bdc79b9cd1f52171bab2f772fa6905c710f3b2e0/studio/src/app/services/lang/lang.service.ts#L36)
5760

5861
Translations are handled in JSON files but, as we are consuming these through a store, their representation have to exist as interfaces.
5962
To ease the process we have developed a script which extract the declarations automatically.

0 commit comments

Comments
 (0)