Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

翻译非中文的插件简介 #26

Open
northword opened this issue Oct 14, 2023 · 0 comments
Open

翻译非中文的插件简介 #26

northword opened this issue Oct 14, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@northword
Copy link
Member

northword commented Oct 14, 2023

let desc = "";
if (resp.data.description) {
if (franc(resp.data.description) == "cmn") {
desc = resp.data.description;
} else {
desc = resp.data.description;
// 翻译
// console.log("需要翻译");
// await translate(resp.data.description, { to: "zh-CN" })
// .then((res) => {
// console.log(res.text);
// desc = res.text;
// })
// .catch((e) => {
// console.log(e);
// desc = resp.data.description;
// });
}

目前已以 franc 识别语言,若为中文,则调用翻译 API。

这里调用总是报错,也许需要用 翻译插件 里的代码了。

存在问题:若插件站有机会向整个 Zotero 社区提供服务,那么保留一份英文显然是要好一些的。

docsify 倒是也支持 i18n,md 保存成两份文件也可,json 也可以提供两份语言,这样插件合集插件也可调用。

@northword northword added the enhancement New feature or request label Oct 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant