Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation for localization helper #942

Merged
merged 2 commits into from
Dec 9, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
NCBM marked this conversation as resolved.
Show resolved Hide resolved
```

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`.
NCBM marked this conversation as resolved.
Show resolved Hide resolved

## General guidelines

- Do not use any automatic translation tools.
Expand Down
Loading