Skip to content

Commit

Permalink
Merge pull request SchneeHertz#158 from SchneeHertz/development
Browse files Browse the repository at this point in the history
update locale zh-tw
  • Loading branch information
SchneeHertz authored Jul 30, 2024
2 parents a601784 + db85d2a commit b6128c2
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1006,6 +1006,7 @@ LANBrowsing.get('/', (req, res) => {
res.redirect('https://github.com/SchneeHertz/exhentai-manga-manager/wiki/LAN-Browsing')
break
case 'zh-CN':
case 'zh-TW':
default:
res.redirect('https://github.com/SchneeHertz/exhentai-manga-manager/wiki/%E5%B1%80%E5%9F%9F%E7%BD%91%E6%B5%8F%E8%A7%88')
break
Expand Down
5 changes: 5 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,7 @@ import * as linkify from 'linkifyjs'
import { getWidth } from './utils.js'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import zhTw from 'element-plus/dist/locale/zh-tw.mjs'
import en from 'element-plus/dist/locale/en.mjs'
import Setting from './components/Setting.vue'
Expand Down Expand Up @@ -2345,6 +2346,10 @@ export default defineComponent({
this.locale = zhCn
this.$i18n.locale = 'zh-CN'
break
case 'zh-TW':
this.locale = zhTw
this.$i18n.locale = 'zh-TW'
break
case 'en-US':
default:
this.locale = en
Expand Down
5 changes: 3 additions & 2 deletions src/components/Setting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@
<el-select placeholder=" " v-model="setting.language" @change="handleLanguageChange">
<el-option :label="$t('m.systemDefault')" value="default"></el-option>
<el-option label="zh-CN" value="zh-CN"></el-option>
<el-option label="zh-TW" value="zh-TW"></el-option>
<el-option label="en-US" value="en-US"></el-option>
</el-select>
</template>
Expand Down Expand Up @@ -356,11 +357,11 @@
<a href="#" @click="openLink('https://github.com/SchneeHertz/exhentai-manga-manager')">github</a>
</el-descriptions-item>
<el-descriptions-item :label="$t('m.help')+':'">
<a v-if="$i18n.locale === 'zh-CN'" href="#" @click="openLink('https://github.com/SchneeHertz/exhentai-manga-manager/wiki/中文说明')">github wiki</a>
<a v-if="['zh-CN', 'zh-TW'].includes($i18n.locale)" href="#" @click="openLink('https://github.com/SchneeHertz/exhentai-manga-manager/wiki/中文说明')">github wiki</a>
<a v-else href="#" @click="openLink('https://github.com/SchneeHertz/exhentai-manga-manager/wiki/English-Instruction')">github wiki</a>
</el-descriptions-item>
<el-descriptions-item :label="$t('m.donation')+':'">
<a v-if="$i18n.locale === 'zh-CN'" href="#" @click="openLink('https://afdian.com/a/SeldonHorizon')">爱发电</a>
<a v-if="['zh-CN', 'zh-TW'].includes($i18n.locale)" href="#" @click="openLink('https://afdian.com/a/SeldonHorizon')">爱发电</a>
<a v-else href="#" @click="openLink('https://www.buymeacoffee.com/schneehertz')">buy me a coffee</a>
</el-descriptions-item>
</el-descriptions>
Expand Down
4 changes: 2 additions & 2 deletions src/locales/zh-TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@
"Global_Reload": "重整",
"Global_ShowAbout": "顯示關於",
"Global_ShowAccelerator": "顯示快捷鍵",
"Global_Escape": "推出到上一個介面",
"Global_Escape": "退出到上一個介面",
"Home": "首頁",
"Home_PreviousPage": "上一頁",
"Home_NextPage": "下一頁",
Expand Down Expand Up @@ -226,7 +226,7 @@
"InnerViewer_ScrollDown": "向下滾動",
"InnerViewer_FirstPage": "第一頁",
"InnerViewer_LastPage": "最後一頁",
"InnerViewer_InsertEmptyPage": "抽入空頁",
"InnerViewer_InsertEmptyPage": "插入空頁",
"InnerViewer_SwitchThumbnail": "切換縮圖"
}
}
2 changes: 2 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ import ContextMenu from '@imengyu/vue3-context-menu'

import { createI18n } from 'vue-i18n'
import zhCn from './locales/zh-CN.json'
import zhTw from './locales/zh-TW.json'
import enUs from './locales/en-US.json'
const messages = {
'zh-CN': zhCn,
'zh-TW': zhTw,
'en-US': enUs
}

Expand Down

0 comments on commit b6128c2

Please sign in to comment.