Skip to content

Commit

Permalink
support hebrew
Browse files Browse the repository at this point in the history
  • Loading branch information
Pylogmon committed Sep 17, 2024
1 parent e015ab0 commit 8c95a6d
Show file tree
Hide file tree
Showing 26 changed files with 58 additions and 8 deletions.
1 change: 1 addition & 0 deletions src-tauri/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ pub fn check_service_available() -> Result<(), Error> {
"cambridge_dict",
"chatglm",
"deepl",
"ecdict",
"geminipro",
"niutrans",
"ollama",
Expand Down
4 changes: 4 additions & 0 deletions src/i18n/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import nb_NO from './locales/nb_NO.json';
import nn_NO from './locales/nn_NO.json';
import fa_IR from './locales/fa_IR.json';
import uk_UA from './locales/uk_UA.json';
import ar_AE from './locales/ar_AE.json';
import he_IL from './locales/he_IL.json';

// http://www.lingoes.net/zh/translator/langcode.htm

Expand Down Expand Up @@ -52,6 +54,8 @@ i18n.use(initReactI18next).init({
nn_no: nn_NO,
fa: fa_IR,
uk: uk_UA,
ar: ar_AE,
he: he_IL,
},
});

Expand Down
File renamed without changes.
5 changes: 3 additions & 2 deletions src/i18n/locales/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
"sv": "Swedish",
"pl": "Polish",
"nl": "Dutch",
"uk": "Ukrainian"
"uk": "Ukrainian",
"he": "Hebrew"
},
"config": {
"general": {
Expand Down Expand Up @@ -465,4 +466,4 @@
"delete_space": "Delete Space"
}
}
}
}
5 changes: 3 additions & 2 deletions src/i18n/locales/he.json → src/i18n/locales/he_IL.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
"sv": "שוודית",
"pl": "פולנית",
"nl": "הולנדית",
"tr": "טורקית"
"tr": "טורקית",
"he": "עברית"
},
"config": {
"general": {
Expand Down Expand Up @@ -312,4 +313,4 @@
"copy_text": "העתק"
}
}
}
}
5 changes: 3 additions & 2 deletions src/i18n/locales/zh_CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
"sv": "瑞典语",
"pl": "波兰语",
"nl": "荷兰语",
"uk": "乌克兰语"
"uk": "乌克兰语",
"he": "希伯来语"
},
"config": {
"general": {
Expand Down Expand Up @@ -465,4 +466,4 @@
"delete_space": "删除空格"
}
}
}
}
5 changes: 3 additions & 2 deletions src/i18n/locales/zh_TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
"pl": "波蘭語",
"nl": "荷蘭語",
"fa": "波斯語",
"uk": "烏克蘭語"
"uk": "烏克蘭語",
"he": "希伯來語"
},
"config": {
"general": {
Expand Down Expand Up @@ -461,4 +462,4 @@
"delete_space": "刪除空格"
}
}
}
}
6 changes: 6 additions & 0 deletions src/services/recognize/system/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ export async function recognize(_, lang) {
ms: 'msa',
ar: 'ara',
hi: 'hin',
uk: 'ukr',
he: 'heb',
};
const windowsLangMap = {
auto: 'auto',
Expand All @@ -49,6 +51,8 @@ export async function recognize(_, lang) {
ms: 'ms-MY',
ar: 'ar-SA',
hi: 'hi-IN',
uk: 'uk-UA',
he: 'he-IL',
};
const macOSLangMap = {
auto: 'auto',
Expand All @@ -72,6 +76,8 @@ export async function recognize(_, lang) {
ms: 'ms-MY',
ar: 'ar-SA',
hi: 'hi-IN',
uk: 'uk-UA',
he: 'he-IL',
};
let result = '';
switch (osType) {
Expand Down
2 changes: 2 additions & 0 deletions src/services/recognize/system/info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,6 @@ export enum Language {
ms = 'ms',
ar = 'ar',
hi = 'hi',
uk = 'uk',
he = 'he',
}
2 changes: 2 additions & 0 deletions src/services/recognize/tesseract/info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ export enum Language {
ms = 'msa',
ar = 'ara',
hi = 'hin',
uk = 'ukr',
he = 'heb',
}
1 change: 1 addition & 0 deletions src/services/translate/alibaba/info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ export enum Language {
sv = 'sv',
pl = 'pl',
nl = 'nl',
he = 'he',
}
1 change: 1 addition & 0 deletions src/services/translate/baidu/info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ export enum Language {
pl = 'pl',
nl = 'nl',
uk = 'ukr',
he = 'heb',
}
1 change: 1 addition & 0 deletions src/services/translate/baidu_field/info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ export enum Language {
pl = 'pl',
nl = 'nl',
uk = 'ukr',
he = 'heb',
}
1 change: 1 addition & 0 deletions src/services/translate/bing/info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ export enum Language {
pl = 'pl',
nl = 'nl',
uk = 'uk',
he = 'he',
}
1 change: 1 addition & 0 deletions src/services/translate/chatglm/info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ export enum Language {
pl = 'Polish',
nl = 'Dutch',
uk = 'Ukrainian',
he = 'Hebrew',
}
1 change: 1 addition & 0 deletions src/services/translate/geminipro/info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ export enum Language {
pl = 'Polish',
nl = 'Dutch',
uk = 'Ukrainian',
he = 'Hebrew',
}
1 change: 1 addition & 0 deletions src/services/translate/google/info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ export enum Language {
pl = 'pl',
nl = 'nl',
uk = 'uk',
he = 'he',
}
1 change: 1 addition & 0 deletions src/services/translate/niutrans/info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ export enum Language {
pl = 'pl',
nl = 'nl',
uk = 'uk',
he = 'he',
}
1 change: 1 addition & 0 deletions src/services/translate/ollama/info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ export enum Language {
pl = 'Polish',
nl = 'Dutch',
uk = 'Ukrainian',
he = 'Hebrew',
}
1 change: 1 addition & 0 deletions src/services/translate/openai/info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ export enum Language {
pl = 'Polish',
nl = 'Dutch',
uk = 'Ukrainian',
he = 'Hebrew',
}
1 change: 1 addition & 0 deletions src/services/translate/volcengine/info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ export enum Language {
pl = 'pl',
nl = 'nl',
uk = 'uk',
he = 'he',
}
1 change: 1 addition & 0 deletions src/services/translate/yandex/info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ export enum Language {
pl = 'pl',
nl = 'nl',
uk = 'uk',
he = 'he',
}
1 change: 1 addition & 0 deletions src/services/translate/youdao/info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ export enum Language {
pl = 'pl',
nl = 'nl',
uk = 'uk',
he = 'he',
}
2 changes: 2 additions & 0 deletions src/services/tts/lingva/info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,6 @@ export enum Language {
sv = 'sv',
pl = 'pl',
nl = 'nl',
uk = 'uk',
he = 'he',
}
2 changes: 2 additions & 0 deletions src/utils/language.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export const languageList = [
'pl',
'nl',
'uk',
'he',
];

// https://flagicons.lipis.dev/
Expand Down Expand Up @@ -63,4 +64,5 @@ export enum LanguageFlag {
pl = 'pl',
nl = 'nl',
uk = 'ua',
he = 'il',
}
14 changes: 14 additions & 0 deletions src/window/Config/pages/General/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ export default function General() {
nn_no: 'Norsk Nynorsk',
fa: 'فارسی',
uk: 'Українська',
ar: 'العربية',
he: 'עִבְרִית',
};

useEffect(() => {
Expand Down Expand Up @@ -270,6 +272,18 @@ export default function General() {
>
Українська
</DropdownItem>
<DropdownItem
key='ar'
startContent={<span className={`fi fi-${LanguageFlag.ar}`} />}
>
العربية
</DropdownItem>
<DropdownItem
key='he'
startContent={<span className={`fi fi-${LanguageFlag.he}`} />}
>
עִבְרִית
</DropdownItem>
</DropdownMenu>
</Dropdown>
)}
Expand Down

0 comments on commit 8c95a6d

Please sign in to comment.