feat: default locale Russian, geo determines language for other countries

- localization-svc: defaultLocale ru, resolveLocale only by geo
- web-svc: DEFAULT_LOCALE ru, layout lang=ru, embeddedTranslations fallback ru
- countryToLocale: default ru when no country or unknown country

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
home
2026-02-23 15:10:38 +03:00
parent 8fc82a3b90
commit cd6b7857ba
606 changed files with 26148 additions and 14297 deletions

View File

@@ -0,0 +1,25 @@
import { jsonb, pgTable, text, timestamp } from 'drizzle-orm/pg-core';
/**
* Профиль пользователя: личные данные и персонализация
* user_id — из auth-svc (better-auth)
*/
export const userProfiles = pgTable('user_profiles', {
userId: text('user_id').primaryKey(),
/** Отображаемое имя (может отличаться от auth) */
displayName: text('display_name'),
/** URL аватара */
avatarUrl: text('avatar_url'),
/** Часовой пояс (IANA, напр. Europe/Moscow) */
timezone: text('timezone'),
/** Локаль (напр. ru, en-US) */
locale: text('locale'),
/** Личные данные (расширяемые): bio, links и т.п. */
profileData: jsonb('profile_data').$type<Record<string, unknown>>().default({}),
/** Preferences: theme, measureUnit, autoMediaSearch, showWeatherWidget и т.д. */
preferences: jsonb('preferences').$type<Record<string, unknown>>().default({}),
/** Персонализация: systemInstructions, responseFormat и т.д. */
personalization: jsonb('personalization').$type<Record<string, unknown>>().default({}),
createdAt: timestamp('created_at').defaultNow().notNull(),
updatedAt: timestamp('updated_at').defaultNow().notNull(),
});