feat: support language in embedding (#2364)

This commit is contained in:
Ted Liang
2026-03-18 16:17:23 +11:00
committed by GitHub
parent f48aa84c9e
commit 5dcdac7ecd
17 changed files with 142 additions and 22 deletions
-3
View File
@@ -1,13 +1,10 @@
import type { MessageDescriptor } from '@lingui/core';
import { msg } from '@lingui/core/macro';
import { z } from 'zod';
import { SUPPORTED_LANGUAGE_CODES, type SupportedLanguageCodes } from './locales';
export * from './locales';
export const ZSupportedLanguageCodeSchema = z.enum(SUPPORTED_LANGUAGE_CODES).catch('en');
export type I18nLocaleData = {
/**
* The supported language extracted from the locale.
+4
View File
@@ -1,3 +1,5 @@
import { z } from 'zod';
export const SUPPORTED_LANGUAGE_CODES = [
'de',
'en',
@@ -19,3 +21,5 @@ export const APP_I18N_OPTIONS = {
sourceLang: 'en',
defaultLocale: 'en-US',
} as const;
export const ZSupportedLanguageCodeSchema = z.enum(SUPPORTED_LANGUAGE_CODES).catch('en');
+3
View File
@@ -1,5 +1,7 @@
import { z } from 'zod';
import { ZSupportedLanguageCodeSchema } from '@documenso/lib/constants/locales';
import { ZCssVarsSchema } from './css-vars';
export const ZBaseEmbedDataSchema = z.object({
@@ -9,4 +11,5 @@ export const ZBaseEmbedDataSchema = z.object({
.optional()
.transform((value) => value || undefined),
cssVars: ZCssVarsSchema.optional().default({}),
language: ZSupportedLanguageCodeSchema.optional(),
});