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

[3.x] Add context support for editor translation #59187

Merged
merged 1 commit into from
Mar 16, 2022

Conversation

timothyqiu
Copy link
Member

@timothyqiu timothyqiu commented Mar 16, 2022

We're now able to translate property paths and later probably also enum & flags hints. It's more and more likely to encounter situations where the same word/message is used to mean different things. So I think it's necessary to backport the context feature from #40443.

Context is only added to TTR()-related functions and not exposed to scripting for backward compatibility.

In addition to the extract.py and PO parsing changes from the original PR. A Translation subclass ContextTranslation is created to support i18n with context. TranslationLoaderPO::load_translation() will return ContextTranslation instead of the vanilla version when requested. This only happens when loading editor translations.

@akien-mga akien-mga merged commit cd76891 into godotengine:3.x Mar 16, 2022
@akien-mga
Copy link
Member

Thanks!

@timothyqiu timothyqiu deleted the i18n-context branch March 16, 2022 09:04
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