Commit b6e0ca5
feat(i18n): add multilanguage support (en/zh-CN/ru)
Implement first-version multilanguage support for gdb-cli:
- Add i18n module with locale detection and translation function
- Support three languages: English, Simplified Chinese, Russian
- Locale precedence: GDB_CLI_LANG > system locale > default (en)
- Normalize locale aliases (en_US→en, zh_CN→zh-CN, ru_RU→ru)
- Fallback to English for unsupported locales/missing keys
New files:
- src/gdb_cli/i18n.py - Core i18n module
- src/gdb_cli/locales/ - Translation catalogs (en.py, zh_cn.py, ru.py)
- README.ru.md - Russian README
- tests/test_i18n.py - 22 i18n unit tests
Modified:
- cli.py - Integrate i18n for all command help texts
- README.md, README.zh-CN.md - Add Russian to language switcher
Tests: 245 passed (22 new i18n tests)
Constraint: Click evaluates help text at import time
Confidence: high
Scope-risk: narrow
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent cd31f3a commit b6e0ca5
10 files changed
Lines changed: 1444 additions & 86 deletions
File tree
- src/gdb_cli
- locales
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
0 commit comments