File tree Expand file tree Collapse file tree 2 files changed +17
-3
lines changed
libs/native-federation/src Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -155,10 +155,15 @@ export async function* runBuilder(
155
155
156
156
const localeFilter = getLocaleFilter ( options , runServer ) ;
157
157
158
+ const sourceLocaleSegment =
159
+ typeof i18n ?. sourceLocale === 'string'
160
+ ? i18n . sourceLocale
161
+ : i18n ?. sourceLocale ?. subPath || i18n ?. sourceLocale ?. code || '' ;
162
+
158
163
const browserOutputPath = path . join (
159
164
outputOptions . base ,
160
165
outputOptions . browser ,
161
- options . localize ? i18n ?. sourceLocale || '' : ''
166
+ options . localize ? sourceLocaleSegment : ''
162
167
) ;
163
168
164
169
const differentDevServerOutputPath =
Original file line number Diff line number Diff line change @@ -10,10 +10,16 @@ export type WorkspaceConfig = {
10
10
} ;
11
11
12
12
export type I18nConfig = {
13
- sourceLocale : string ;
13
+ sourceLocale : string | SourceLocaleObject ;
14
14
locales : Record < string , string > ;
15
15
} ;
16
16
17
+ export type SourceLocaleObject = {
18
+ code : string ;
19
+ baseHref ?: string ;
20
+ subPath ?: string ;
21
+ } ;
22
+
17
23
export async function getI18nConfig (
18
24
context : BuilderContext
19
25
) : Promise < I18nConfig | undefined > {
@@ -52,7 +58,10 @@ export async function translateFederationArtefacts(
52
58
53
59
const targetLocales = locales . join ( ' ' ) ;
54
60
55
- const sourceLocale = i18n . sourceLocale ;
61
+ const sourceLocale =
62
+ typeof i18n . sourceLocale === 'string'
63
+ ? i18n . sourceLocale
64
+ : i18n . sourceLocale . code ;
56
65
57
66
const translationOutPath = path . join ( outputPath , 'browser' , '{{LOCALE}}' ) ;
58
67
You can’t perform that action at this time.
0 commit comments