This commit is contained in:
kkzzhizhou 2021-11-28 23:55:21 +08:00
parent ac57825452
commit 933c74804c
6 changed files with 71 additions and 68 deletions

View file

@ -4,11 +4,9 @@ import zhCnTrans from "./i18n/zh-cn.json";
import { initReactI18next } from 'react-i18next';
const lang = window.localStorage.getItem('language');
// console.log(lang)
i18n.use(initReactI18next)
.init({
//资源文件
resources: {
en: {
translation: enUsTrans,

View file

@ -11,5 +11,11 @@
"submit": "添加",
"No Dailies Present": "目前每日任务为空",
"No habits present.": "目前习惯为空",
"No Rewards present.": "目前奖励为空"
"No Rewards present.": "目前奖励为空",
"There was an error running the cron. Please try again later.": "运行定时失败出错,请稍后再试。",
"Login Failed, Please check credentials and try again!": "登录失败, 请检查凭据后再次尝试",
"API Error: Please check credentials": "API错误请检查凭据",
"Resyncing, please try again": "重新同步失败,请稍后再试",
"Add!": "已添加",
"Loading....": "加载中...."
}

View file

@ -15,7 +15,6 @@ export default class HabiticaSync extends Plugin {
view: HabiticaSyncView;
async onload() {
// console.log("load plugin: habitica-sync")
await this.loadSettings();
this.addSettingTab(new HabiticaSyncSettingsTab(this.app, this));
this.registerView(
@ -44,8 +43,9 @@ export default class HabiticaSync extends Plugin {
}
async onunload() {
// await this.view.onClose();
if (this.view) {
await this.view.onClose();
}
this.app.workspace
.getLeavesOfType(VIEW_TYPE)
.forEach((leaf) => leaf.detach());

View file

@ -4,7 +4,6 @@ import { getStats, scoreTask, makeCronReq, costReward, addTask, deleteTask, upda
import Statsview from "./Components/Statsview"
import Taskview from "./Components/Taskview"
import "../i18n"
import { exit } from "process";
class App extends React.Component<any, any> {
private _username = "";