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:
@@ -17,6 +17,7 @@ import categoriesRouter from './routes/categories.js';
|
||||
import paymentWalletsRouter from './routes/paymentWallets.js';
|
||||
import locationsRouter from './routes/locations.js';
|
||||
import seedRouter from './routes/seed.js';
|
||||
import localesRouter from './routes/locales.js';
|
||||
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||
const app = express();
|
||||
@@ -52,6 +53,7 @@ app.use('/categories', categoriesRouter);
|
||||
app.use('/locations', locationsRouter);
|
||||
app.use('/payment-wallets', paymentWalletsRouter);
|
||||
app.use('/seed', seedRouter);
|
||||
app.use('/locales', localesRouter);
|
||||
|
||||
export function startAdminPanel() {
|
||||
const port = parseInt(process.env.ADMIN_PORT || '3001', 10);
|
||||
|
||||
Reference in New Issue
Block a user