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

Use RTR() for VisualScriptNode captions and texts #59035

Merged
merged 1 commit into from
Mar 11, 2022

Conversation

timothyqiu
Copy link
Member

Although caption and text functions are only used by the editor, they are still available at runtime, so TTR() should not be used here.

String VisualScriptPropertySet::get_caption() const {
static const LocalVector<String> opname = {
RTR("Set %s"),
RTR("Add %s"),
RTR("Subtract %s"),
RTR("Multiply %s"),
RTR("Divide %s"),
RTR("Mod %s"),
RTR("ShiftLeft %s"),
RTR("ShiftRight %s"),
RTR("BitAnd %s"),
RTR("BitOr %s"),
RTR("BitXor %s"),
};

This is safe because the static local variable is initialized when first accessed, and TranslationServer is ready at that point. Cherry-picking might need to change this into a if empty block as list initialization is not available for LocalVector on 3.x.

@timothyqiu timothyqiu added bug topic:visualscript cherrypick:3.x Considered for cherry-picking into a future 3.x release labels Mar 11, 2022
@timothyqiu timothyqiu requested a review from a team as a code owner March 11, 2022 16:03
@akien-mga akien-mga merged commit ef347d0 into godotengine:master Mar 11, 2022
@akien-mga
Copy link
Member

Thanks!

@akien-mga akien-mga added this to the 4.0 milestone Mar 11, 2022
@timothyqiu timothyqiu deleted the vs-rtr branch March 12, 2022 01:13
@akien-mga
Copy link
Member

Cherry-picked for 3.5.

@akien-mga akien-mga removed the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Mar 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants