External player choice 'None' translated in Settings (#2075)
* External player choice 'None' translated in Settings * requested fix related to Vue i18n import * suggested changes using translation key and fallback to player name
This commit is contained in:
parent
197abb21d5
commit
f8eff0e422
|
@ -24,7 +24,10 @@ export default Vue.extend({
|
|||
},
|
||||
|
||||
externalPlayerNames: function () {
|
||||
return this.$store.getters.getExternalPlayerNames
|
||||
const fallbackNames = this.$store.getters.getExternalPlayerNames
|
||||
const nameTranslationKeys = this.$store.getters.getExternalPlayerNameTranslationKeys
|
||||
|
||||
return nameTranslationKeys.map((translationKey, idx) => this.$te(translationKey) ? this.$t(translationKey) : fallbackNames[idx])
|
||||
},
|
||||
externalPlayerValues: function () {
|
||||
return this.$store.getters.getExternalPlayerValues
|
||||
|
|
|
@ -107,6 +107,7 @@ const state = {
|
|||
'#B4BEFE'
|
||||
],
|
||||
externalPlayerNames: [],
|
||||
externalPlayerNameTranslationKeys: [],
|
||||
externalPlayerValues: [],
|
||||
externalPlayerCmdArguments: {}
|
||||
}
|
||||
|
@ -168,6 +169,10 @@ const getters = {
|
|||
return state.externalPlayerNames
|
||||
},
|
||||
|
||||
getExternalPlayerNameTranslationKeys () {
|
||||
return state.externalPlayerNameTranslationKeys
|
||||
},
|
||||
|
||||
getExternalPlayerValues () {
|
||||
return state.externalPlayerValues
|
||||
},
|
||||
|
@ -939,10 +944,11 @@ const actions = {
|
|||
}
|
||||
|
||||
const externalPlayerMap = JSON.parse(fileData).map((entry) => {
|
||||
return { name: entry.name, value: entry.value, cmdArguments: entry.cmdArguments }
|
||||
return { name: entry.name, nameTranslationKey: entry.nameTranslationKey, value: entry.value, cmdArguments: entry.cmdArguments }
|
||||
})
|
||||
|
||||
const externalPlayerNames = externalPlayerMap.map((entry) => { return entry.name })
|
||||
const externalPlayerNameTranslationKeys = externalPlayerMap.map((entry) => { return entry.nameTranslationKey })
|
||||
const externalPlayerValues = externalPlayerMap.map((entry) => { return entry.value })
|
||||
const externalPlayerCmdArguments = externalPlayerMap.reduce((result, item) => {
|
||||
result[item.value] = item.cmdArguments
|
||||
|
@ -950,6 +956,7 @@ const actions = {
|
|||
}, {})
|
||||
|
||||
commit('setExternalPlayerNames', externalPlayerNames)
|
||||
commit('setExternalPlayerNameTranslationKeys', externalPlayerNameTranslationKeys)
|
||||
commit('setExternalPlayerValues', externalPlayerValues)
|
||||
commit('setExternalPlayerCmdArguments', externalPlayerCmdArguments)
|
||||
},
|
||||
|
@ -1162,6 +1169,10 @@ const mutations = {
|
|||
state.externalPlayerNames = value
|
||||
},
|
||||
|
||||
setExternalPlayerNameTranslationKeys (state, value) {
|
||||
state.externalPlayerNameTranslationKeys = value
|
||||
},
|
||||
|
||||
setExternalPlayerValues (state, value) {
|
||||
state.externalPlayerValues = value
|
||||
},
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
[
|
||||
{
|
||||
"name": "None",
|
||||
"nameTranslationKey": "Settings.External Player Settings.Players.None.Name",
|
||||
"value": "",
|
||||
"cmdArguments": null
|
||||
},
|
||||
{
|
||||
"name": "mpv",
|
||||
"nameTranslationKey": "Settings.External Player Settings.Players.mpv.Name",
|
||||
"value": "mpv",
|
||||
"cmdArguments": {
|
||||
"defaultExecutable": "mpv",
|
||||
|
@ -23,6 +25,7 @@
|
|||
},
|
||||
{
|
||||
"name": "VLC",
|
||||
"nameTranslationKey": "Settings.External Player Settings.Players.VLC.Name",
|
||||
"value": "vlc",
|
||||
"cmdArguments": {
|
||||
"defaultExecutable": "vlc",
|
||||
|
@ -40,6 +43,7 @@
|
|||
},
|
||||
{
|
||||
"name": "iina",
|
||||
"nameTranslationKey": "Settings.External Player Settings.Players.iina.Name",
|
||||
"value": "iina",
|
||||
"cmdArguments": {
|
||||
"defaultExecutable": "iina",
|
||||
|
|
|
@ -279,6 +279,9 @@ Settings:
|
|||
Ignore Unsupported Action Warnings: Ignore Unsupported Action Warnings
|
||||
Custom External Player Executable: Custom External Player Executable
|
||||
Custom External Player Arguments: Custom External Player Arguments
|
||||
Players:
|
||||
None:
|
||||
Name: None
|
||||
Privacy Settings:
|
||||
Privacy Settings: Privacy Settings
|
||||
Remember History: Remember History
|
||||
|
|
|
@ -383,6 +383,9 @@ Settings:
|
|||
Ignore Unsupported Action Warnings: Omitir advertencias sobre acciones no soportadas
|
||||
External Player: Reproductor externo
|
||||
External Player Settings: Reproductor externo
|
||||
Players:
|
||||
None:
|
||||
Name: Ninguno
|
||||
Download Settings:
|
||||
Download Settings: Descargas
|
||||
Ask Download Path: Preguntar ruta de descarga
|
||||
|
|
Loading…
Reference in New Issue