Adds Spanish, French, Russian, Japanese, and Simplified Chinese catalogs and wires supported locales into the i18n layer.
15 lines
359 B
TypeScript
15 lines
359 B
TypeScript
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
|
|
}
|