feat: multiple translations with context, improved task examples

- Add WordTranslation model for storing multiple translations per word
- AI generates translations with example sentences and their translations
- Show example usage after answering tasks (learning + interface language)
- Save translations to word_translations table when adding words from tasks
- Improve word exclusion in new_words mode (stronger prompt + client filtering)
- Add migration for word_translations table

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-12-06 21:29:41 +03:00
parent 63e2615243
commit d937b37a3b
10 changed files with 543 additions and 30 deletions

View File

@@ -58,6 +58,7 @@
"prompt": "Send the word you want to add:\nFor example: <code>/add elephant</code>\n\nOr just send the word without a command!",
"searching": "⏳ Looking up translation and examples...",
"examples_header": "<b>Examples:</b>",
"translations_header": "<b>Translations:</b>",
"translation_label": "Translation",
"category_label": "Category",
"level_label": "Level",
@@ -132,6 +133,7 @@
"add_word_btn": " Add word",
"word_added": "✅ Word '{word}' added to vocabulary!",
"word_already_exists": "Word '{word}' is already in vocabulary",
"example_label": "Example",
"cancelled": "Cancelled. You can return to tasks with /task.",
"finish_title": "{emoji} <b>Task finished!</b>",
"correct_of": "Correct answers: <b>{correct}</b> of {total}",

View File

@@ -58,6 +58,7 @@
"prompt": "追加したい単語を送ってください:\n例: <code>/add elephant</code>\n\nコマンドなしで単語だけ送ってもOKです",
"searching": "⏳ 翻訳と例を検索中...",
"examples_header": "<b>例文:</b>",
"translations_header": "<b>翻訳:</b>",
"translation_label": "翻訳",
"category_label": "カテゴリー",
"level_label": "レベル",
@@ -124,6 +125,7 @@
"add_word_btn": " 単語を追加",
"word_added": "✅ 単語 '{word}' を単語帳に追加しました!",
"word_already_exists": "単語 '{word}' はすでに単語帳にあります",
"example_label": "例文",
"cancelled": "キャンセルしました。/task で課題に戻れます。",
"finish_title": "{emoji} <b>課題が終了しました!</b>",
"correct_of": "正解数: <b>{correct}</b> / {total}",

View File

@@ -58,6 +58,7 @@
"prompt": "Отправь слово, которое хочешь добавить:\nНапример: <code>/add elephant</code>\n\nИли просто отправь слово без команды!",
"searching": "⏳ Ищу перевод и примеры...",
"examples_header": "<b>Примеры:</b>",
"translations_header": "<b>Переводы:</b>",
"translation_label": "Перевод",
"category_label": "Категория",
"level_label": "Уровень",
@@ -132,6 +133,7 @@
"add_word_btn": " Добавить слово",
"word_added": "✅ Слово '{word}' добавлено в словарь!",
"word_already_exists": "Слово '{word}' уже в словаре",
"example_label": "Пример",
"cancelled": "Отменено. Можешь вернуться к заданиям командой /task.",
"finish_title": "{emoji} <b>Задание завершено!</b>",
"correct_of": "Правильных ответов: <b>{correct}</b> из {total}",