godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.61k stars 21.28k forks source link

Word "Force" is used ambiguously, needs translation context #82788

Closed Wuzzy2 closed 8 months ago

Wuzzy2 commented 1 year ago

Godot version

v4.2.dev.custom_build [f5696c311]

System information

Godot v4.2.dev (f5696c311) - Arch Linux #1 SMP PREEMPT_DYNAMIC Sat, 23 Sep 2023 22:55:13 +0000 - X11 - GLES3 (Compatibility) - Mesa Intel(R) HD Graphics 2000 (SNB GT1) () - Intel(R) Core(TM) i5-2500S CPU @ 2.70GHz (4 Threads)

Issue description

While translating Godot, I noticed there is a string with an ambigious meaning in Godot Properties: "Force".

This string is used with two different meanings:

  1. In editor/import/resource_importer_wav.cpp it is used to force certain WAV import settings in the WAV importer.
  2. But in scene/2d/physics_body_2d.cpp and scene/3d/physics_body_3d.cpp, it is used to mean physical force, something entirely different.

This makes it impossible to translate in some languages. This also applies to v4.1 stable.

The string in Weblate: https://hosted.weblate.org/translate/godot-engine/godot-properties/de/?checksum=b2baabd9a1355710

Suggested fix: To fix this, I suggest to either make use of the Gettext context feature or by changing the string in one of the two contexts.

Steps to reproduce

First, let me show where you can find the string in Godot:

To find the string in the first meaning, go to Project Settings > Import default values, then select the Microsoft WAV importer from the drop-down list. Here you see the word "Force" as a header, meaning to force certain WAV import settings like 8-bit.

For the second meaning, add a RigidBody2D node, select it, and in the inspector go to "Constant Forces". In this section you can also find the word "Froce" (for constant_force), but to mean physical force.

Now try to translate it into German. Oops! It doesn't work. Forcing something translates to "erzwingen" while physical force translates to "Kraft". There is no way in German to work around this. You will probably bump into issues with other languages as well.

Minimal reproduction project

N/A

KoBeWi commented 1 year ago

This can be solved by giving context to the translation. Although not sure if we support it for properties.

timothyqiu commented 1 year ago

Yeah, another example is the word "Normal". It's used both for "Normal" vector of WorldBounaryShape2D and for "Normal" texture / theme item of UI elements. The former usage has a dedicated term in Chinese.

I'll try to make it possible to add context for properties.

yilmazdurmaz commented 1 year ago

If 3.x series is still getting translations, "Switch" has the same issue: "Switch" block for VisualScript, and switching action for animation frames.

timothyqiu commented 1 year ago

Created a proof of concept PR #82852

Some details may need to be refined. Suggestions are welcome.

yilmazdurmaz commented 1 year ago

I don't know how this will show up on Weblate. In case we get two entries for the two meanings, Weblate's "distribute translation" setting needs to be turned off, otherwise they will be coupled to a single translation that renders this work useless.

timothyqiu commented 1 year ago

Strings with different context are different entries (also different from a version without any context). They won't propagate to each other.

Propagation between different Weblate components is not related to this issue.

yilmazdurmaz commented 1 year ago

Strings with different context are different entries (also different from a version without any context). They won't propagate to each other.

Propagation between different Weblate components is not related to this issue.

Thanks, that is nice to hear then. One more question though: should this be done separately every time we find one such string? or do your edits apply a general formulae?

timothyqiu commented 1 year ago

Context should be added separately.

Wuzzy2 commented 1 year ago

I think this should be done on a case-to-case basis. It doesn't seem to happen often.

yilmazdurmaz commented 1 year ago

I tried naive approach and gave up after checking 200 for the moment :) there are 602 single words in editor, and 773 in properties (single words are the most possible places). I leave finding such words in my language to my next run for proof-reading my translations.

thanks for the "force" and "normal"

Mickeon commented 1 year ago

I wonder. Could the description of the Editor Settings themselves be used as translation context? I am aware they come from the documentation's XMLs, but could it be doable...?

timothyqiu commented 1 year ago

Property names don't come from documentation XMLs. They are extracted from C++ source code like this one:

https://github.com/godotengine/godot/blob/6916349697a4339216469e9bf5899b983d78db07/scene/main/canvas_item.cpp#L1220

Using descriptions as contexts will have some problems:

Wuzzy2 commented 1 year ago

Context are expected to be a word or a short sentence. It breaks common editing UI like Poedit and Weblate :P

I worked with both Poedit and Weblate and both support context. Why do you think using context "breaks" these softwares? o_O

I agree that using a description as context is overkill tho; I agree that it is not needed to add a context for everything to fix this issue.

timothyqiu commented 1 year ago

I mean, it breaks the UI, not the software ;) Because those descriptions are very long, and may contain multiple lines.

Wuzzy2 commented 1 year ago

I don't know what happens to the UI of Gettext and Weblate if the context is very long but if it breaks, that's a bug in the software. But I still agree that context should be normally be kept short. Thanks for clarification; I was confused.

Cerno-b commented 11 months ago

Note to self (and anyone who translates): Fix the translation once this ticket is merged.