From 6c6e1f1a9f625c6956f98921f15616558d46d5c6 Mon Sep 17 00:00:00 2001 From: Hawtim Zhang Date: Fri, 23 Oct 2020 11:35:51 +0800 Subject: [PATCH 1/2] feat: settings page i18n supported (#42) * feat: add config to resolve path alias. * feat: use vue-i18n for language switch * feat: add .editorconfig for ide * fix: add no-referrer to avoid CROB * fix: setCookie and fix typo * feat: integrate vue-i18n * feat: player component i18n support * fix: duplicate key warning in explore page * fix: like songs number changed in library page * fire: remove todo * fix: same text search on enter will cause error * fix: scrobble error params type * feat: prettier task supported * fix: prettier ignore config update * fix: conflict * fix: commitMP3 and countrycode to countryCode * lint: prettier * feat: settings page i18n supported --- src/locale/lang/en.js | 12 ++++++++++++ src/locale/lang/zh-CN.js | 12 ++++++++++++ src/views/settings.vue | 34 +++++++++++++++++++--------------- 3 files changed, 43 insertions(+), 15 deletions(-) diff --git a/src/locale/lang/en.js b/src/locale/lang/en.js index cea3a0c..051e7b3 100644 --- a/src/locale/lang/en.js +++ b/src/locale/lang/en.js @@ -97,4 +97,16 @@ export default { common: { songs: "Songs", }, + settings: { + settings: "Settings", + logout: "LOGOUT", + language: "Languages", + musicQuality: { + text: "Music Quality", + low: "Low", + medium: "Medium", + high: "High", + lossless: "Lossless", + }, + }, }; diff --git a/src/locale/lang/zh-CN.js b/src/locale/lang/zh-CN.js index ee9eaac..d14746d 100644 --- a/src/locale/lang/zh-CN.js +++ b/src/locale/lang/zh-CN.js @@ -102,4 +102,16 @@ export default { common: { songs: "首歌", }, + settings: { + settings: "选项", + logout: "登出", + language: "语言", + musicQuality: { + text: "音质选择", + low: "普通", + medium: "较高", + high: "极高", + lossless: "无损", + }, + }, }; diff --git a/src/views/settings.vue b/src/views/settings.vue index 8bad1c4..7277fd5 100644 --- a/src/views/settings.vue +++ b/src/views/settings.vue @@ -18,18 +18,16 @@
- +
- -

Settings

+

{{ $t("settings.settings") }}

-
- Languages -
+
{{ $t("settings.language") }}
- - - - + + + +
From 23d4ab3b9dea1123378f8ba4f95af5d630cafddd Mon Sep 17 00:00:00 2001 From: qier222 <68148142+qier222@users.noreply.github.com> Date: Fri, 23 Oct 2020 13:34:17 +0800 Subject: [PATCH 2/2] fix: set default music quality to 320Kbps --- src/api/track.js | 2 +- src/store/initState.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/api/track.js b/src/api/track.js index 1bbcfe8..f3244fd 100644 --- a/src/api/track.js +++ b/src/api/track.js @@ -6,7 +6,7 @@ export function getMP3(id) { let br = store.state.settings?.musicQuality !== undefined ? store.state.settings.musicQuality - : 128000; + : 320000; return request({ url: "/song/url", method: "get", diff --git a/src/store/initState.js b/src/store/initState.js index 6442ecc..70c45a0 100644 --- a/src/store/initState.js +++ b/src/store/initState.js @@ -85,6 +85,7 @@ const initState = { id: 0, }, lang: null, + musicQuality: 320000, }, };