Skip to content

Commit bcc5bf4

Browse files
committed
draft of lang contribution guideline
1 parent 52cc80e commit bcc5bf4

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

CONTRIBUTING_LANG.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Check50 Language Translations
2+
Thank you for your interest in making CS50's tooling more accessible for all. Before contributing, please read this in full to avoid any complications.
3+
4+
## Instructions
5+
CS50 uses GitHub to host code, track issues and feature requests, as well as accept pull requests. Please do not email staff members regarding specific issues or features.
6+
7+
In order to add or edit a language for `check50`, please follow these steps.
8+
9+
1. Fork the `check50` repository.
10+
2. Once in the `check50` directory, run `pip install babel` and `pip install -e .`
11+
3. If the language you are looking to add already exists in `check50/locale/`, please skip to step 6.
12+
- See all of the 2 letter language codes [here](https://www.loc.gov/standards/iso639-2/php/code_list.php)
13+
4. Generate the template of strings to translate by running `python3 setup.py extract_messages`. This will create a file in `check50/locale/` called `check50.pot`
14+
5. Run `python setup.py init_catalog -l <LANG>`, where `<LANG>` is the 2 letter language code (see [here](https://www.loc.gov/standards/iso639-2/php/code_list.php)), to create a file called `check50.po` located at `check50/locale/<LANG>/LC_MESSAGES/`. This file is where the translations will be inputted.
15+
6. The original English strings are found at every `msgid` occurence. Translations should be inputted directly under at every `msgstr` occurence.
16+
7. To test your translations, run `python3 setup.py compile_catalog` to compile the `check50.po` file into `check50.mo`.
17+
8. `pip3 install .` to install the new version of `check50` containing these translations.
18+
19+
## Design and Formatting
20+
Please follow the formatting of the `msgstr` English strings. For example, if the `msgid` string is
21+
22+
```
23+
msgid ""
24+
"check50 is not intended for use in interactive mode. Some behavior may "
25+
"not function as expected."
26+
```
27+
28+
The `msgstr` string should replicate the spacing of the English string.
29+
30+
Example:
31+
```
32+
msgstr ""
33+
"check50 không thể sử dụng bằng chế độ tương tác, có thể "
34+
"không hoạt động như mong đợi."
35+
```
36+
37+
Instead of:
38+
```
39+
msgstr ""
40+
"check50 không thể sử dụng bằng chế độ tương tác, có thể không hoạt động như mong đợi."
41+
```
42+
43+
44+
## Translation Error Reports
45+
46+
47+
## References
48+
This document was adapted from the open-source contribution guidelines for [Meta's Draft](https://github.com/facebookarchive/draft-js/blob/main/CONTRIBUTING.md)

0 commit comments

Comments
 (0)