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
Support second line for "AUDIO / ZOOM OPTIONS" message #345
Support second line for "AUDIO / ZOOM OPTIONS" message #345
Conversation
src/frontend.cpp
Outdated
// initialize its msgstr to a copy of header contents | ||
// TRANSLATORS: This placeholder message provides an extra line | ||
// for the translation of the sidetext "AUDIO / ZOOM OPTIONS" | ||
_(" "); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is a placeholder, why don't we change it to something obvious like "<"AUDIO / ZOOM OPTIONS" - OPTIONAL SECOND LINE - SET TO EMPTY IF NOT REQUIRED>"
, and then just ignore it if it's empty or that string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is a placeholder, why don't we change it to something obvious like
"<AUDIO / ZOOM OPTIONS - OPTIONAL SECOND LINE - SET TO EMPTY IF NOT REQUIRED>"
[...]
This is too obscure.
My translator comment should sufficiently explain the message's meaning.
Alternatively, a msgctxt keyword could be used, but it is unnecessary.
[...] and then just ignore it if it's empty or that string.
I have implemented this.
In addition, removing the message " " from all PO files ensures that
update-po.sh; make update-po
will recreate it as untranslated message
directly below the message which it complements:
#. TRANSLATORS: "AUDIO" options determine the volume of game sounds.
#. "OPTIONS" means "SETTINGS".
#: src/frontend.cpp:926
msgid "AUDIO / ZOOM OPTIONS"
msgstr "AUDIO- UND ZOOMEINSTELLUNGEN"
#. TRANSLATORS: This placeholder message provides an extra line
#. for the translation of the sidetext "AUDIO / ZOOM OPTIONS"
#: src/frontend.cpp:932
msgid " "
msgstr ""
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it make more sense to either allow a \n
in the msgstr or implement word wrapping than to have a separate one for the second line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it make more sense to either allow a
\n
in the msgstr [...]
I briefly considered this, but there were too many problems.
You'd have to parse the msgstr to ensure all escape sequences except for
the first newline are ignored, warn about any syntax errors and explain
the format to translators, who may be unfamiliar with format specifiers.
or implement word wrapping [...]
Line breaking rules differ across languages (example).
Supporting non-breaking (hard) and optional (soft) hyphens is required
to support merely the conventions of English. I prefer not to.
Of course, you can prove me wrong with a patch implementing your ideas.
aeea06d
to
bd83316
Compare
As a paragraph separator for campaign mission briefings, this text should not be translatable. Fixes Warzone2100#345
* allows correct translation of this sidetext into foreign languages within a window size of 640x480 pixels (the minium screen resolution) * untranslated, the placeholder text consists of a single space Refs ticket:4629 Fixes Warzone2100#345
* do not break minimum screen resolution of 640x480 pixels * show sidetext on two lines, using a placeholder message added in Warzone2100#345 Refs Warzone2100#345 Fixes Warzone2100#328
Thinking about this a bit more, adding an "empty" translation string to permit a second line for this particular entry in the translation file just doesn't strike me as the right approach.
A solution for this problem is definitely warranted, but I'm not sure heading down this path is the right one. |
Correct.
While this is true, we probably don't have the resources to ensure every Even far better-run open source games like 0 A.D. do not manage to avoid If users want to set a custom font, that's up to them. I think that the way forward is to improve the GUI layout gradually. Of course, an alternative is to rewrite the GUI layout from scratch, and
In gettext, translator comments are supposed to provide context.
I think that any good translation platform displays translator comments,
I would appreciate a better solution, yet your complaint seems like |
I have been working off-and-on on proper script detection and multi-line / paragraph shaping support for the text engine. No idea when it'll be in shape to review, but it's at least (tentatively) being worked on. (No guarantees, though, of course.)
This is also ultimately the goal. Nothing to review yet.
The issue is proximity. I am not aware of a way to guarantee that the second line is tied to the first line in those various online translation platforms, as the way they display and sort translation strings is different from that of a flat .po file (and also allows filtering / sorting / etc). This, in my opinion, makes the way this PR is currently structured very problematic. Ultimately, the benefits of a translation platform outweigh this specific downside.
Since the ultimate, exhaustive fix (an improved text layout / shaping / splitting engine) is not likely to be ready soon, here are some alternatives:
If we want a stop-gap patch for now, that enables a second line for all side-text, I'm leaning towards 2. Yes it requires a translation comment to inform translators, but so does this current PR. And sure, it isn't exhaustive escape sequence parsing, but the specific problem you identified is "how do we split side-text into a second line", and it solves that without the disadvantages of the currently-proposed .po solution. |
As a paragraph separator for campaign mission briefings, this text should not be translatable. Fixes Warzone2100#345
* add support for optional delimiter "\n" to show message on two lines so that it can be translated correctly within a 640x480 pixel window (that is, the minium screen resolution) * only process the first delimiter, ignoring all others that may follow * note that the messages's translation must not begin or end with "\n" (otherwise msgfmt will terminate with a fatal error) Refs ticket:4629 Fixes Warzone2100#345
bd83316
to
bd0514f
Compare
* do not break minimum screen resolution of 640x480 pixels * show sidetext on two lines, using a message delimiter added in Warzone2100#345 Refs Warzone2100#345 Fixes Warzone2100#328
Thanks, @Forgon2100 - this resolves the concerns re: the translation platform. 👍 |
As a paragraph separator for campaign mission briefings, this text should not be translatable. Fixes #345
The translation of the sidetext "AUDIO / ZOOM OPTIONS" is too long in
some foreign languages so that it cannot fit in the 640x480 screen.
Therefore, an optional delimiter "\n" allows to split it into two lines.
Any additional instances of that delimiter are ignored.
Note that the message's translation must not begin or end with "\n",
because otherwise msgfmt will terminate with a fatal error. Example:
PO file:
Partial output of
make -C po update-po
:The attached ZIP file contains
As a paragraph separator for campaign mission briefings, the string " "
should not be translatable. That same message remains commented out in
the following lines of data/base/messages/strings/resstrings.txt:
translation_placeholder_documentation.zip