Skip to content

Commit

Permalink
Merge pull request #81 from fangshun-z/fix/79
Browse files Browse the repository at this point in the history
fix: add docs link
  • Loading branch information
Ruby-rc authored Mar 7, 2024
2 parents a111fe6 + 79091cb commit 9c3ee98
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/locales/en-US/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"confirm": "Confirm",
"close": "Close",
"yes": "YES",
"no": "No"
"no": "No",
"doc": "https://docs.daocloud.io/en/{link}"
}
3 changes: 2 additions & 1 deletion src/locales/en-US/views/settings/SettingsView.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"off": "Off"
},
"highAvailable": "High Available",
"drbdHelper": "DRBD is not installed, click to install",
"drbdHelper": "DRBD is not installed, {action}",
"action": "click to install",
"version": "DRBD Version",
"highAvailableSetting": "High Available Setting"
}
3 changes: 2 additions & 1 deletion src/locales/zh-CN/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"confirm": "确认",
"close": "关闭",
"yes": "",
"no": ""
"no": "",
"doc": "https://docs.daocloud.io/{link}"
}
3 changes: 2 additions & 1 deletion src/locales/zh-CN/views/settings/SettingsView.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"off": "未开启"
},
"highAvailable": "高可用",
"drbdHelper": "DRBD 模块未安装,开始安装",
"drbdHelper": "DRBD 模块未安装,{action}",
"action": "开始安装",
"version": "DRBD 版本",
"highAvailableSetting": "高可用设置"
}
8 changes: 6 additions & 2 deletions src/plugins/vue-i18n/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import type { App } from 'vue';
import { createI18n, LocaleMessages, VueMessageType } from 'vue-i18n';
import { defineComponent, type App } from 'vue';
import {
createI18n, Translation, LocaleMessages, VueMessageType,
} from 'vue-i18n';
import { loadExternalLanguage, setI18nLanguageExternal } from './external';

function getRegisterMap(path: string[], map: Record<string | symbol, unknown>) {
Expand Down Expand Up @@ -79,6 +81,8 @@ const i18nPlugin = createI18n({
});

export default function i18nInstall(app: App) {
// eslint-disable-next-line vue/multi-word-component-names
app.component('Translation', defineComponent(Translation));
app.use(i18nPlugin);
}

Expand Down
22 changes: 20 additions & 2 deletions src/views/settings/SettingsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<dao-form-group :title="$t('views.settings.SettingsView.highAvailableSetting')">
<dao-form
v-slot="{classNames}"
v-slot="{ classNames }"
class="bg-white pt-[15px]"
>
<dao-form-item :label="$t('views.settings.SettingsView.highAvailable')">
Expand All @@ -13,7 +13,25 @@
</div>

<dao-helper-text v-if="!setting?.enable">
{{ $t('views.settings.SettingsView.drbdHelper') }}
<translation
keypath="views.settings.SettingsView.drbdHelper"
scope="global"
tag="span"
>
<template #action>
<dao-text-button
:prop="{
type: 'link',
iconRight: 'icon-new-tab',
}"
tag="a"
target="_blank"
:href="$t('common.doc', { link: 'storage/hwameistor/install/drbdinstall/' })"
>
{{ $t('views.settings.SettingsView.action') }}
</dao-text-button>
</template>
</translation>
</dao-helper-text>
</dao-form-item>

Expand Down

0 comments on commit 9c3ee98

Please sign in to comment.