File tree Expand file tree Collapse file tree
libs/native-federation/src/utils Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,9 +9,17 @@ export type WorkspaceConfig = {
99 i18n ?: I18nConfig ;
1010} ;
1111
12+ export type LocaleTranslation = string | string [ ] ;
13+
14+ export type LocaleObject = {
15+ translation : LocaleTranslation ;
16+ baseHref ?: string ;
17+ subPath ?: string ;
18+ } ;
19+
1220export type I18nConfig = {
1321 sourceLocale : string | SourceLocaleObject ;
14- locales : Record < string , string > ;
22+ locales : Record < string , LocaleTranslation | LocaleObject > ;
1523} ;
1624
1725export type SourceLocaleObject = {
@@ -53,7 +61,8 @@ export async function translateFederationArtefacts(
5361
5462 const translationFiles = locales
5563 . map ( ( loc ) => i18n . locales [ loc ] )
56- . map ( ( value ) => JSON . stringify ( value ) )
64+ . map ( ( config ) => typeof config === 'string' || Array . isArray ( config ) ? config : config . translation )
65+ . map ( ( files ) => JSON . stringify ( files ) )
5766 . join ( ' ' ) ;
5867
5968 const targetLocales = locales . join ( ' ' ) ;
You can’t perform that action at this time.
0 commit comments