Open awardell opened 8 months ago
@SkyLucilfer it appears you are the author of the translation_po files.
I would also be very interested in understanding this. As best I can tell--you may be able to add context through gettext formats but not CSV:
Also tried looking at: https://github.com/godotengine/godot/blob/42e5b3ac2da07d2105c775977b39e6949c723ded/core/io/resource_loader.cpp#L1117
To understand how it was loading the CSV, but to no avail so I moved on to the editors actual import process:
This proved also unhelpful to me because I'm not great at C++ and 1 to 2 letter variable names. My goal was to try and understand HOW Godot is reading the CSV files to see how where within the CSV it's looking for a cell/column that has context. I failed. I welcome someone else to try however.
I also tracked the above down--it would seem like, to the best of my understanding, that when the CSV is imported there is no context being looked for. Just the ID and locale columns: specifically at this line in the loop: https://github.com/godotengine/godot/blob/42e5b3ac2da07d2105c775977b39e6949c723ded/editor/import/resource_importer_csv_translation.cpp#L130C5-L130C79
Godot 4.x
The Issue
There is a class TranslationPO. It has been around for maybe 3 years, and yet there is zero mention of it in the docs.
A user posted on the Godot forums here that they could not understand how "context" was supposed to be utilized in localization, although it was clear that it is the feature they need. The only explanation of "context" in the docs is a small paragraph and example in the page on Internationalizing games.
"Close", as in a distance (opposite of "far").
distance_label.set_text(tr("Close", "Distance"))