feat(ui): add locales and split catalogs
Adds Spanish, French, Russian, Japanese, and Simplified Chinese catalogs and wires supported locales into the i18n layer.
This commit is contained in:
14
packages/ui/src/lib/i18n/messages/merge.ts
Normal file
14
packages/ui/src/lib/i18n/messages/merge.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
export function mergeMessageParts(...parts: Array<Record<string, string>>) {
|
||||
const result: Record<string, string> = {}
|
||||
|
||||
for (const part of parts) {
|
||||
for (const [key, value] of Object.entries(part)) {
|
||||
if (key in result) {
|
||||
throw new Error(`Duplicate i18n message key: ${key}`)
|
||||
}
|
||||
result[key] = value
|
||||
}
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
Reference in New Issue
Block a user