Skip to content

Commit

Permalink
fix: fix review
Browse files Browse the repository at this point in the history
  • Loading branch information
lichunn committed Nov 26, 2024
1 parent 30178dc commit b5a559b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/design-core/src/preview/src/preview/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,11 @@ const generateUtils = (list) => {
}

const compatibleI18n = (i18n) => {
i18n.en_US = i18n.en_US ? i18n.en_US : {}
i18n.zh_CN = i18n.zh_CN ? i18n.zh_CN : {}
if (!i18n || typeof i18n !== 'object') {
return { en_US: {}, zh_CN: {} }
}
i18n.en_US = i18n.en_US && typeof i18n.en_US === 'object' ? i18n.en_US : {}
i18n.zh_CN = i18n.zh_CN && typeof i18n.zh_CN === 'object' ? i18n.zh_CN : {}

return i18n
}
Expand Down

0 comments on commit b5a559b

Please sign in to comment.