feat(i18n): implement new locale resolution logic and service layer
This commit is contained in:
@@ -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,
|
||||
),
|
||||
}),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user