feat: add English localization and Russian README translation#78
Merged
Conversation
Introduce a flat-dict i18n system (i18n/__init__.py) with Russian
(i18n/ru.py) and English (i18n/en.py) locale files. The active locale
is selected via the BOT_LANGUAGE env var (default: ru).
- config/settings.py: new bot_language field, validated to {ru, en}
- main.py: call i18n.configure() before importing handler modules so
F.text == t("...") decorators resolve with the correct locale
- bot/formatters.py: all user-facing strings replaced with t() calls,
module-level Russian constants removed
- bot/private_chat.py: removed PRIVATE_ONLY_TEXT constant, use t() inline
- bot/keyboards/common.py, admin.py, keys.py, proxy.py: all button
labels replaced with t() calls
- bot/handlers/common.py, start.py, admin.py, keys.py, proxy.py,
callbacks.py: all hardcoded Russian strings replaced with t() calls;
stale constant imports removed
- README_RU.md: full accurate Russian translation of README.md
https://claude.ai/code/session_01ARDGi134VgnEyo1FPCeaNd
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
- test_followup_hardening: replace removed ADMIN_PRIVATE_ONLY_TEXT
constant import with i18n.configure("ru") + t() call
- i18n/ru.py: change btn_next from Дальше to Далее (matching original
hardcoded label); add proxy_socks5_traffic_note key with Russian text
- i18n/en.py: add proxy_socks5_traffic_note key with English text
- bot/formatters.py: use t("proxy_socks5_traffic_note") instead of
hardcoded English in proxy_admin_status_text
Fixes CI test failures introduced by the i18n refactor.
https://claude.ai/code/session_01ARDGi134VgnEyo1FPCeaNd
Use distinct local names (_en, _ru) for conditional imports instead of reusing _mod in both branches, which mypy flagged as a re-definition. https://claude.ai/code/session_01ARDGi134VgnEyo1FPCeaNd
…ions Fix translation errors from the literal first pass: - "hardening tests" was wrongly translated as "нагрузочные тесты" (load tests); now kept as "hardening-тесты" - "non-secret reason" was wrongly rendered as "непривилегированной причиной"; now "без раскрытия секретных деталей" - "committed transactions" (SQLite) was confused with git commits; now "зафиксированных транзакций" Apply the main rule: keep English terms when the Russian equivalent would be worse or less natural — backend, deploy, helper, wrapper, drop-in, endpoint, fingerprint, preshared key, apply, rollback, runtime, staging, runbook, healthcheck, preflight/postflight, etc. Translate only where Russian is clearly better: возможности, структура репозитория, переменные окружения, обзор развёртывания, обслуживание, база данных, статус проекта, лицензия. https://claude.ai/code/session_01ARDGi134VgnEyo1FPCeaNd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
i18n/package) with Russian (ru.py) and English (en.py) locale files (~200 strings each). The active locale is selected via theBOT_LANGUAGEenv var (default:ru).config/settings.py: newbot_languagefield, validated to{ru, en}.main.py:i18n.configure()is called before any handler modules are imported, soF.text == t("...")decorators in aiogram filters resolve with the correct locale at import time.bot/formatters.py: all user-facing strings replaced witht()calls; module-level Russian constants removed.bot/private_chat.py: removedPRIVATE_ONLY_TEXTconstant, usest()inline.bot/keyboards/common.py,admin.py,keys.py,proxy.py: all button labels replaced witht()calls.bot/handlers/common.py,start.py,admin.py,keys.py,proxy.py,callbacks.py: all hardcoded Russian strings replaced witht()calls; stale constant imports removed.README_RU.md: full, accurate Russian translation ofREADME.md.Test plan
BOT_LANGUAGE=ru— all messages and button labels appear in Russian (existing behaviour unchanged)BOT_LANGUAGE=en— all messages and button labels appear in EnglishF.textmenu filters (btn_my_keys,btn_create_key,btn_proxy,btn_help,btn_admin_panel) route correctly in both localesBOT_LANGUAGE=fr(invalid) is rejected at startuphttps://claude.ai/code/session_01ARDGi134VgnEyo1FPCeaNd
Generated by Claude Code