Skip to content

Commit

Permalink
docs(i18n): add translation of update notice
Browse files Browse the repository at this point in the history
  • Loading branch information
qwqcode committed Dec 17, 2023
1 parent 10c0975 commit 776d5e6
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 4 deletions.
3 changes: 3 additions & 0 deletions ui/packages/artalk/src/i18n/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,7 @@ export default {
deleteFail: 'Delete Failed',
reqGot: 'Request got',
reqAborted: 'Request timed out or terminated unexpectedly',
updateMsg: 'Please update Artalk {name} to get the full experience',
currentVersion: 'Current Version',
ignore: 'Ignore',
}
3 changes: 3 additions & 0 deletions ui/packages/artalk/src/i18n/jp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,7 @@ export default defineLocaleExternal('jp', {
deleteFail: '削除に失敗しました',
reqGot: 'リクエストを取得しました',
reqAborted: 'リクエストがタイムアウトしたか、予期せず終了した',
updateMsg: 'フルな体験をするためには、Artalk {name} をアップデートしてください',
currentVersion: '現在のバージョン',
ignore: '無視する',
}, ['jp-JP'])
3 changes: 3 additions & 0 deletions ui/packages/artalk/src/i18n/zh-CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ const zhCN: I18n = {
deleteFail: '删除失败',
reqGot: '请求响应',
reqAborted: '请求超时或意外终止',
updateMsg: '请更新 Artalk {name} 以获得完整体验',
currentVersion: '当前版本',
ignore: '忽略',
}

export default zhCN
3 changes: 3 additions & 0 deletions ui/packages/artalk/src/i18n/zh-TW.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,7 @@ export default defineLocaleExternal('zh-TW', {
deleteFail: '刪除失敗',
reqGot: '請求響應',
reqAborted: '請求超時或意外終止',
updateMsg: '請更新 Artalk {name} 以獲得完整體驗',
currentVersion: '當前版本',
ignore: '忽略',
})
7 changes: 3 additions & 4 deletions ui/packages/artalk/src/plugins/version-check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,11 @@ function versionCheck(list: List, feVer: string, beVer: string) {
if (sameVer) return

const errEl = Utils.createElement(
`<div>请更新 Artalk ${comp < 0 ? $t('frontend') : $t('backend')}以获得完整体验 ` +
`(<a href="https://artalk.js.org/" target="_blank">帮助文档</a>)` +
`<div>${$t('updateMsg', { name: (comp < 0) ? $t('frontend') : $t('backend') })}` +
`<br/><br/><span style="color: var(--at-color-meta);">` +
`当前版本:${$t('frontend')} ${feVer} / ${$t('backend')} ${beVer}` +
`${$t('currentVersion')}: ${$t('frontend')} ${feVer} / ${$t('backend')} ${beVer}` +
`</span><br/><br/></div>`)
const ignoreBtn = Utils.createElement('<span style="cursor:pointer">忽略</span>')
const ignoreBtn = Utils.createElement(`<span style="cursor:pointer">${$t('ignore')}</span>`)
ignoreBtn.onclick = () => {
Ui.setError(list.$el.parentElement!, null)
IgnoreVersionCheck = true
Expand Down

0 comments on commit 776d5e6

Please sign in to comment.