Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

Commit

Permalink
Add chinese language option (#1072)
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinavkgrd committed Apr 20, 2023
2 parents 7f23003 + eb92fb6 commit 529d57d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/components/Sidebar/Preferences/LanguageSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ const getLocaleDisplayName = (l: Language) => {
return 'English';
case Language.fr:
return 'Français';
case Language.zh:
return '中文';
}
};

Expand Down
1 change: 1 addition & 0 deletions src/components/Upload/UploadButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ function UploadButton({
cursor: !uploadManager.shouldAllowNewUpload() && 'not-allowed',
}}>
<Button
sx={{ whiteSpace: 'nowrap' }}
onClick={onClickHandler}
disabled={!uploadManager.shouldAllowNewUpload()}
className="desktop-button"
Expand Down
1 change: 1 addition & 0 deletions src/constants/locale/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
export enum Language {
en = 'en',
fr = 'fr',
zh = 'zh',
}
5 changes: 3 additions & 2 deletions src/utils/i18n/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ export function getBestPossibleUserLocale(): Language {
for (const lc of userLocales) {
if (lc.startsWith('en')) {
return Language.en;
}
if (lc.startsWith('fr')) {
} else if (lc.startsWith('fr')) {
return Language.fr;
} else if (lc.startsWith('zh')) {
return Language.zh;
}
}
return Language.en;
Expand Down

0 comments on commit 529d57d

Please sign in to comment.