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

View File

@@ -5,6 +5,7 @@ export interface UserData {
firstName?: string;
lastName?: string;
languageCode?: string;
language?: string; // Предпочитаемый язык интерфейса
isActive: boolean;
createdAt: Date;
lastActiveAt: Date;
@@ -17,6 +18,7 @@ export class User {
firstName?: string;
lastName?: string;
languageCode?: string;
language: string; // Предпочитаемый язык интерфейса
isActive: boolean;
createdAt: Date;
lastActiveAt: Date;
@@ -28,6 +30,7 @@ export class User {
this.firstName = data.firstName;
this.lastName = data.lastName;
this.languageCode = data.languageCode || 'en';
this.language = data.language || 'ru'; // Язык интерфейса по умолчанию
this.isActive = data.isActive;
this.createdAt = data.createdAt;
this.lastActiveAt = data.lastActiveAt;
@@ -67,4 +70,14 @@ export class User {
this.isActive = true;
this.updateLastActive();
}
// Установить язык интерфейса
setLanguage(language: string): void {
this.language = language;
}
// Получить язык интерфейса
getLanguage(): string {
return this.language;
}
}