feat: Complete localization system with i18n and DeepSeek AI translation

🌐 Interface Localization:
- Added i18next for multi-language interface support
- Created LocalizationService with language detection
- Added translation files for Russian and English
- Implemented language selection in user settings

🤖 AI Profile Translation (Premium feature):
- Integrated DeepSeek API for profile translation
- Added TranslationController for translation management
- Premium-only access to profile translation feature
- Support for 10 languages (ru, en, es, fr, de, it, pt, zh, ja, ko)

�� Database & Models:
- Added language field to users table with migration
- Updated User model to support language preferences
- Added language constraints and indexing

🎛️ User Interface:
- Added language settings menu in bot settings
- Implemented callback handlers for language selection
- Added translate profile button for VIP users
- Localized all interface strings

📚 Documentation:
- Created comprehensive LOCALIZATION.md guide
- Documented API usage and configuration
- Added examples for extending language support
This commit is contained in:
2025-09-13 08:59:10 +09:00
parent 975eb348dd
commit edddd52589
12 changed files with 992 additions and 8 deletions

101
src/locales/en.json Normal file
View File

@@ -0,0 +1,101 @@
{
"welcome": {
"greeting": "Welcome to Telegram Tinder Bot! 💕",
"description": "Find your soulmate right here!",
"getStarted": "Get Started"
},
"profile": {
"create": "Create Profile",
"edit": "Edit Profile",
"view": "View Profile",
"name": "Name",
"age": "Age",
"city": "City",
"bio": "About",
"photos": "Photos",
"gender": "Gender",
"lookingFor": "Looking for",
"datingGoal": "Dating Goal",
"hobbies": "Hobbies",
"lifestyle": "Lifestyle",
"male": "Male",
"female": "Female",
"both": "Both",
"relationship": "Relationship",
"friendship": "Friendship",
"dating": "Dating",
"hookup": "Hookup",
"marriage": "Marriage",
"networking": "Networking",
"travel": "Travel",
"business": "Business",
"other": "Other"
},
"search": {
"title": "Browse Profiles",
"noProfiles": "No more profiles! Try again later.",
"like": "❤️ Like",
"dislike": "👎 Pass",
"superLike": "⭐ Super Like",
"match": "It's a match! 🎉"
},
"vip": {
"title": "VIP Search",
"premiumRequired": "This feature is available for premium users only",
"filters": "Filters",
"ageRange": "Age Range",
"cityFilter": "City",
"datingGoalFilter": "Dating Goal",
"hobbiesFilter": "Hobbies",
"lifestyleFilter": "Lifestyle",
"applyFilters": "Apply Filters",
"clearFilters": "Clear Filters",
"noResults": "No profiles found with your filters",
"translateProfile": "🌐 Translate Profile"
},
"premium": {
"title": "Premium Subscription",
"features": "Premium features:",
"vipSearch": "• VIP search with filters",
"profileTranslation": "• Profile translation to your language",
"unlimitedLikes": "• Unlimited likes",
"superLikes": "• Extra super likes",
"price": "Price: $4.99/month",
"activate": "Activate Premium"
},
"translation": {
"translating": "Translating profile...",
"translated": "Profile translated:",
"error": "Translation error. Please try again later.",
"premiumOnly": "Translation is available for premium users only"
},
"commands": {
"start": "Main Menu",
"profile": "My Profile",
"search": "Browse",
"vip": "VIP Search",
"matches": "Matches",
"premium": "Premium",
"settings": "Settings",
"help": "Help"
},
"buttons": {
"back": "« Back",
"next": "Next »",
"save": "Save",
"cancel": "Cancel",
"confirm": "Confirm",
"edit": "Edit",
"delete": "Delete",
"yes": "Yes",
"no": "No"
},
"errors": {
"profileNotFound": "Profile not found",
"profileIncomplete": "Please complete your profile",
"ageInvalid": "Please enter a valid age (18-100)",
"photoRequired": "Please add at least one photo",
"networkError": "Network error. Please try again later.",
"serverError": "Server error. Please try again later."
}
}

101
src/locales/ru.json Normal file
View File

@@ -0,0 +1,101 @@
{
"welcome": {
"greeting": "Добро пожаловать в Telegram Tinder Bot! 💕",
"description": "Найди свою вторую половинку прямо здесь!",
"getStarted": "Начать знакомство"
},
"profile": {
"create": "Создать анкету",
"edit": "Редактировать анкету",
"view": "Посмотреть анкету",
"name": "Имя",
"age": "Возраст",
"city": "Город",
"bio": "О себе",
"photos": "Фотографии",
"gender": "Пол",
"lookingFor": "Ищу",
"datingGoal": "Цель знакомства",
"hobbies": "Хобби",
"lifestyle": "Образ жизни",
"male": "Мужской",
"female": "Женский",
"both": "Не важно",
"relationship": "Серьезные отношения",
"friendship": "Дружба",
"dating": "Свидания",
"hookup": "Интрижка",
"marriage": "Брак",
"networking": "Общение",
"travel": "Путешествия",
"business": "Бизнес",
"other": "Другое"
},
"search": {
"title": "Поиск анкет",
"noProfiles": "Анкеты закончились! Попробуйте позже.",
"like": "❤️ Нравится",
"dislike": "👎 Не нравится",
"superLike": "⭐ Супер лайк",
"match": "Это взаимность! 🎉"
},
"vip": {
"title": "VIP Поиск",
"premiumRequired": "Функция доступна только для премиум пользователей",
"filters": "Фильтры",
"ageRange": "Возрастной диапазон",
"cityFilter": "Город",
"datingGoalFilter": "Цель знакомства",
"hobbiesFilter": "Хобби",
"lifestyleFilter": "Образ жизни",
"applyFilters": "Применить фильтры",
"clearFilters": "Очистить фильтры",
"noResults": "По вашим фильтрам никого не найдено",
"translateProfile": "🌐 Перевести анкету"
},
"premium": {
"title": "Премиум подписка",
"features": "Возможности премиум:",
"vipSearch": "• VIP поиск с фильтрами",
"profileTranslation": "• Перевод анкет на ваш язык",
"unlimitedLikes": "• Безлимитные лайки",
"superLikes": "• Дополнительные супер-лайки",
"price": "Стоимость: 299₽/месяц",
"activate": "Активировать премиум"
},
"translation": {
"translating": "Переводим анкету...",
"translated": "Анкета переведена:",
"error": "Ошибка перевода. Попробуйте позже.",
"premiumOnly": "Перевод доступен только для премиум пользователей"
},
"commands": {
"start": "Главное меню",
"profile": "Моя анкета",
"search": "Поиск",
"vip": "VIP поиск",
"matches": "Взаимности",
"premium": "Премиум",
"settings": "Настройки",
"help": "Помощь"
},
"buttons": {
"back": "« Назад",
"next": "Далее »",
"save": "Сохранить",
"cancel": "Отмена",
"confirm": "Подтвердить",
"edit": "Редактировать",
"delete": "Удалить",
"yes": "Да",
"no": "Нет"
},
"errors": {
"profileNotFound": "Анкета не найдена",
"profileIncomplete": "Заполните анкету полностью",
"ageInvalid": "Введите корректный возраст (18-100)",
"photoRequired": "Добавьте хотя бы одну фотографию",
"networkError": "Ошибка сети. Попробуйте позже.",
"serverError": "Ошибка сервера. Попробуйте позже."
}
}