Skip to content

Commit

Permalink
docs: Update example lang codes
Browse files Browse the repository at this point in the history
  • Loading branch information
bragefuglseth authored Jul 8, 2024
1 parent def2574 commit e420124
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Keypunch does not have any external translation infrastructure as of now, but a

This is the technical procedure for adding a text language to Keypunch. To request a language and help with the non-technical aspects, [create a langauge request](https://github.com/bragefuglseth/keypunch/issues/new?assignees=&labels=new+language&projects=&template=language_request.yaml&title=%5BLanguage+Request%5D%3A+) instead. To translate the UI, refer to the section above.

1. Add a word list with approximately 200 words to `data/word_lists/{code}.txt`. Replace `{code}` with the code of your language (e.g. `en_US` or `nb_NO`). If the language has a corresponding list in [Monkeytype's language directory](https://github.com/monkeytypegame/monkeytype/tree/master/frontend/static/languages), you can download that, rename it and run `scripts/json_to_word_list.sh {file_path}` to generate a plain word list. Replace `{file_path}` with a path to the file. You'll need to have `jq` installed for the script to work.
1. Add a word list with approximately 200 words to `data/word_lists/{code}.txt`. Replace `{code}` with the code of your language (e.g. `en` or `nb`). If the language has a corresponding list in [Monkeytype's language directory](https://github.com/monkeytypegame/monkeytype/tree/master/frontend/static/languages), you can download that, rename it and run `scripts/json_to_word_list.sh {file_path}` to generate a plain word list. Replace `{file_path}` with a path to the file. You'll need to have `jq` installed for the script to work.
3. Locate and open `src/text_generation.rs`. This is where all language work takes place.
4. Add the language to the `Language` enum at the alphabetical position of its English name. Use its English name as the variant name, and annotate it with the necessary metadata:

Expand Down

0 comments on commit e420124

Please sign in to comment.