-
-
Notifications
You must be signed in to change notification settings - Fork 23.8k
Editor: Show actual class name in resource picker tooltips #113679
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
Conversation
|
|
||
| if (num_of_copies > 1) { | ||
| tooltip = vformat(TTR("This Resource is used in (%d) places."), num_of_copies); | ||
| tooltip = vformat(TTRN("This %s is used in %d place.", "This %s is used in %d places.", num_of_copies), resource_name, num_of_copies); |
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.
Could the first string be empty or something? There resource will never be used in only one place.
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.
I thought about it but it might be better to leave it instead.
An empty string might break the template generation since "" is reserved for the PO file metadata in gettext if I remember correctly.
Worst case scenario, the first string never gets used.
What do you think?
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.
That's more a question to @timothyqiu
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.
resource_name is used to format strings for translation and is not translated itself. So whether it is empty has nothing to do with TTRN / PO. I believe you need to consider the possibility of it being empty because if it is empty, the resulting formatted string might look strange.
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.
So if I understand correctly the first string ("This %s is used in %d place.") can be empty as @KoBeWi suggested?
Or do you mean that we should make sure that the variable resource is never empty since it could mess up the formatted string?
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.
Oh, I thought you were referring to the first placeholder.
In addition to technical requirements, the arguments of TTRN will be provided to translators as a reference. Therefore, they should not be left blank.
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.
Thank you
e27f120 to
85dff52
Compare
| tooltip += "\n" + vformat(TTR("The %s cannot be edited in the inspector and can't be made unique directly."), resource_name) + "\n"; | ||
| } else { | ||
| tooltip += unique_enable ? TTR(" Left-click to make it unique.") + "\n" : "\n"; | ||
| tooltip += "\n" + TTR("Left-click to make it unique.") + "\n"; |
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.
What happened to unique_enable?
It should be something like
| tooltip += "\n" + TTR("Left-click to make it unique.") + "\n"; | |
| if (unique_enable) { | |
| tooltip += "\n" + TTR("Left-click to make it unique.") + "\n"; | |
| } |
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.
Nice catch, I misread the logic there and removed the unique_enable by mistake.
edf17d6 to
bb92a4c
Compare
|
Closing this to clean up the commit history, sorry. Superseded by #113828 |

This fixes #113310