From 48fa172169e35efb929f4e1cf92d27491b6691f5 Mon Sep 17 00:00:00 2001 From: liushuyu Date: Thu, 28 May 2020 00:37:20 -0600 Subject: [PATCH] meta: refine i18n and mark more strings --- ui/mock-server.js | 6 ------ ui/package.json | 1 + ui/src/locales/en.json | 8 +++++-- ui/src/main.js | 1 + ui/src/views/InstallPackages.vue | 2 +- ui/src/views/ModifyView.vue | 37 +++++++++++++++++++++++--------- ui/src/views/SelectPackages.vue | 8 +++---- ui/yarn.lock | 5 +++++ 8 files changed, 45 insertions(+), 23 deletions(-) diff --git a/ui/mock-server.js b/ui/mock-server.js index fc03b12..927d666 100644 --- a/ui/mock-server.js +++ b/ui/mock-server.js @@ -113,12 +113,6 @@ app.get('/api/exit', (req, res) => { res.status(204).send() }) -app.get('/api/mock_error', (req, res) => { - console.log('-- Toggle error emulation') - showError = !showError - res.status(200).send(`Error emulation: ${showError}\n`) -}) - app.post('/api/verify-path', (req, res) => { console.log('-- Verify Path') res.send({ diff --git a/ui/package.json b/ui/package.json index 7571289..214f603 100644 --- a/ui/package.json +++ b/ui/package.json @@ -9,6 +9,7 @@ "postinstall": "node merge-strings.js" }, "dependencies": { + "@mdi/font": "^5.3.45", "axios": "^0.19.2", "buefy": "^0.8.20", "vue": "^2.6.11", diff --git a/ui/src/locales/en.json b/ui/src/locales/en.json index 007655e..b1b6c1f 100644 --- a/ui/src/locales/en.json +++ b/ui/src/locales/en.json @@ -21,7 +21,9 @@ "repair": "Repair", "location":"Install Location", "location_placeholder":"Enter a install path here", - "select":"Select" + "select":"Select", + "overwriting": "Overwriting", + "overwriting_warning": "Directory {path} already exists.
Are you sure you want to overwrite the contents inside?" }, "install_packages":{ "check_for_update":"Checking for updates...", @@ -55,6 +57,8 @@ "back":"Back", "exit":"Exit", "yes":"Yes", - "no":"No" + "no":"No", + "continue": "Continue", + "cancel":"Cancel" } } diff --git a/ui/src/main.js b/ui/src/main.js index 6544040..b8f456a 100644 --- a/ui/src/main.js +++ b/ui/src/main.js @@ -8,6 +8,7 @@ import { stream_ajax as streamAjax } from './helpers' import Buefy from 'buefy' import messages from './locales/messages.json' import 'buefy/dist/buefy.css' +import '@mdi/font/css/materialdesignicons.min.css' Vue.config.productionTip = false Vue.use(Buefy) diff --git a/ui/src/views/InstallPackages.vue b/ui/src/views/InstallPackages.vue index 291ae8a..85a1700 100644 --- a/ui/src/views/InstallPackages.vue +++ b/ui/src/views/InstallPackages.vue @@ -54,7 +54,7 @@ export default { results.path = app.install_location if (this.is_repair) { - results['mode'] = 'force' + results.mode = 'force' } var targetUrl = '/api/start-install' diff --git a/ui/src/views/ModifyView.vue b/ui/src/views/ModifyView.vue index d5f79a3..ebfad50 100644 --- a/ui/src/views/ModifyView.vue +++ b/ui/src/views/ModifyView.vue @@ -2,33 +2,33 @@

{{ $t('modify.title') }}

- + {{ $t('modify.update') }}

- + {{ $t('modify.modify') }}

- + {{ $t('modify.repair') }} - +


- + {{ $t('modify.uninstall') }} - +


- + {{ $t('modify.view_local_files') }} - +
@@ -51,8 +51,9 @@ export default { prepare_uninstall: function () { this.$buefy.dialog.confirm({ title: this.$t('modify.uninstall'), - message: this.$t('modify.prompt', {'name': this.$root.$data.attrs.name}), - confirmText: this.$t('modify.prompt_confirm', {'name': this.$root.$data.attrs.name}), + message: this.$t('modify.prompt', { name: this.$root.$data.attrs.name }), + cancelText: this.$t('cancel'), + confirmText: this.$t('modify.prompt_confirm', { name: this.$root.$data.attrs.name }), type: 'is-danger', hasIcon: true, onConfirm: this.uninstall @@ -65,3 +66,19 @@ export default { } } + + diff --git a/ui/src/views/SelectPackages.vue b/ui/src/views/SelectPackages.vue index da36540..c43c0fc 100644 --- a/ui/src/views/SelectPackages.vue +++ b/ui/src/views/SelectPackages.vue @@ -83,10 +83,10 @@ export default { }, show_overwrite_dialog: function (confirmCallback) { this.$buefy.dialog.confirm({ - title: 'Overwriting', - message: `Directory ${this.$root.$data.install_location} already exists.
- Are you sure you want to overwrite the contents inside?`, - confirmText: 'Continue', + title: this.$t('select_packages.overwriting'), + message: this.$t('select_packages.overwriting_warning', { path: this.$root.$data.install_location }), + confirmText: this.$t('continue'), + cancelText: this.$t('cancel'), type: 'is-danger', hasIcon: true, onConfirm: confirmCallback diff --git a/ui/yarn.lock b/ui/yarn.lock index 6895535..c864da0 100644 --- a/ui/yarn.lock +++ b/ui/yarn.lock @@ -863,6 +863,11 @@ cssnano-preset-default "^4.0.0" postcss "^7.0.0" +"@mdi/font@^5.3.45": + version "5.3.45" + resolved "https://registry.yarnpkg.com/@mdi/font/-/font-5.3.45.tgz#086d3ef77dee260c04dd5a593af602c250e5b315" + integrity sha512-SD5d2vHEKRvDCInZQFXOwiFpBlzpuZOiqwxKf6E+zCt7UDc52TUSrL0+TXqY57VQh/SnTpZVXM+Uvs21OdPFWg== + "@mrmlnc/readdir-enhanced@^2.2.1": version "2.2.1" resolved "https://registry.yarnpkg.com/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz#524af240d1a360527b730475ecfa1344aa540dde"