fix
This commit is contained in:
parent
ac57825452
commit
933c74804c
6 changed files with 71 additions and 68 deletions
|
|
@ -4,11 +4,9 @@ import zhCnTrans from "./i18n/zh-cn.json";
|
||||||
import { initReactI18next } from 'react-i18next';
|
import { initReactI18next } from 'react-i18next';
|
||||||
|
|
||||||
const lang = window.localStorage.getItem('language');
|
const lang = window.localStorage.getItem('language');
|
||||||
// console.log(lang)
|
|
||||||
|
|
||||||
i18n.use(initReactI18next)
|
i18n.use(initReactI18next)
|
||||||
.init({
|
.init({
|
||||||
//资源文件
|
|
||||||
resources: {
|
resources: {
|
||||||
en: {
|
en: {
|
||||||
translation: enUsTrans,
|
translation: enUsTrans,
|
||||||
|
|
|
||||||
|
|
@ -11,5 +11,11 @@
|
||||||
"submit": "添加",
|
"submit": "添加",
|
||||||
"No Dailies Present": "目前每日任务为空",
|
"No Dailies Present": "目前每日任务为空",
|
||||||
"No habits 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....": "加载中...."
|
||||||
}
|
}
|
||||||
|
|
@ -15,7 +15,6 @@ export default class HabiticaSync extends Plugin {
|
||||||
view: HabiticaSyncView;
|
view: HabiticaSyncView;
|
||||||
|
|
||||||
async onload() {
|
async onload() {
|
||||||
// console.log("load plugin: habitica-sync")
|
|
||||||
await this.loadSettings();
|
await this.loadSettings();
|
||||||
this.addSettingTab(new HabiticaSyncSettingsTab(this.app, this));
|
this.addSettingTab(new HabiticaSyncSettingsTab(this.app, this));
|
||||||
this.registerView(
|
this.registerView(
|
||||||
|
|
@ -44,8 +43,9 @@ export default class HabiticaSync extends Plugin {
|
||||||
}
|
}
|
||||||
|
|
||||||
async onunload() {
|
async onunload() {
|
||||||
// await this.view.onClose();
|
if (this.view) {
|
||||||
|
await this.view.onClose();
|
||||||
|
}
|
||||||
this.app.workspace
|
this.app.workspace
|
||||||
.getLeavesOfType(VIEW_TYPE)
|
.getLeavesOfType(VIEW_TYPE)
|
||||||
.forEach((leaf) => leaf.detach());
|
.forEach((leaf) => leaf.detach());
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ import { getStats, scoreTask, makeCronReq, costReward, addTask, deleteTask, upda
|
||||||
import Statsview from "./Components/Statsview"
|
import Statsview from "./Components/Statsview"
|
||||||
import Taskview from "./Components/Taskview"
|
import Taskview from "./Components/Taskview"
|
||||||
import "../i18n"
|
import "../i18n"
|
||||||
import { exit } from "process";
|
|
||||||
|
|
||||||
class App extends React.Component<any, any> {
|
class App extends React.Component<any, any> {
|
||||||
private _username = "";
|
private _username = "";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue