feat: JLPT levels for Japanese, custom practice scenarios, UI improvements
- Add separate level systems: CEFR (A1-C2) for European languages, JLPT (N5-N1) for Japanese - Store levels per language in new `levels_by_language` JSON field - Add custom scenario option in AI practice mode - Show action buttons after practice ends (new dialogue, tasks, words) - Fix level display across all handlers to use correct level system - Add Alembic migration for levels_by_language field - Update all locale files (ru, en, ja) with new keys 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -31,6 +31,11 @@ def _resolve_key(data: Dict[str, Any], dotted_key: str) -> Any:
|
||||
return cur
|
||||
|
||||
|
||||
def get_user_lang(user) -> str:
|
||||
"""Унифицированное получение языка интерфейса пользователя."""
|
||||
return (getattr(user, 'language_interface', None) if user else None) or 'ru'
|
||||
|
||||
|
||||
def t(lang: str, key: str, **kwargs) -> str:
|
||||
"""Translate key for given lang; fallback to ru and to key itself.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user