Skip to content

Commit

Permalink
add documentations for localization helper
Browse files Browse the repository at this point in the history
  • Loading branch information
NCBM committed Dec 9, 2024
1 parent a4e7c94 commit 3da60b8
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions docs/development/localization.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,36 @@ in basedpyright we want to fix this but we need your help! if you are fluent in

Here are some guidelines for contributors who would like to help improve the translations in basedpyright.

## Tools for localization

A TUI tool `build/localization_helper.py` script is provided to help you with the localization process. It can be used to:

- Check every message in comparison with the corresponding English message.
- Compare message keys with the English version and find out which messages are missing and which ones are redundant.

### Usage

Run the script:

```shell
# use uv
uv run build/localization_helper.py
# or pdm
pdm run build/localization_helper.py
# or run the script directly IF YOU CAN ASSURE YOU ARE ALREADY IN THE VIRTUAL ENVIRONMENT OF THE PROJECT
python build/localization_helper.py
```

About the interface:

- The TUI is created with [textual](https://github.com/Textualize/textual), and it is generally fine to use it with mouse.
- Click on the tabs for the given language at the top of the interface to switch to the localized content in the corresponding language.
- Click on the function buttons at the bottom of the interface to carry out the corresponding operations.
- Click on a category in the message tree to expand/collapse the content under that category.
- Click on a message entry in the message tree to prompt the corresponding English entry automatically.

> NOTE: If the operation "Compare message keys differences" is triggered, the popup can ONLY be closed by pressing `c`.
## General guidelines

- Do not use any automatic translation tools.
Expand Down

0 comments on commit 3da60b8

Please sign in to comment.