feat: add translation language setting & onboarding flow
- Add separate translation_language setting (independent from interface language) - Implement 3-step onboarding for new users: 1. Choose interface language 2. Choose learning language 3. Choose translation language - Fix localization issues when using callback.message (user_id from state) - Add UserService.get_user_by_id() method - Add get_user_translation_lang() helper in i18n - Update all handlers to use correct translation language - Add localization keys for onboarding (ru/en/ja) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
25
migrations/versions/20251207_add_translation_language.py
Normal file
25
migrations/versions/20251207_add_translation_language.py
Normal file
@@ -0,0 +1,25 @@
|
||||
"""Add translation_language field to users table
|
||||
|
||||
Revision ID: 20251207_translation_language
|
||||
Revises: 20251206_word_translations
|
||||
Create Date: 2025-12-07
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = '20251207_translation_language'
|
||||
down_revision: Union[str, None] = '20251206_word_translations'
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
op.add_column('users', sa.Column('translation_language', sa.String(2), nullable=True))
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
op.drop_column('users', 'translation_language')
|
||||
Reference in New Issue
Block a user