Poobslag / turbofat

Block-dropping puzzle game
MIT License
54 stars 18 forks source link

Add localization support for Hue, Saturation, Value labels #2580

Closed Poobslag closed 1 month ago

Poobslag commented 3 months ago

Our creature editor has "H/S/V" sliders for Hue, Saturation and Value. In other languages like Spanish, these should probably be "T/S/V" sliders.

Unfortunately, Godot 3.x does not support gettext "context specifiers":

msgctxt Hue/Saturation/Value
msgid H
msgstr T

Without context specifiers, this problem will require a complicated and clumsy workaround. The only option I can think of is to export the strings as something like "hue_label_H", adding code to explicitly retrieve the corresponding translation (instead of relying on Godot's framework) and a script to insert the English translation of "H" so that "hue_label_H" does not appear in the game.

Other more insane, less feasible workarounds include backporting Godot 4's TranslationServer improvements to Godot 3, or switching from GetText to a different translation method such as CSVs.

Poobslag commented 2 months ago

This could also be localized with a single tr("HSV") which I think would be quite elegant.

Poobslag commented 1 month ago

According to Hish of the Turbo Fat discord, the spanish localization of "HSV" is "HSV" anyways. If we support other languages where this is not the case, we can revisit this issue.