Opened 6 years ago
Last modified 6 years ago
#4891 new defect
Translations should have a way to indicate the target is a button and should be kept short
Reported by: | mimo | Owned by: | |
---|---|---|---|
Priority: | Should Have | Milestone: | Backlog |
Component: | Internationalization & Localization | Keywords: | |
Cc: | Patch: |
Description (last modified by )
Translations should have a way to indicate the target is a button (or in fact any gui element) and should be kept as short as possible. I don't know if it should go through a special context, or something else, but see for example phab:D1100 with "AI difficulty" translated into "Nível de dificuldade do jogador artificial" in portuguese. I'm pretty sure there are ways to be more concise if the translator knew this was for a limited-in-space gui element, while this translation is fine for any tooltip or whatever not limited by length.
Change History (10)
comment:1 by , 6 years ago
Description: | modified (diff) |
---|
follow-up: 4 comment:2 by , 6 years ago
follow-up: 5 comment:3 by , 6 years ago
Deriving which GUI object that is and it's object size will be extremely hard (we only have a simple python script which reads the file from top to bottom, never interpreting more than one line (and the line above) at a time
follow-up: 6 comment:4 by , 6 years ago
Replying to elexis:
We have translation comments for that, don't we?
// Translation: keep it below 120 characters foo = translate("title...")
and how is the translator aware of that ?
comment:5 by , 6 years ago
Replying to elexis:
Deriving which GUI object that is and it's object size will be extremely hard (we only have a simple python script which reads the file from top to bottom, never interpreting more than one line (and the line above) at a time
Agree, and that was not what was proposed. I've never looked in details at translations, but i think giving a context "button" or something like that could tell the translator that he should be as concise as possible.
comment:6 by , 6 years ago
Replying to mimo:
Replying to elexis:
// Translation: keep it below 120 characters foo = translate("title...")and how is the translator aware of that ?
Translation comments are written by developers for translators. They are seen on transifex.
Take for instance gamesetup.js
:
// Translation: Make sure to differentiate between the revealed map and explored map options! translate("Revealed Map"),
When logging in on transifex, chosing gui-gamesetup resource, then the language and clicking on start translation, then searching for "reveal map", we see the string and that translation comment:
(The source/tools/i18n/updateTemplates.py
script is the one that extracts all strings from the source to *.pot
files. The different mechanisms for the different file types (cpp, xml, js, txt, json, ini) are defined in extractors.py
and that is a really 'dumb' extraction system, which is why for instance we may not have multiple lines in the same string).
(wiki:Internationalization_and_Localization)
It's indeed a systematic issue that strings and GUI sizes differ. Not sure how to solve it systematically however, since some GUI objects resize dynamically.
In fact we have a ticket to resize some GUI objects according to their text size: #4252 (similar case). For instance the counters in the top right hand side (ceasefire, gametime, date, ping) do that already.
What we really need is someone who gives feedback to transifex, like gallaecio, sanderd17 and leper did and running the long string tests frequently. Also translators should report to us that our labels are too small (they actually do, but often we leave it up on trac)
comment:7 by , 6 years ago
If translation comments satisfy the need to pass that information, should we close this ticket?
comment:8 by , 6 years ago
It depends what is felt important: are we satisfied by having some potential possibility not used, or do we think something more should be done to enforce its use.
follow-up: 10 comment:9 by , 6 years ago
I just wonder what should be implemented.
The extraction tool could for instance look for more than one line above the string and add a new field:
// Translation limit: 200
(// Translation GUI Type: label
would not really imply a statement about the length)
comment:10 by , 6 years ago
Replying to elexis:
(
// Translation GUI Type: label
would not really imply a statement about the length)
Yes something like that (what i called before a context "button"). I think it is not so important to give a length, but to warn the translator that it should be as short as possible. In the example quoted in the ticket description, that would inform the translator to not translate by "Artificial Intelligence" if "AI" is understood in its language, and not add "level of difficulty" if "difficulty" is already clear enough for a button.
We have translation comments for that, don't we?