Skip to content

Commit

Permalink
Add zh fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
khmyznikov committed Oct 10, 2024
1 parent 6d9532d commit 08fe51e
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 10 deletions.
2 changes: 1 addition & 1 deletion dist/pwa-install.bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/pwa-install.bundle.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/pwa-install.es.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/pwa-install.es.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/react-legacy/pwa-install.react-legacy.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/react-legacy/pwa-install.react-legacy.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/umd/pwa-install.umd.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/umd/pwa-install.umd.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/pwa-install.bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/service-worker.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions src/localization/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,16 @@ export const changeLocale = (lang: string) => {
break;
}

// Fallback to simplified Chinese
switch (lang) {
case 'zh':
case 'zh-TW':
lang = 'zh-CN';
break;
default:
break;
}

try {
if (localizedTemplates.get(lang))
setLocale(lang);
Expand Down

0 comments on commit 08fe51e

Please sign in to comment.