From ae63b6100349adb0b0c5fc31ca39c866983da204 Mon Sep 17 00:00:00 2001 From: Drobysh Date: Fri, 9 Oct 2026 11:25:22 +0000 Subject: [PATCH] =?UTF-8?q?game/get=5Flevel:=20=D0=BE=D1=82=D0=B4=D0=B0?= =?UTF-8?q?=D1=91=D0=BC=20=D0=B2=D1=81=D0=B5=204=20=D0=BF=D0=B5=D1=80?= =?UTF-8?q?=D0=B5=D0=B2=D0=BE=D0=B4=D0=B0=20(ru/uk/en)=20+=20legacy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routers/game.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/routers/game.py b/routers/game.py index 6c4a092..b9ea9e2 100644 --- a/routers/game.py +++ b/routers/game.py @@ -114,12 +114,24 @@ async def get_level(request: Request, level_number: int): telegram_id, level["id"], ) + # 🔧 ОБНОВЛЕНО (09.10.2026): отдаём ВСЕ 4 перевода. + # Flutter сам выбирает, какой показать по context.lang. + # Старое поле 'translation' оставлено для совместимости (legacy). word_list = [] for w in words: - translation = w.get(f"translation_{lang}", "") or w.get("translation_pl", "") or w.get("translation_en", "") + legacy_translation = ( + w.get(f"translation_{lang}", "") + or w.get("translation_en", "") + or "" + ) word_list.append({ "word_pl": w["word_pl"], - "translation": translation, + # Legacy (для старого Flutter) + "translation": legacy_translation, + # 🆕 Все переводы (Flutter сам выбирает) + "translation_ru": w.get("translation_ru") or "", + "translation_uk": w.get("translation_uk") or "", + "translation_en": w.get("translation_en") or "", }) grid_letters = level["grid_letters"]