File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
packages/design-core/src/preview/src/preview Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -134,6 +134,16 @@ const generateUtils = (list) => {
134134 return strs . join ( '\n' )
135135}
136136
137+ const compatibleI18n = ( i18n ) => {
138+ if ( ! i18n || typeof i18n !== 'object' ) {
139+ return { en_US : { } , zh_CN : { } }
140+ }
141+ i18n . en_US = i18n . en_US && typeof i18n . en_US === 'object' ? i18n . en_US : { }
142+ i18n . zh_CN = i18n . zh_CN && typeof i18n . zh_CN === 'object' ? i18n . zh_CN : { }
143+
144+ return i18n
145+ }
146+
137147/**
138148 * 处理css文件依赖
139149 * @param {* } code 源代码
@@ -145,7 +155,7 @@ export const processAppJsCode = (code, cssList) => {
145155}
146156
147157export default ( data ) => {
148- const locales = generateDefaultExport ( data . i18n )
158+ const locales = generateDefaultExport ( compatibleI18n ( data . i18n ) )
149159 const dataSource = generateDefaultExport ( data . dataSource )
150160 const stores = generateStores ( data . globalState )
151161 const bridge = generateBridge ( data . bridge )
You can’t perform that action at this time.
0 commit comments