Skip to content

Commit bf15231

Browse files
committed
3.0.5
1 parent 07b78b9 commit bf15231

File tree

13 files changed

+96
-5
lines changed

13 files changed

+96
-5
lines changed

CHANGELOG

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## 3.0.4 (2024-06-26)
1+
## 3.0.5 (2024-06-27)
22

33
### Break Change:
44

@@ -10,6 +10,7 @@
1010
- support multiple instance service
1111
- use javascript plugin system
1212
- enable dev tools
13+
- add database api for plugin
1314

1415
### Bugs fixed:
1516

com.pot_app.pot.metainfo.xml

+24
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,30 @@
5353
</screenshot>
5454
</screenshots>
5555
<releases>
56+
<release version="3.0.5" date="2024-06-27">
57+
<url type="details">https://github.com/pot-app/pot-desktop/releases/tag/3.0.5</url>
58+
<description>
59+
<p>Break Change:</p>
60+
<ul>
61+
<li>After version 3.x, old plugins will no longer be available. They will be automatically deleted upon upgrade. Please visit the plugin repository to download and install the new versions. If the plugin developers have not yet updated their plugins, please contact them to request an upgrade.</li>
62+
<li xml:lang="zh-Hans">3.x版本之后旧版插件不再可用,升级后会自动删除旧版插件,请前往插件仓库下载安装新版插件使用,若插件开发者还没适配新版插件,请联系插件开发者升级插件。</li>
63+
</ul>
64+
<p>New feature:</p>
65+
<ul>
66+
<li>Support multiple instance services</li>
67+
<li>Use Javascript plugin system</li>
68+
<li>Enable dev tools</li>
69+
<li>Add Database api for plugin</li>
70+
</ul>
71+
<p>Bugs fixed:</p>
72+
<ul>
73+
<li>Recognize failed</li>
74+
<li>TTS failed</li>
75+
<li>Collection failed</li>
76+
<li>Default Lingva error</li>
77+
</ul>
78+
</description>
79+
</release>
5680
<release version="3.0.4" date="2024-06-26">
5781
<url type="details">https://github.com/pot-app/pot-desktop/releases/tag/3.0.4</url>
5882
<description>

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "pot",
33
"private": true,
4-
"version": "3.0.4",
4+
"version": "3.0.5",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",

public/logo/ecdict.svg

+1
Loading

src-tauri/tauri.conf.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
},
99
"package": {
1010
"productName": "pot",
11-
"version": "3.0.4"
11+
"version": "3.0.5"
1212
},
1313
"tauri": {
1414
"allowlist": {

src/i18n/locales/en_US.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,9 @@
292292
"yandex": {
293293
"title": "Yandex"
294294
},
295+
"ecdict": {
296+
"title": "ECDict(Online)"
297+
},
295298
"transmart": {
296299
"title": "TranSmart",
297300
"username": "User Name",
@@ -462,4 +465,4 @@
462465
"delete_space": "Delete Space"
463466
}
464467
}
465-
}
468+
}

src/i18n/locales/zh_CN.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,9 @@
292292
"yandex": {
293293
"title": "Yandex"
294294
},
295+
"ecdict": {
296+
"title": "ECDict(在线)"
297+
},
295298
"transmart": {
296299
"title": "腾讯交互翻译",
297300
"username": "用户名",
@@ -462,4 +465,4 @@
462465
"delete_space": "删除空格"
463466
}
464467
}
465-
}
468+
}
+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { useTranslation } from 'react-i18next';
2+
import { Button } from '@nextui-org/react';
3+
import React from 'react';
4+
5+
export function Config(props) {
6+
const { updateServiceList, onClose } = props;
7+
const { t } = useTranslation();
8+
9+
return (
10+
<>
11+
<div>{t('services.no_need')}</div>
12+
<div>
13+
<Button
14+
fullWidth
15+
color='primary'
16+
onPress={() => {
17+
updateServiceList('ecdict');
18+
onClose();
19+
}}
20+
>
21+
{t('common.save')}
22+
</Button>
23+
</div>
24+
</>
25+
);
26+
}
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { fetch, Body } from '@tauri-apps/api/http';
2+
3+
export async function translate(text, _from, _to) {
4+
const res = await fetch(`https://pot-app.com/api/dict`, {
5+
method: 'POST',
6+
body: Body.json({ text }),
7+
});
8+
9+
if (res.ok) {
10+
let result = res.data;
11+
return result;
12+
} else {
13+
throw `Http Request Error\nHttp Status: ${res.status}\n${JSON.stringify(res.data)}`;
14+
}
15+
}
16+
17+
export * from './Config';
18+
export * from './info';

src/services/translate/ecdict/info.ts

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export const info = {
2+
name: 'ecdict',
3+
icon: 'logo/ecdict.svg',
4+
};
5+
6+
export enum Language {
7+
auto = '',
8+
zh_cn = 'zh',
9+
zh_tw = 'zh',
10+
en = 'en',
11+
}

src/services/translate/index.jsx

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import * as _caiyun from './caiyun';
1717
import * as _chatglm from './chatglm';
1818
import * as _geminipro from './geminipro';
1919
import * as _ollama from './ollama';
20+
import * as _ecdict from './ecdict';
2021

2122
export const deepl = _deepl;
2223
export const bing = _bing;
@@ -37,3 +38,4 @@ export const caiyun = _caiyun;
3738
export const chatglm = _chatglm;
3839
export const geminipro = _geminipro;
3940
export const ollama = _ollama;
41+
export const ecdict = _ecdict;

src/window/Config/pages/Service/Translate/index.jsx

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export default function Translate(props) {
2828
'bing',
2929
'yandex',
3030
'google',
31+
'ecdict',
3132
]);
3233

3334
const { t } = useTranslation();

src/window/Translate/index.jsx

+1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ export default function Translate() {
7373
'bing',
7474
'yandex',
7575
'google',
76+
'ecdict',
7677
]);
7778
const [recognizeServiceInstanceList] = useConfig('recognize_service_list', ['system', 'tesseract']);
7879
const [ttsServiceInstanceList] = useConfig('tts_service_list', ['lingva_tts']);

0 commit comments

Comments
 (0)