From 9152a32fd3e1958c99b7828be02f9ad6fa49fb54 Mon Sep 17 00:00:00 2001 From: tiny-craft <137850705+tiny-craft@users.noreply.github.com> Date: Thu, 7 Sep 2023 18:38:34 +0800 Subject: [PATCH] refactor: reorganized the structure of the multi-language content. --- .../components/common/EditableTableColumn.vue | 7 +- .../src/components/content/ContentLogPane.vue | 24 +- .../src/components/content/ContentPane.vue | 4 +- .../components/content/ContentServerPane.vue | 4 +- .../components/content/ContentValueTab.vue | 2 +- .../content_value/ContentServerStatus.vue | 20 +- .../content_value/ContentToolbar.vue | 18 +- .../content_value/ContentValueHash.vue | 18 +- .../content_value/ContentValueList.vue | 12 +- .../content_value/ContentValueSet.vue | 12 +- .../content_value/ContentValueStream.vue | 14 +- .../content_value/ContentValueString.vue | 14 +- .../content_value/ContentValueZSet.vue | 22 +- .../components/dialogs/AddFieldsDialog.vue | 28 +- .../components/dialogs/ConnectionDialog.vue | 64 +-- .../components/dialogs/DeleteKeyDialog.vue | 18 +- .../src/components/dialogs/GroupDialog.vue | 12 +- .../components/dialogs/KeyFilterDialog.vue | 18 +- .../src/components/dialogs/NewKeyDialog.vue | 22 +- .../components/dialogs/PreferencesDialog.vue | 38 +- .../components/dialogs/RenameKeyDialog.vue | 10 +- .../src/components/dialogs/SetTtlDialog.vue | 14 +- .../src/components/new_value/AddHashValue.vue | 12 +- .../src/components/new_value/AddListValue.vue | 10 +- .../src/components/new_value/AddZSetValue.vue | 15 +- .../src/components/new_value/NewHashValue.vue | 6 +- .../src/components/new_value/NewListValue.vue | 4 +- .../src/components/new_value/NewSetValue.vue | 4 +- .../components/new_value/NewStreamValue.vue | 6 +- .../components/new_value/NewStringValue.vue | 2 +- .../src/components/new_value/NewZSetValue.vue | 9 +- .../src/components/sidebar/BrowserPane.vue | 13 +- .../src/components/sidebar/BrowserTree.vue | 56 +-- .../src/components/sidebar/ConnectionPane.vue | 6 +- .../src/components/sidebar/ConnectionTree.vue | 62 +-- frontend/src/components/sidebar/NavMenu.vue | 20 +- frontend/src/langs/en.json | 370 +++++++++-------- frontend/src/langs/zh-cn.json | 371 ++++++++++-------- frontend/src/main.js | 2 +- frontend/src/stores/preferences.js | 14 +- frontend/src/utils/discrete.js | 12 +- 41 files changed, 748 insertions(+), 641 deletions(-) diff --git a/frontend/src/components/common/EditableTableColumn.vue b/frontend/src/components/common/EditableTableColumn.vue index f0f9ea3..db2b0e2 100644 --- a/frontend/src/components/common/EditableTableColumn.vue +++ b/frontend/src/components/common/EditableTableColumn.vue @@ -22,11 +22,14 @@ const emit = defineEmits(['edit', 'delete', 'save', 'cancel'])
- + - {{ $t('remove_tip', { name: props.bindKey }) }} + {{ $t('dialogue.remove_tip', { name: props.bindKey }) }}
diff --git a/frontend/src/components/content/ContentLogPane.vue b/frontend/src/components/content/ContentLogPane.vue index ce9714b..b62e270 100644 --- a/frontend/src/components/content/ContentLogPane.vue +++ b/frontend/src/components/content/ContentLogPane.vue @@ -23,7 +23,7 @@ const filterServerOption = computed(() => { value: server, })) options.splice(0, 0, { - label: i18n.t('all'), + label: i18n.t('common.all'), value: '', }) return options @@ -45,7 +45,7 @@ const loadHistory = () => { } const cleanHistory = async () => { - $dialog.warning(i18n.t('confirm_clean_log'), () => { + $dialog.warning(i18n.t('log.confirm_clean_log'), () => { data.loading = true connectionStore .cleanCmdHistory() @@ -53,7 +53,7 @@ const cleanHistory = async () => { if (success) { data.history = [] tableRef.value?.scrollTo({ top: 0 }) - $message.success(i18n.t('success')) + $message.success(i18n.t('common.success')) } }) .finally(() => { @@ -69,26 +69,26 @@ defineExpose({ diff --git a/frontend/src/components/content_value/ContentValueHash.vue b/frontend/src/components/content_value/ContentValueHash.vue index cb5242a..360487a 100644 --- a/frontend/src/components/content_value/ContentValueHash.vue +++ b/frontend/src/components/content_value/ContentValueHash.vue @@ -24,11 +24,11 @@ const props = defineProps({ const filterOption = [ { value: 1, - label: i18n.t('field'), + label: i18n.t('common.field'), }, { value: 2, - label: i18n.t('value'), + label: i18n.t('common.value'), }, ] const filterType = ref(1) @@ -43,7 +43,7 @@ const currentEditRow = ref({ }) const fieldColumn = reactive({ key: 'key', - title: i18n.t('field'), + title: i18n.t('common.field'), align: 'center', titleAlign: 'center', resizable: true, @@ -68,7 +68,7 @@ const fieldColumn = reactive({ }) const valueColumn = reactive({ key: 'value', - title: i18n.t('value'), + title: i18n.t('common.value'), align: 'center', titleAlign: 'center', resizable: true, @@ -99,7 +99,7 @@ const valueColumn = reactive({ }) const actionColumn = { key: 'action', - title: i18n.t('action'), + title: i18n.t('interface.action'), width: 100, align: 'center', titleAlign: 'center', @@ -123,7 +123,7 @@ const actionColumn = { ) if (success) { connectionStore.loadKeyValue(props.name, props.db, props.keyPath).then((r) => {}) - $message.success(i18n.t('delete_key_succ', { key: row.key })) + $message.success(i18n.t('dialogue.delete_key_succ', { key: row.key })) // update display value // if (!isEmpty(removed)) { // for (const elem of removed) { @@ -149,7 +149,7 @@ const actionColumn = { ) if (success) { connectionStore.loadKeyValue(props.name, props.db, props.keyPath).then((r) => {}) - $message.success(i18n.t('save_value_succ')) + $message.success(i18n.t('dialogue.save_value_succ')) // update display value // if (!isEmpty(updated)) { // for (const key in updated) { @@ -251,7 +251,7 @@ const onUpdateFilter = (filters, sourceColumn) => { @update:value="onChangeFilterType" /> @@ -262,7 +262,7 @@ const onUpdateFilter = (filters, sourceColumn) => { - {{ $t('add_row') }} + {{ $t('interface.add_row') }}
diff --git a/frontend/src/components/content_value/ContentValueList.vue b/frontend/src/components/content_value/ContentValueList.vue index 6cb9ebd..d4af9c7 100644 --- a/frontend/src/components/content_value/ContentValueList.vue +++ b/frontend/src/components/content_value/ContentValueList.vue @@ -31,7 +31,7 @@ const currentEditRow = ref({ }) const valueColumn = reactive({ key: 'value', - title: i18n.t('value'), + title: i18n.t('common.value'), align: 'center', titleAlign: 'center', filterOptionValue: null, @@ -57,7 +57,7 @@ const valueColumn = reactive({ }) const actionColumn = { key: 'action', - title: i18n.t('action'), + title: i18n.t('interface.action'), width: 100, align: 'center', titleAlign: 'center', @@ -80,7 +80,7 @@ const actionColumn = { ) if (success) { connectionStore.loadKeyValue(props.name, props.db, props.keyPath).then((r) => {}) - $message.success(i18n.t('delete_key_succ', { key: '#' + row.no })) + $message.success(i18n.t('dialogue.delete_key_succ', { key: '#' + row.no })) // update display value // if (!isEmpty(removed)) { // props.value.splice(removed[0], 1) @@ -103,7 +103,7 @@ const actionColumn = { ) if (success) { connectionStore.loadKeyValue(props.name, props.db, props.keyPath).then((r) => {}) - $message.success(i18n.t('save_value_succ')) + $message.success(i18n.t('dialogue.save_value_succ')) // update display value // if (!isEmpty(updated)) { // for (const key in updated) { @@ -176,7 +176,7 @@ const onUpdateFilter = (filters, sourceColumn) => {
@@ -186,7 +186,7 @@ const onUpdateFilter = (filters, sourceColumn) => { - {{ $t('add_row') }} + {{ $t('interface.add_row') }}
diff --git a/frontend/src/components/content_value/ContentValueSet.vue b/frontend/src/components/content_value/ContentValueSet.vue index 12bb603..a6f8494 100644 --- a/frontend/src/components/content_value/ContentValueSet.vue +++ b/frontend/src/components/content_value/ContentValueSet.vue @@ -32,7 +32,7 @@ const currentEditRow = ref({ const valueColumn = reactive({ key: 'value', - title: i18n.t('value'), + title: i18n.t('common.value'), align: 'center', titleAlign: 'center', filterOptionValue: null, @@ -58,7 +58,7 @@ const valueColumn = reactive({ }) const actionColumn = { key: 'action', - title: i18n.t('action'), + title: i18n.t('interface.action'), width: 100, align: 'center', titleAlign: 'center', @@ -82,7 +82,7 @@ const actionColumn = { ) if (success) { connectionStore.loadKeyValue(props.name, props.db, props.keyPath).then((r) => {}) - $message.success(i18n.t('delete_key_succ', { key: row.value })) + $message.success(i18n.t('dialogue.delete_key_succ', { key: row.value })) // update display value // props.value.splice(row.no - 1, 1) } else { @@ -103,7 +103,7 @@ const actionColumn = { ) if (success) { connectionStore.loadKeyValue(props.name, props.db, props.keyPath).then((r) => {}) - $message.success(i18n.t('save_value_succ')) + $message.success(i18n.t('dialogue.save_value_succ')) // update display value // props.value[row.no - 1] = currentEditRow.value.value } else { @@ -172,7 +172,7 @@ const onUpdateFilter = (filters, sourceColumn) => {
@@ -182,7 +182,7 @@ const onUpdateFilter = (filters, sourceColumn) => { - {{ $t('add_row') }} + {{ $t('interface.add_row') }}
diff --git a/frontend/src/components/content_value/ContentValueStream.vue b/frontend/src/components/content_value/ContentValueStream.vue index 04a0abd..e0a2d5c 100644 --- a/frontend/src/components/content_value/ContentValueStream.vue +++ b/frontend/src/components/content_value/ContentValueStream.vue @@ -25,11 +25,11 @@ const props = defineProps({ const filterOption = [ { value: 1, - label: i18n.t('field'), + label: i18n.t('common.field'), }, { value: 2, - label: i18n.t('value'), + label: i18n.t('common.value'), }, ] const filterType = ref(1) @@ -46,7 +46,7 @@ const idColumn = reactive({ }) const valueColumn = reactive({ key: 'value', - title: i18n.t('value'), + title: i18n.t('common.value'), align: 'center', titleAlign: 'center', resizable: true, @@ -71,7 +71,7 @@ const valueColumn = reactive({ }) const actionColumn = { key: 'action', - title: i18n.t('action'), + title: i18n.t('interface.action'), width: 60, align: 'center', titleAlign: 'center', @@ -90,7 +90,7 @@ const actionColumn = { ) if (success) { connectionStore.loadKeyValue(props.name, props.db, props.keyPath).then((r) => {}) - $message.success(i18n.t('delete_key_succ', { key: row.id })) + $message.success(i18n.t('dialogue.delete_key_succ', { key: row.id })) // update display value // if (!isEmpty(removed)) { // for (const elem of removed) { @@ -164,7 +164,7 @@ const onUpdateFilter = (filters, sourceColumn) => { @update:value="onChangeFilterType" /> @@ -175,7 +175,7 @@ const onUpdateFilter = (filters, sourceColumn) => { - {{ $t('add_row') }} + {{ $t('interface.add_row') }}
diff --git a/frontend/src/components/content_value/ContentValueString.vue b/frontend/src/components/content_value/ContentValueString.vue index f653c96..28ed166 100644 --- a/frontend/src/components/content_value/ContentValueString.vue +++ b/frontend/src/components/content_value/ContentValueString.vue @@ -115,7 +115,7 @@ const onCopyValue = () => { ClipboardSetText(viewValue.value) .then((succ) => { if (succ) { - $message.success(i18n.t('copy_succ')) + $message.success(i18n.t('dialogue.copy_succ')) } }) .catch((e) => { @@ -152,7 +152,7 @@ const onSaveValue = async () => { ) if (success) { await connectionStore.loadKeyValue(props.name, props.db, props.keyPath) - $message.success(i18n.t('save_value_succ')) + $message.success(i18n.t('dialogue.save_value_succ')) } else { $message.error(msg) } @@ -169,7 +169,7 @@ const onSaveValue = async () => {
- {{ $t('view_as') }} + {{ $t('interface.view_as') }}
@@ -177,13 +177,13 @@ const onSaveValue = async () => { - {{ $t('copy_value') }} + {{ $t('interface.copy_value') }} - {{ $t('edit_value') }} + {{ $t('interface.edit_value') }} @@ -191,13 +191,13 @@ const onSaveValue = async () => { - {{ $t('save_update') }} + {{ $t('interface.save_update') }} - {{ $t('cancel') }} + {{ $t('common.cancel') }}
diff --git a/frontend/src/components/content_value/ContentValueZSet.vue b/frontend/src/components/content_value/ContentValueZSet.vue index f5d385c..c0584c6 100644 --- a/frontend/src/components/content_value/ContentValueZSet.vue +++ b/frontend/src/components/content_value/ContentValueZSet.vue @@ -25,11 +25,11 @@ const props = defineProps({ const filterOption = [ { value: 1, - label: i18n.t('value'), + label: i18n.t('common.value'), }, { value: 2, - label: i18n.t('score'), + label: i18n.t('interface.score'), }, ] const filterType = ref(1) @@ -44,7 +44,7 @@ const currentEditRow = ref({ }) const scoreColumn = reactive({ key: 'score', - title: i18n.t('score'), + title: i18n.t('interface.score'), align: 'center', titleAlign: 'center', resizable: true, @@ -98,7 +98,7 @@ const scoreColumn = reactive({ }) const valueColumn = reactive({ key: 'value', - title: i18n.t('value'), + title: i18n.t('common.value'), align: 'center', titleAlign: 'center', resizable: true, @@ -129,7 +129,7 @@ const valueColumn = reactive({ }) const actionColumn = { key: 'action', - title: i18n.t('action'), + title: i18n.t('interface.action'), width: 100, align: 'center', titleAlign: 'center', @@ -153,7 +153,7 @@ const actionColumn = { ) if (success) { connectionStore.loadKeyValue(props.name, props.db, props.keyPath).then((r) => {}) - $message.success(i18n.t('delete_key_succ', { key: row.value })) + $message.success(i18n.t('dialogue.delete_key_succ', { key: row.value })) } else { $message.error(msg) } @@ -165,7 +165,7 @@ const actionColumn = { try { const newValue = currentEditRow.value.value if (isEmpty(newValue)) { - $message.error(i18n.t('spec_field_required', { key: i18n.t('value') })) + $message.error(i18n.t('dialogue.spec_field_required', { key: i18n.t('common.value') })) return } const { success, msg } = await connectionStore.updateZSetItem( @@ -178,7 +178,7 @@ const actionColumn = { ) if (success) { connectionStore.loadKeyValue(props.name, props.db, props.keyPath).then((r) => {}) - $message.success(i18n.t('save_value_succ')) + $message.success(i18n.t('dialogue.save_value_succ')) } else { $message.error(msg) } @@ -279,12 +279,12 @@ const onUpdateFilter = (filters, sourceColumn) => { -
{{ $t('score_filter_tip') }}
+
{{ $t('interface.score_filter_tip') }}
@@ -293,7 +293,7 @@ const onUpdateFilter = (filters, sourceColumn) => { - {{ $t('add_row') }} + {{ $t('interface.add_row') }}
diff --git a/frontend/src/components/dialogs/AddFieldsDialog.vue b/frontend/src/components/dialogs/AddFieldsDialog.vue index c9b6eb8..21796b2 100644 --- a/frontend/src/components/dialogs/AddFieldsDialog.vue +++ b/frontend/src/components/dialogs/AddFieldsDialog.vue @@ -47,15 +47,15 @@ const defaultValue = { const title = computed(() => { switch (newForm.type) { case types.LIST: - return i18n.t('new_item') + return i18n.t('dialogue.field.new_item') case types.HASH: - return i18n.t('new_field') + return i18n.t('dialogue.field.new') case types.SET: - return i18n.t('new_field') + return i18n.t('dialogue.field.new') case types.ZSET: - return i18n.t('new_field') + return i18n.t('dialogue.field.new') case types.STREAM: - return i18n.t('new_field') + return i18n.t('dialogue.field.new') } return '' }) @@ -98,7 +98,7 @@ const onAdd = async () => { if (newForm.reload) { connectionStore.loadKeyValue(server, db, key).then(() => {}) } - $message.success(i18n.t('handle_succ')) + $message.success(i18n.t('dialogue.handle_succ')) } else { $message.error(msg) } @@ -112,7 +112,7 @@ const onAdd = async () => { if (newForm.reload) { connectionStore.loadKeyValue(server, db, key).then(() => {}) } - $message.success(i18n.t('handle_succ')) + $message.success(i18n.t('dialogue.handle_succ')) } else { $message.error(msg) } @@ -126,7 +126,7 @@ const onAdd = async () => { if (newForm.reload) { connectionStore.loadKeyValue(server, db, key).then(() => {}) } - $message.success(i18n.t('handle_succ')) + $message.success(i18n.t('dialogue.handle_succ')) } else { $message.error(msg) } @@ -140,7 +140,7 @@ const onAdd = async () => { if (newForm.reload) { connectionStore.loadKeyValue(server, db, key).then(() => {}) } - $message.success(i18n.t('handle_succ')) + $message.success(i18n.t('dialogue.handle_succ')) } else { $message.error(msg) } @@ -161,7 +161,7 @@ const onAdd = async () => { if (newForm.reload) { connectionStore.loadKeyValue(server, db, key).then(() => {}) } - $message.success(i18n.t('handle_succ')) + $message.success(i18n.t('dialogue.handle_succ')) } else { $message.error(msg) } @@ -187,9 +187,9 @@ const onClose = () => { :close-on-esc="false" :mask-closable="false" :negative-button-props="{ size: 'medium' }" - :negative-text="$t('cancel')" + :negative-text="$t('common.cancel')" :positive-button-props="{ size: 'medium' }" - :positive-text="$t('confirm')" + :positive-text="$t('common.confirm')" :show-icon="false" :title="title" preset="dialog" @@ -199,7 +199,7 @@ const onClose = () => { @negative-click="onClose"> - + { v-model:value="newForm.value" /> - {{ $t('reload_when_succ') }} + {{ $t('dialogue.field.reload_when_succ') }} diff --git a/frontend/src/components/dialogs/ConnectionDialog.vue b/frontend/src/components/dialogs/ConnectionDialog.vue index 76301b4..9be5fa5 100644 --- a/frontend/src/components/dialogs/ConnectionDialog.vue +++ b/frontend/src/components/dialogs/ConnectionDialog.vue @@ -18,7 +18,7 @@ const i18n = useI18n() const editName = ref('') const generalForm = ref(null) const generalFormRules = () => { - const requiredMsg = i18n.t('field_required') + const requiredMsg = i18n.t('dialogue.field_required') const illegalChars = ['/', '\\'] return { name: [ @@ -27,7 +27,7 @@ const generalFormRules = () => { validator: (rule, value) => { return every(illegalChars, (c) => !includes(value, c)) }, - message: i18n.t('illegal_characters'), + message: i18n.t('dialogue.illegal_characters'), trigger: 'input', }, ], @@ -50,7 +50,7 @@ const groupOptions = computed(() => { value: group, })) options.splice(0, 0, { - label: i18n.t('no_group'), + label: i18n.t('dialogue.connection.no_group'), value: '', }) return options @@ -86,7 +86,7 @@ const onSaveConnection = async () => { return } - $message.success(i18n.t('handle_succ')) + $message.success(i18n.t('dialogue.handle_succ')) onClose() } @@ -149,26 +149,30 @@ const onClose = () => { :mask-closable="false" :on-after-leave="resetForm" :show-icon="false" - :title="isEditMode ? $t('edit_conn_title') : $t('new_conn_title')" + :title="isEditMode ? $t('dialogue.connection.edit_title') : $t('dialogue.connection.new_title')" preset="dialog" transform-origin="center"> - + - - + + - + - - + + : { :min="1" style="width: 200px" /> - + - - + + - + - + + :placeholder="$t('dialogue.connection.advn_filter_tip')" /> - + + :placeholder="$t('dialogue.connection.advn_separator_tip')" /> - + - + - +
{ - + @@ -250,15 +254,15 @@ const onClose = () => { diff --git a/frontend/src/components/dialogs/DeleteKeyDialog.vue b/frontend/src/components/dialogs/DeleteKeyDialog.vue index 44c0d21..67d4022 100644 --- a/frontend/src/components/dialogs/DeleteKeyDialog.vue +++ b/frontend/src/components/dialogs/DeleteKeyDialog.vue @@ -53,7 +53,7 @@ const onConfirmDelete = async () => { const { server, db, key } = deleteForm const success = await connectionStore.deleteKeyPrefix(server, db, key) if (success) { - $message.success(i18n.t('handle_succ')) + $message.success(i18n.t('dialogue.handle_succ')) } } catch (e) { $message.error(e.message) @@ -73,20 +73,20 @@ const onClose = () => { :close-on-esc="false" :mask-closable="false" :show-icon="false" - :title="$t('batch_delete_key')" + :title="$t('interface.batch_delete_key')" preset="dialog" transform-origin="center"> - + - + - + - + { diff --git a/frontend/src/components/dialogs/GroupDialog.vue b/frontend/src/components/dialogs/GroupDialog.vue index 38679e8..c5e3737 100644 --- a/frontend/src/components/dialogs/GroupDialog.vue +++ b/frontend/src/components/dialogs/GroupDialog.vue @@ -34,14 +34,14 @@ const onConfirm = async () => { if (isRenameMode.value) { const { success, msg } = await connectionStore.renameGroup(editGroup.value, name) if (success) { - $message.success(i18n.t('handle_succ')) + $message.success(i18n.t('dialogue.handle_succ')) } else { $message.error(msg) } } else { const { success, msg } = await connectionStore.createGroup(name) if (success) { - $message.success(i18n.t('handle_succ')) + $message.success(i18n.t('dialogue.handle_succ')) } else { $message.error(msg) } @@ -68,17 +68,17 @@ const onClose = () => { :close-on-esc="false" :mask-closable="false" :negative-button-props="{ size: 'medium' }" - :negative-text="$t('cancel')" + :negative-text="$t('common.cancel')" :positive-button-props="{ size: 'medium' }" - :positive-text="$t('confirm')" + :positive-text="$t('common.confirm')" :show-icon="false" - :title="isRenameMode ? $t('rename_group') : $t('new_group')" + :title="isRenameMode ? $t('dialogue.group.rename') : $t('dialogue.group.new')" preset="dialog" transform-origin="center" @positive-click="onConfirm" @negative-click="onClose"> - + diff --git a/frontend/src/components/dialogs/KeyFilterDialog.vue b/frontend/src/components/dialogs/KeyFilterDialog.vue index 181c0ce..ae7370b 100644 --- a/frontend/src/components/dialogs/KeyFilterDialog.vue +++ b/frontend/src/components/dialogs/KeyFilterDialog.vue @@ -20,7 +20,7 @@ const typeOptions = computed(() => { })) options.splice(0, 0, { value: '', - label: i18n.t('all'), + label: i18n.t('common.all'), }) return options }) @@ -58,11 +58,11 @@ const onClose = () => { :close-on-esc="false" :mask-closable="false" :negative-button-props="{ size: 'medium' }" - :negative-text="$t('cancel')" + :negative-text="$t('common.cancel')" :positive-button-props="{ size: 'medium' }" - :positive-text="$t('confirm')" + :positive-text="$t('common.confirm')" :show-icon="false" - :title="$t('set_key_filter')" + :title="$t('dialogue.filter.set_key_filter')" preset="dialog" style="width: 450px" transform-origin="center" @@ -77,22 +77,22 @@ const onClose = () => { {{ filterForm.server }} - + {{ filterForm.db }} - + - + -
{{ $t('filter_pattern_tip') }}
+
{{ $t('dialogue.filter.filter_pattern_tip') }}
- {{ $t('restore_defaults') }} + {{ $t('preferences.restore_defaults') }}
diff --git a/frontend/src/components/dialogs/NewKeyDialog.vue b/frontend/src/components/dialogs/NewKeyDialog.vue index 6385a5c..e18615f 100644 --- a/frontend/src/components/dialogs/NewKeyDialog.vue +++ b/frontend/src/components/dialogs/NewKeyDialog.vue @@ -24,7 +24,7 @@ const newForm = reactive({ value: null, }) const formRules = computed(() => { - const requiredMsg = i18n.t('field_required') + const requiredMsg = i18n.t('dialogue.field_required') return { key: { required: true, message: requiredMsg, trigger: 'input' }, type: { required: true, message: requiredMsg, trigger: 'input' }, @@ -107,7 +107,7 @@ const onAdd = async () => { $message.error(err.message) }) if (subFormRef.value?.validate && !subFormRef.value?.validate()) { - $message.error(i18n.t('spec_field_required', { key: i18n.t('element') })) + $message.error(i18n.t('dialogue.spec_field_required', { key: i18n.t('dialogue.field.element') })) return false } try { @@ -140,11 +140,11 @@ const onClose = () => { :close-on-esc="false" :mask-closable="false" :negative-button-props="{ size: 'medium' }" - :negative-text="$t('cancel')" + :negative-text="$t('common.cancel')" :positive-button-props="{ size: 'medium' }" - :positive-text="$t('confirm')" + :positive-text="$t('common.confirm')" :show-icon="false" - :title="$t('new_key')" + :title="$t('dialogue.key.new')" preset="dialog" style="width: 600px" transform-origin="center" @@ -158,16 +158,16 @@ const onClose = () => { :show-require-mark="false" label-placement="top" style="padding-right: 15px"> - + - + - + - + { :min="-1" placeholder="TTL"> - {{ $t('persist_key') }} + {{ $t('dialogue.key.persist_key') }} diff --git a/frontend/src/components/dialogs/PreferencesDialog.vue b/frontend/src/components/dialogs/PreferencesDialog.vue index 341e0f7..b5d2cb8 100644 --- a/frontend/src/components/dialogs/PreferencesDialog.vue +++ b/frontend/src/components/dialogs/PreferencesDialog.vue @@ -38,7 +38,7 @@ watch( const onSavePreferences = async () => { const success = await prefStore.savePreferences() if (success) { - $message.success(i18n.t('handle_succ')) + $message.success(i18n.t('dialogue.handle_succ')) dialogStore.closePreferencesDialog() } } @@ -58,57 +58,57 @@ const onClose = () => { :close-on-esc="false" :mask-closable="false" :show-icon="false" - :title="$t('preferences')" + :title="$t('preferences.name')" preset="dialog" transform-origin="center"> - + - + {{ opt.label }} - + - + - + - + - {{ $t('use_system_proxy') }} + {{ $t('preferences.general.use_system_proxy') }} - {{ $t('use_system_proxy_http') }} + {{ $t('preferences.general.use_system_proxy_http') }} - + - {{ $t('auto_check_update') }} + {{ $t('preferences.general.auto_check_update') }} - + - + - + @@ -119,12 +119,14 @@ const onClose = () => { diff --git a/frontend/src/components/dialogs/RenameKeyDialog.vue b/frontend/src/components/dialogs/RenameKeyDialog.vue index 38a34d4..15b4a78 100644 --- a/frontend/src/components/dialogs/RenameKeyDialog.vue +++ b/frontend/src/components/dialogs/RenameKeyDialog.vue @@ -33,7 +33,7 @@ const onRename = async () => { const { success, msg } = await connectionStore.renameKey(server, db, key, newKey) if (success) { await connectionStore.loadKeyValue(server, db, newKey) - $message.success(i18n.t('handle_succ')) + $message.success(i18n.t('dialogue.handle_succ')) } else { $message.error(msg) } @@ -55,11 +55,11 @@ const onClose = () => { :close-on-esc="false" :mask-closable="false" :negative-button-props="{ size: 'medium' }" - :negative-text="$t('cancel')" + :negative-text="$t('common.cancel')" :positive-button-props="{ size: 'medium' }" - :positive-text="$t('confirm')" + :positive-text="$t('common.confirm')" :show-icon="false" - :title="$t('rename_key')" + :title="$t('interface.rename_key')" preset="dialog" transform-origin="center" @positive-click="onRename" @@ -70,7 +70,7 @@ const onClose = () => { :show-label="false" label-align="left" label-placement="top"> - +
diff --git a/frontend/src/components/dialogs/SetTtlDialog.vue b/frontend/src/components/dialogs/SetTtlDialog.vue index 423b10d..96a917e 100644 --- a/frontend/src/components/dialogs/SetTtlDialog.vue +++ b/frontend/src/components/dialogs/SetTtlDialog.vue @@ -69,21 +69,21 @@ const onConfirm = async () => { :close-on-esc="false" :mask-closable="false" :show-icon="false" - :title="$t('set_ttl')" + :title="$t('dialogue.ttl.title')" preset="dialog" transform-origin="center"> - + - + @@ -91,11 +91,11 @@ const onConfirm = async () => { diff --git a/frontend/src/components/new_value/AddHashValue.vue b/frontend/src/components/new_value/AddHashValue.vue index 93cf142..c3e3b97 100644 --- a/frontend/src/components/new_value/AddHashValue.vue +++ b/frontend/src/components/new_value/AddHashValue.vue @@ -16,11 +16,11 @@ const i18n = useI18n() const updateOption = [ { value: 0, - label: i18n.t('overwrite_field'), + label: i18n.t('dialogue.field.overwrite_field'), }, { value: 1, - label: i18n.t('ignore_field'), + label: i18n.t('dialogue.field.ignore_field'), }, ] @@ -45,16 +45,16 @@ const onUpdate = (val) => {