-
-
Notifications
You must be signed in to change notification settings - Fork 474
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
96 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters