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

Provide official translations for run-time localized strings (RTR() / RTRN()) #7334

Open
Calinou opened this issue Jul 19, 2023 · 5 comments

Comments

@Calinou
Copy link
Member

Calinou commented Jul 19, 2023

Describe the project you are working on

The Godot editor 🙂

Describe the problem or limitation you are having in your project

Godot features hundreds of strings that are localized at run-time, but no official translation is currently provided for them. See the RTR() and RTRN() macros' descriptions for details.

These strings are used in places such as FileDialog, ColorPicker, LineEdit/TextEdit's context menus, and more. These can all be seen in exported projects and when running the project from the editor.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Provide official translations for run-time localized strings (RTR() / RTRN()).

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

I recommend using the PO format as opposed to CSV, as it supports pluralization and translation contexts.

These are the steps that would have to be followed:

  • Create a new project "Godot Runtime Translations" within the Godot Engine organization on Weblate.
  • Generate a POT file to feed to the newly created project on Weblate from RTR() and RTRN() strings.
  • Distribute PO files to be added to the Translations tab by the user in the Project Settings. It is possible to have several localization files for a single language in a project, so you can keep using your own PO or CSV files alongside.
    • I recommend creating a repository that can be downloaded as a ZIP file with all translations, then you can choose what to copy in your project. This avoids increasing editor and project binary sizes if the user doesn't need the translations.
    • We could have a button in the editor to download translations matching your Godot version from a fixed URL (e.g. based on Git tags or branches).
    • Binary MO files could also be distributed for greater size efficiency and faster loading speeds.

If this enhancement will not be used often, can it be worked around with a few lines of script?

No.

Is there a reason why this should be core and not an add-on in the asset library?

It is possible for users to localize those strings themselves, but only if they know the target language. Achieving 100% completion is also pretty time-consuming.

In theory, you could download a community-made translation for all the run-time localized strings. However, to my knowledge, no such translation packs exist.

@KoBeWi
Copy link
Member

KoBeWi commented Jul 19, 2023

Related: #3827

@ghost
Copy link

ghost commented Jul 20, 2023

I liked the proposal, it also solves #3827 very well in my opinion.

@programnoir
Copy link

Thanks for creating this proposal. I agree with it and #3827. This should also be accompanied with documentation on using the PO format in a project.

@AThousandShips
Copy link
Member

AThousandShips commented Jul 31, 2023

@programnoir what do you feel is missing from the documentation here and here?

@programnoir
Copy link

programnoir commented Aug 1, 2023

Ah, sorry, thank you very much for linking me to those pages. I had only known about CSV based translations until very recently and I should've searched for the gettext system documentation before making the suggestion. I appreciate your patience with me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants