feat: add i18n localization system (en/es/de) with admin panel
- Add i18n module with tForUser/tForLang/t functions and {{param}} interpolation
- Add 3 locale files: en.json, es.json, de.json (201 keys each)
- Add language selection on /start and /language command with flag emojis
- Localize all bot user-facing strings (handlers, keyboards, errors)
- Localize messageRouter keyboard matching via locale keys
- Add DB migrations 008 (language column) and 009 (language_set column)
- Add localization admin tab at /locales for editing translations
- Add userService.getUserLanguage/setUserLanguage methods
- Cache user object on msg.__user to avoid triple DB fetch
- Idempotent migrations with checkColumnExists guards
- Error boundary on i18n locale file loading
- Admin locales route uses AVAILABLE_LANGUAGES import
This commit is contained in:
@@ -27,6 +27,14 @@ if (bot && botAvailable) {
|
||||
}
|
||||
});
|
||||
|
||||
bot.onText(/\/language/, async (msg) => {
|
||||
try {
|
||||
await userHandler.handleLanguageCommand(msg);
|
||||
} catch (error) {
|
||||
await ErrorHandler.handleError(bot, msg.chat.id, error, 'language command');
|
||||
}
|
||||
});
|
||||
|
||||
bot.onText(/\/admin/, async (msg) => {
|
||||
try {
|
||||
await adminHandler.handleAdminCommand(msg);
|
||||
|
||||
Reference in New Issue
Block a user