♻️ refactor(i18n): replace kebab-case with snake_case in FTL keys#72
♻️ refactor(i18n): replace kebab-case with snake_case in FTL keys#72itisnotyourenv merged 6 commits intomainfrom
Conversation
- Rename all locale keys from kebab-case to snake_case across en/ and ru/ - Add separator="_" to TranslatorHub so typed method calls match FTL keys - Introduce types.py with TYPE_CHECKING guard for typed TranslatorRunner - Migrate routers to use typed i18n method calls where applicable - Unify TranslatorRunner imports to src.infrastructure.i18n - Remove obsolete stubs.pyi (replaced by types.py) - Update generate_i18n_stubs.py to target types.py - Add generate-i18n justfile command Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This comment was marked as outdated.
This comment was marked as outdated.
…i18n - Add logger.info calls to all three admin stats handlers - Switch from TranslatorHub to i18n middleware injection - Use typed i18n method calls instead of i18n.get() strings - Extract stats keyboard markup to utils/markups/admin.py - Add check_alive_btn locale key for en/ and ru/ Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace i18n.get() string calls with typed method calls in _start_onboarding and command_start_handler. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Supplementary Review NotesThe previous review comment (by an earlier Claude session) covers the major issues well. A few additional observations not mentioned there: Critical Issue
|
This comment was marked as outdated.
This comment was marked as outdated.
- Switch from TranslatorHub to i18n middleware injection - Replace i18n.get() string calls with typed method calls - Remove duplicate referral_info call Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace i18n.get() string calls with typed method calls for btn_settings, btn_language, and btn_back buttons. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
PR Review: ♻️ refactor(i18n): replace kebab-case with snake_case in FTL keysOverall Assessment: Request Changes The core idea is solid — snake_case keys with 🔴 Critical Issues1. Incomplete migration in
|
PR Review:
|
Summary
.ftl) locale keys from kebab-case to snake_case acrossen/andru/localesseparator="_"toTranslatorHubso typed method calls match the new FTL key formattypes.pywith aTYPE_CHECKING-guardedTranslatorRunnerclass providing IDE autocomplete for all translation keysi18n.method()calls and unifyTranslatorRunnerimports tosrc.infrastructure.i18nstubs.pyi(replaced bytypes.py)generate_i18n_stubs.pyto targettypes.pywithTYPE_CHECKINGguard patterngenerate-i18njustfile commandutils/markups/admin.pycheck_alive_btnlocale key for en/ruWhy
Fluent's recommended key format uses hyphens, but fluentogram's
TranslatorRunnermaps keys to Python method calls using a configurable separator. With underscore-based keys andseparator="_", the FTL keys directly match Python method names — eliminating the need for kebab-to-snake conversion and enabling type-safei18n.key_name()calls with full IDE support.Changes
.ftlfiles-→_, addedcheck_alive_btnhub.py,types.py,__init__.pysettings.py,admin.py(new)generate_i18n_stubs.pytypes.pywithTYPE_CHECKINGguardjustfilegenerate-i18ncommandstubs.pyitypes.py)Checklist
TranslatorRunnerimports unified tosrc.infrastructure.i18n🤖 Generated with Claude Code