Thanks for your interest in contributing to Keypunch! Here are some useful things to know:
Bug reports and feature requests are welcome. However, please keep the following in mind:
- Flatpak is the only officially supported packaging format
- The app has a conservative approach to preferences; things should ideally be good enough out of the box
- Before making a change and opening a pull request, make sure to discuss it in the issue tracker first, to make sure that the change will be accepted
- This project follows the GNOME Code of Conduct
Use the Flatpak version of GNOME Builder to build and run the project from source:
-
Open Builder and press the "Clone Repository…" button
-
Paste a link to the repository in the "Repository URL" field:
https://github.com/bragefuglseth/keypunch
-
Press the "Clone repository…" button
-
Press confirm if asked about automatic installation of any dependencies, and wait for them to download
-
Press the play button in the header bar
Keypunch does not have any external translation infrastructure as of now, but a slot on Weblate will be applied for as soon as the project meets the requirements. Until then, please submit translations as regular pull requests. Translation work happens in the po
directory.
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 language request instead. To translate the UI, refer to the section above.
-
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
ornb
). If the language has a corresponding list in Monkeytype's language directory, you can download that, rename it and runscripts/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 havejq
installed for the script to work. -
Locate and open
src/text_generation.rs
. This is where all language work takes place. -
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:#[strum(message = "{native_name}", to_string = "{code}")] LanguageName,
Replace
{native_name}
with the native name of the language, and{code}
with the language code. -
If the language has punctuation or spacing that deviates from the default (words separated by spaces, punctuation inserted before and after words, and Western Arabic numerals), add it to the match statements of the
simple
andadvanced
functions. Existing language entries can be used as examples. -
Build the app and test the implementation.