Replace hardcoded strings

This commit is contained in:
kyw504100 2022-02-13 00:20:23 +08:00
parent 7a60451877
commit 04b7ea9e59
No known key found for this signature in database
GPG key ID: 9116E2159A0521FD
3 changed files with 14 additions and 6 deletions

View file

@ -141,6 +141,8 @@
"term.addedpreset": "Added Preset", "term.addedpreset": "Added Preset",
"term.deletepreset.warn": "Are you sure you want to delete this preset?", "term.deletepreset.warn": "Are you sure you want to delete this preset?",
"term.deletedpreset": "Removed preset", "term.deletedpreset": "Removed preset",
"term.defaultPresets": "Default Presets",
"term.userPresets": "User Presets",
"term.requestError": "There was a problem with the request.", "term.requestError": "There was a problem with the request.",
"term.song.link.generate": "Getting song.link share URL...", "term.song.link.generate": "Getting song.link share URL...",
"term.musicVideos": "Music Videos", // Search page friendlyTypes "term.musicVideos": "Music Videos", // Search page friendlyTypes
@ -296,6 +298,10 @@
"settings.header.visual.hardwareAcceleration.default": "Default", "settings.header.visual.hardwareAcceleration.default": "Default",
"settings.header.visual.hardwareAcceleration.webGPU": "WebGPU", "settings.header.visual.hardwareAcceleration.webGPU": "WebGPU",
"settings.header.visual.theme": "Theme", "settings.header.visual.theme": "Theme",
"settings.option.visual.theme.github.download": "Install from GitHub URL",
"settings.prompt.visual.theme.github.URL": "Enter the URL of the theme you want to install",
"settings.notyf.visual.theme.install.success": "Theme installed successfully",
"settings.notyf.visual.theme.install.error": "Theme installation failed",
// Settings - Visual - Theme name // Settings - Visual - Theme name
"settings.option.visual.theme.default": "Cider", "settings.option.visual.theme.default": "Cider",

View file

@ -6,10 +6,10 @@
<button class="close-btn" @click="close()"></button> <button class="close-btn" @click="close()"></button>
<div class="md-option-segment md-option-segment_auto"> <div class="md-option-segment md-option-segment_auto">
<select class="md-select" style="width:220px;text-align:center;margin-right:245px" v-model="$root.cfg.audio.equalizer.preset" v-on:change="changePreset($root.cfg.audio.equalizer.preset)"> <select class="md-select" style="width:220px;text-align:center;margin-right:245px" v-model="$root.cfg.audio.equalizer.preset" v-on:change="changePreset($root.cfg.audio.equalizer.preset)">
<optgroup label="User Presets"> <optgroup :label="app.getLz('term.userPresets')">
<option v-for="preset in $root.cfg.audio.equalizer.presets" :value="preset.preset">{{preset.name}}</option> <option v-for="preset in $root.cfg.audio.equalizer.presets" :value="preset.preset">{{preset.name}}</option>
</optgroup> </optgroup>
<optgroup label="Default Presets"> <optgroup :label="app.getLz('term.defaultPresets')">
<option v-for="preset in defaultPresets" :value="preset.preset">{{preset.name}}</option> <option v-for="preset in defaultPresets" :value="preset.preset">{{preset.name}}</option>
</optgroup> </optgroup>
</select> </select>

View file

@ -132,7 +132,9 @@
<option value="dark.less">{{$root.getLz('settings.option.visual.theme.dark')}}</option> <option value="dark.less">{{$root.getLz('settings.option.visual.theme.dark')}}</option>
<option v-for="theme in themes" :value="theme.file">{{ theme.name }}</option> <option v-for="theme in themes" :value="theme.file">{{ theme.name }}</option>
</select> </select>
<button class="md-btn md-btn-small md-btn-block" @click="installTheme()" style="margin-top: 8px">Install from GitHub URL</button> <button class="md-btn md-btn-small md-btn-block" @click="installTheme()" style="margin-top: 8px">
{{$root.getLz('settings.option.visual.theme.github.download')}}
</button>
</div> </div>
</div> </div>
<div class="md-option-line"> <div class="md-option-line">
@ -774,14 +776,14 @@
methods: { methods: {
installTheme() { installTheme() {
let self = this let self = this
bootbox.prompt("Enter the URL of the theme you want to install", (result) => { bootbox.prompt(app.getLz('settings.prompt.visual.theme.github.URL'), (result) => {
if (result) { if (result) {
ipcRenderer.once("theme-installed", (event, arg) => { ipcRenderer.once("theme-installed", (event, arg) => {
if (arg.success) { if (arg.success) {
self.themes = ipcRenderer.sendSync("get-themes") self.themes = ipcRenderer.sendSync("get-themes")
notyf.success("Theme installed successfully"); notyf.success(app.getLz('settings.notyf.visual.theme.install.success'));
} else { } else {
notyf.error("Theme installation failed"); notyf.error(app.getLz('settings.notyf.visual.theme.install.error'));
} }
}); });
ipcRenderer.invoke("get-github-theme", result) ipcRenderer.invoke("get-github-theme", result)