Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

External player choice 'None' translated in Settings #2075

Merged
merged 3 commits into from
Aug 10, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default Vue.extend({
},

externalPlayerNames: function () {
return this.$store.getters.getExternalPlayerNames
return this.$store.getters.getExternalPlayerNames.map((value) => this.$t(value))
},
externalPlayerValues: function () {
return this.$store.getters.getExternalPlayerValues
Expand Down
2 changes: 1 addition & 1 deletion static/external-player-map.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[
{
"name": "None",
"name": "Settings.External Player Settings.None",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe a different key should be added called "translated" that is a bool value and the translating part of the code will only use the "$t" function if translated is true to avoid warnings from this PR

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now I notice that the other names are not translated

Copy link
Collaborator

@PikachuEXE PikachuEXE May 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another way I can think of would be

this.$te(value) ? this.$t(value) : value

$te checks whether the translation key exists

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another way I can think of would be

this.$te(value) ? this.$t(value) : value

$te checks whether the translation key exists

that's probably the better way to do it. was not aware of the te function

"value": "",
"cmdArguments": null
},
Expand Down
1 change: 1 addition & 0 deletions static/locales/en-US.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ Settings:
External Player Settings:
External Player Settings: External Player Settings
External Player: External Player
None: None
Ignore Unsupported Action Warnings: Ignore Unsupported Action Warnings
Custom External Player Executable: Custom External Player Executable
Custom External Player Arguments: Custom External Player Arguments
Expand Down