feat(i18n): implement new locale resolution logic and service layer

This commit is contained in:
poyrazavsever
2026-07-20 10:25:40 +03:00
parent 9365dfd215
commit 7805a9a19a
9 changed files with 384 additions and 118 deletions
+8
View File
@@ -6,6 +6,7 @@ import {
instanceLocales,
portalInvitations,
userPreferences,
contentTranslations,
} from "../db/schema";
import type { DomainDatabase } from "../domain/database";
@@ -148,6 +149,13 @@ export function createI18nRepository(db: DomainDatabase) {
.where(eq(portalInvitations.locale, code))
.get()?.count ?? 0,
),
contentTranslations: Number(
db
.select({ count: sql<number>`count(*)` })
.from(contentTranslations)
.where(eq(contentTranslations.locale, code))
.get()?.count ?? 0,
),
}),
};
}