import { PartialDeep } from 'type-fest' ; import { ComponentLocale , ComponentStrings } from '..' ; import en_US from './en-US/strings.json' ; import en_GB from './en-GB/strings.json' ; import de_DE from './de-DE/strings.json' ; import es_ES from './es-ES/strings.json' ; import fr_FR from './fr-FR/strings.json' ; import it_IT from './it-IT/strings.json' ; import ja_JP from './ja-JP/strings.json' ; import ko_KR from './ko-KR/strings.json' ; import nl_NL from './nl-NL/strings.json' ; import pt_BR from './pt-BR/strings.json' ; import ru_RU from './ru-RU/strings.json' ; import tr_TR from './tr-TR/strings.json' ; import zh_CN from './zh-CN/strings.json' ; import zh_TW from './zh-TW/strings.json' ; const createComponentStrings = ( localizedStrings ) : ComponentStrings => { const strings = { ... en_US } ; Object . keys ( localizedStrings ) . forEach ( ( key ) => { strings [ key ] = { ... strings [ key ] , ... localizedStrings [ key ] } ; } ) ; return strings ; } ; public export const COMPONENT_LOCALE_EN_US = { strings : en_US } ; public export const COMPONENT_LOCALE_EN_GB = { strings : createComponentStrings ( en_GB ) } ; public export const COMPONENT_LOCALE_DE_DE = { strings : createComponentStrings ( de_DE ) } ; public export const COMPONENT_LOCALE_ES_ES = { strings : createComponentStrings ( es_ES ) } ; public export const COMPONENT_LOCALE_FR_FR = { strings : createComponentStrings ( fr_FR ) } ; public export const COMPONENT_LOCALE_IT_IT = { strings : createComponentStrings ( it_IT ) } ; public export const COMPONENT_LOCALE_JA_JP = { strings : createComponentStrings ( ja_JP ) } ; public export const COMPONENT_LOCALE_KO_KR = { strings : createComponentStrings ( ko_KR ) } ; public export const COMPONENT_LOCALE_NL_NL = { strings : createComponentStrings ( nl_NL ) } ; public export const COMPONENT_LOCALE_PT_BR = { strings : createComponentStrings ( pt_BR ) } ; public export const COMPONENT_LOCALE_RU_RU = { strings : createComponentStrings ( ru_RU ) } ; public export const COMPONENT_LOCALE_TR_TR = { strings : createComponentStrings ( tr_TR ) } ; public export const COMPONENT_LOCALE_ZH_CN = { strings : createComponentStrings ( zh_CN ) } ; public export const COMPONENT_LOCALE_ZH_TW = { strings : createComponentStrings ( zh_TW ) } ;