Skip to content

Commit

Permalink
3.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Pylogmon committed Jun 27, 2024
1 parent 07b78b9 commit bf15231
Show file tree
Hide file tree
Showing 13 changed files with 96 additions and 5 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 3.0.4 (2024-06-26)
## 3.0.5 (2024-06-27)

### Break Change:

Expand All @@ -10,6 +10,7 @@
- support multiple instance service
- use javascript plugin system
- enable dev tools
- add database api for plugin

### Bugs fixed:

Expand Down
24 changes: 24 additions & 0 deletions com.pot_app.pot.metainfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,30 @@
</screenshot>
</screenshots>
<releases>
<release version="3.0.5" date="2024-06-27">
<url type="details">https://github.com/pot-app/pot-desktop/releases/tag/3.0.5</url>
<description>
<p>Break Change:</p>
<ul>
<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>
<li xml:lang="zh-Hans">3.x版本之后旧版插件不再可用,升级后会自动删除旧版插件,请前往插件仓库下载安装新版插件使用,若插件开发者还没适配新版插件,请联系插件开发者升级插件。</li>
</ul>
<p>New feature:</p>
<ul>
<li>Support multiple instance services</li>
<li>Use Javascript plugin system</li>
<li>Enable dev tools</li>
<li>Add Database api for plugin</li>
</ul>
<p>Bugs fixed:</p>
<ul>
<li>Recognize failed</li>
<li>TTS failed</li>
<li>Collection failed</li>
<li>Default Lingva error</li>
</ul>
</description>
</release>
<release version="3.0.4" date="2024-06-26">
<url type="details">https://github.com/pot-app/pot-desktop/releases/tag/3.0.4</url>
<description>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "pot",
"private": true,
"version": "3.0.4",
"version": "3.0.5",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
1 change: 1 addition & 0 deletions public/logo/ecdict.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"package": {
"productName": "pot",
"version": "3.0.4"
"version": "3.0.5"
},
"tauri": {
"allowlist": {
Expand Down
5 changes: 4 additions & 1 deletion src/i18n/locales/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,9 @@
"yandex": {
"title": "Yandex"
},
"ecdict": {
"title": "ECDict(Online)"
},
"transmart": {
"title": "TranSmart",
"username": "User Name",
Expand Down Expand Up @@ -462,4 +465,4 @@
"delete_space": "Delete Space"
}
}
}
}
5 changes: 4 additions & 1 deletion src/i18n/locales/zh_CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,9 @@
"yandex": {
"title": "Yandex"
},
"ecdict": {
"title": "ECDict(在线)"
},
"transmart": {
"title": "腾讯交互翻译",
"username": "用户名",
Expand Down Expand Up @@ -462,4 +465,4 @@
"delete_space": "删除空格"
}
}
}
}
26 changes: 26 additions & 0 deletions src/services/translate/ecdict/Config.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { useTranslation } from 'react-i18next';
import { Button } from '@nextui-org/react';
import React from 'react';

export function Config(props) {
const { updateServiceList, onClose } = props;
const { t } = useTranslation();

return (
<>
<div>{t('services.no_need')}</div>
<div>
<Button
fullWidth
color='primary'
onPress={() => {
updateServiceList('ecdict');
onClose();
}}
>
{t('common.save')}
</Button>
</div>
</>
);
}
18 changes: 18 additions & 0 deletions src/services/translate/ecdict/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { fetch, Body } from '@tauri-apps/api/http';

export async function translate(text, _from, _to) {
const res = await fetch(`https://pot-app.com/api/dict`, {
method: 'POST',
body: Body.json({ text }),
});

if (res.ok) {
let result = res.data;
return result;
} else {
throw `Http Request Error\nHttp Status: ${res.status}\n${JSON.stringify(res.data)}`;
}
}

export * from './Config';
export * from './info';
11 changes: 11 additions & 0 deletions src/services/translate/ecdict/info.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export const info = {
name: 'ecdict',
icon: 'logo/ecdict.svg',
};

export enum Language {
auto = '',
zh_cn = 'zh',
zh_tw = 'zh',
en = 'en',
}
2 changes: 2 additions & 0 deletions src/services/translate/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import * as _caiyun from './caiyun';
import * as _chatglm from './chatglm';
import * as _geminipro from './geminipro';
import * as _ollama from './ollama';
import * as _ecdict from './ecdict';

export const deepl = _deepl;
export const bing = _bing;
Expand All @@ -37,3 +38,4 @@ export const caiyun = _caiyun;
export const chatglm = _chatglm;
export const geminipro = _geminipro;
export const ollama = _ollama;
export const ecdict = _ecdict;
1 change: 1 addition & 0 deletions src/window/Config/pages/Service/Translate/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export default function Translate(props) {
'bing',
'yandex',
'google',
'ecdict',
]);

const { t } = useTranslation();
Expand Down
1 change: 1 addition & 0 deletions src/window/Translate/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export default function Translate() {
'bing',
'yandex',
'google',
'ecdict',
]);
const [recognizeServiceInstanceList] = useConfig('recognize_service_list', ['system', 'tesseract']);
const [ttsServiceInstanceList] = useConfig('tts_service_list', ['lingva_tts']);
Expand Down

0 comments on commit bf15231

Please sign in to comment.