Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
axiangcoding committed Jul 1, 2024
1 parent 4e1968d commit b78e573
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 14 deletions.
12 changes: 11 additions & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ import { onMounted, ref } from "vue";
import { getVersion } from "@tauri-apps/api/app";
import { open } from "@tauri-apps/api/shell";
import BugReportDialog from "./components/dialog/BugReportDialog.vue";
import { useI18n } from "vue-i18n";
const appVersion = ref("");
const drawer = ref(false);
const feedbackDialog = ref(false);
const { t } = useI18n();
const homeList = [
{
icon: "mdi-home",
Expand Down Expand Up @@ -47,6 +50,13 @@ const appInfo = [
},
];
const followLinks = [
{
text: t("app.follow_links.bilibili"),
url: "https://space.bilibili.com/8696650",
},
];
onMounted(async () => {
appVersion.value = await getVersion();
});
Expand Down Expand Up @@ -97,7 +107,7 @@ async function jumpToGithub() {

<v-list>
<v-list-item
v-for="(item, index) in $tm('app.follow_links') as any[]"
v-for="(item, index) in followLinks"
:key="index"
:value="index"
append-icon="mdi-open-in-new"
Expand Down
14 changes: 7 additions & 7 deletions src/i18n.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import en from "./locales/en.json";
import zh from "./locales/zh.json";
import en_us from "./locales/en_us.json";
import zh_cn from "./locales/zh_cn.json";

import { createI18n } from "vue-i18n";

const i18n = createI18n({
legacy: false,
locale: "en",
fallbackLocale: "en",
locale: "en_us",
fallbackLocale: "en_us",
messages: {
en,
zh,
en_us,
zh_cn,
},
});
});

export default i18n;
9 changes: 3 additions & 6 deletions src/locales/en.json → src/locales/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@
"follow": "Follow author on",
"report_bug": "Report a bug",
"github": "GitHub",
"follow_links": [
{
"text": "BiliBili",
"url": "https://space.bilibili.com/8696650"
}
]
"follow_links": {
"bilibili": "Bilibili"
}
}
}
File renamed without changes.

0 comments on commit b78e573

Please sign in to comment.