-
Notifications
You must be signed in to change notification settings - Fork 900
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
Conversation
src/renderer/components/external-player-settings/external-player-settings.js
Outdated
Show resolved
Hide resolved
Head branch was pushed to by a user without write access
@PrestonN ? |
static/external-player-map.json
Outdated
@@ -1,6 +1,6 @@ | |||
[ | |||
{ | |||
"name": "None", | |||
"name": "Settings.External Player Settings.None", |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
that's probably the better way to do it. was not aware of the te function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use $te
then
Should I name the null player "None" or keep the changes and name it with the translation key "Settings.External Player Settings.None"? |
I think the return this.$store.getters.getExternalPlayerNames.map((value) => this.$te(value) ? this.$t(value) : value) (Please test before committing, coz I haven't :P) |
It works fine with the other players but the null one appears as |
I think it is because the |
I made some changes on my own branch Some screenshots: When using jp (without translation) When using en (with translation) Let me know what you think Edit: The commit is PikachuEXE@410ff60 in case you want to look at diff |
Head branch was pushed to by a user without write access
52175f8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally
Took me sometime to figure which one is es
@PrestonN looks like you might need to approve this one for it to get merged |
External player choice 'None' translatable in Settings
Important note
We may remove your pull request if you do not use this provided PR template correctly.
Pull Request Type
Please select what type of pull request this is:
Related issue
closes #1670
Description
Enables the translation of the word 'None' in the external player selector in the Settings menu. In order to do that the name of the first player is changed from 'None' to a translatable string and the whole array of names is translated. (Only the 'none' one has a translation, the other ones remain the same)
Testing (for code that is not small enough to be easily understandable)
Just tested if the word is substituted by the one on the locales file
Desktop (please complete the following information):
Additional context
Is the first time I contribute to a project and also the first time using Vue, and haven't done a lot of things in JS, so if there is anything wrong with Vue or the format of the code tell me and I will try fix it