Skip to content

Commit

Permalink
feat: suport more locale config
Browse files Browse the repository at this point in the history
  • Loading branch information
liujuping authored and JackLian committed Sep 26, 2023
1 parent 7a40aff commit 4728484
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/react-simulator-renderer/src/locale/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ const instance: Record<string, Record<string, string>> = {

export function createIntl(locale: string = 'zh-CN') {
const intl = (id: string) => {
return instance[locale][id];
return instance[locale]?.[id] || id;
};

const intlNode = (id: string) => createElement('span', instance[locale][id]);
const intlNode = (id: string) => createElement('span', instance[locale]?.[id] || id);

return {
intl,
Expand Down

0 comments on commit 4728484

Please sign in to comment.