Most of the time, translators don't want specific names to be translated, but, at most, transcribed.
This adds context to specific names, because that is not clear from within Transifex.
Details
Diff Detail
- Repository
- rP 0 A.D. Public Repository
- Branch
- /ps/trunk
- Lint
Lint OK - Unit
No Unit Test Coverage - Build Status
Buildable 15469 Build 33875: Vulcan Build Jenkins Build 33874: Vulcan Build (macOS) Jenkins Build 33873: Vulcan Build (Windows) Jenkins Build 33872: arc lint + arc unit
Event Timeline
Build is green
builderr-debug-macos.txt /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/liblobby_dbg.a(precompiled.o) has no symbols /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libengine_dbg.a(precompiled.o) has no symbols ld: warning: text-based stub file /System/Library/Frameworks//CoreAudio.framework/CoreAudio.tbd and library file /System/Library/Frameworks//CoreAudio.framework/CoreAudio are out of sync. Falling back to library file for linking. ld: warning: text-based stub file /System/Library/Frameworks//AudioToolbox.framework/AudioToolbox.tbd and library file /System/Library/Frameworks//AudioToolbox.framework/AudioToolbox are out of sync. Falling back to library file for linking. ld: warning: text-based stub file /System/Library/Frameworks//ForceFeedback.framework/ForceFeedback.tbd and library file /System/Library/Frameworks//ForceFeedba
See https://jenkins.wildfiregames.com/job/macos-differential/3100/display/redirect for more details.
Can we add more context that this? E.g. “The entity's specific name. It should usually not be translated unless you're using a different alphabet” or something?
As @Stan already pointed out, just “specific name” is not really that clear for translators.
Also, would it be possible to have custom contexts, e.g.
<SpecificName context="ὁπλοθήκη">Hoplothēkē</SpecificName>
And would adding a context cause all these strings to be retranslated?
Furthermore, it seems transifex groups strings by file location, e.g.
- simulation/templates/structures/ → “Buildings”
- simulation/templates/units/ → “Units”
- simulation/templates/ → “Misc. Templates”
While this may make sense for people familiar with the 0 A.D. public folder, it's less obviously beneficial for translators. I suppose it's not possible to have a transifex group for all specific names and another for all other strings from all simulation templates?
binaries/data/mods/public/maps/random/ardennes_forest.json | ||
---|---|---|
5 | This should be done, but as a consequence the entire string will have to be retranslated, therefore postpone it to A25. |
It seems changing context breaks translations but not directly see r24420.
It did take a long time to get there though
rP24350 was the commit.
rP24370 was the pot change and fr.public-templates-units.po was changed but translation was not invalidated
rP24420 was the actual change in translation for fr.public-templates-units.po
rP24760 was when I translated it myself.
I think having greek in the context would make things worse? Not all translators can read that.
Furthermore, it seems transifex groups strings by file location, e.g.
- simulation/templates/structures/ → “Buildings”
- simulation/templates/units/ → “Units”
- simulation/templates/ → “Misc. Templates”
While this may make sense for people familiar with the 0 A.D. public folder, it's less obviously beneficial for translators. I suppose it's not possible to have a transifex group for all specific names and another for all other strings from all simulation templates?
I don't think it's possible no, since it's only one line in all the files. If specific names were elsewhere, maybe.
Yes, context and "ID string" are both used to determine a translation.
- simulation/templates/structures/ → “Buildings”
- simulation/templates/units/ → “Units”
- simulation/templates/ → “Misc. Templates”
This is defined in i10n/messages.json
rP24350 was the commit.
rP24370 was the pot change and fr.public-templates-units.po was changed but translation was not invalidated
rP24420 was the actual change in translation for fr.public-templates-units.po
rP24760 was when I translated it myself.
Quite expected. First you committed. Then i18n scripts ran, updated the "PO template" (aka .pot). That immediately invalidated the translations on transfix, but the .po files got picked up only on the next run (presumably because transifex isn't real-time). Then you translated it and the translation for picked up in the .po file.
I think having greek in the context would make things worse? Not all translators can read that.
It makes it clear it's not an English word and does explain why it's written the way it is.
I don't think it's possible no, since it's only one line in all the files. If specific names were elsewhere, maybe.
This is defined in i10n/messages.json
Looking at the file, I think it's not only possible, but also not too difficult to do, actually.
binaries/data/mods/public/maps/random/ardennes_forest.json | ||
---|---|---|
5 | Included in D3493. |
This patch was indeed meant for A25.
Looking forward to your diff ;)
Nah, not sure it is an improvement indeed. Any suggestion for the context string?
Looking forward to your diff ;)
It would conflict with this one, though.
Nah, not sure it is an improvement indeed.
While 0 A.D. uses American English by default and transliterates κ as k, χ as ch, and ξ as x, another language might want to use kh for χ and ks for ξ. And it's even less straightforward if the localization language doesn't use the Latin alphabet. Having the original Greek spelling could really help. That's also why it's already included in the “Rhomphaia” attack name context (see D2995/rP24209 by @bb).
Point taken, although it is not nice that it can have merely one context, such that every specific name then ought to have the whole string about not translating, right?
Well, I was thinking something along the lines of e.g. context="Transliteration of Ancient Greek Θεμιστοκλῆς" for hero_themistocles.xml or context="Transliteration of Meroitic" for hero_amanirenas.xml.
Just a note on the purpose of context: the context feature of PO files is meant as an ID to allow translators to translate differently 2 strings that are the same in English. For example, the word “Build” could be used in English as a noun (a build of something) or a verb (to build something); adding verb or noun as context allows translators to use the proper word in their language for each case, as chances are the word is not the same in their language in each scenario.
If the purpose is to give background to translators to understand what they are translating and have better “context” to translate correctly, the PO feature to use is “extracted comments”, which should appear in PO files prefixed with #. before each msgid. See https://www.gnu.org/software/gettext/manual/gettext.html#PO-Files
@Gallaecio, thank you for the clarification.
D2995/rP24209 introduced translatable attack names and added context to them, e.g. distinguishing “Sword” (a single-edged weapon) used by e.g. Athenian cavalry from “Sword” (a double-edged weapon) used by e.g. Briton cavalry. For the non-swordsman attack name strings the context is indeed more of giving translators a better understanding of what it is they're translating.
How to use the “extracted comments” feature in XML? And in JSON?
How to use the “extracted comments” feature in XML? And in JSON?
Looking at https://code.wildfiregames.com/source/0ad/browse/ps/trunk/source/tools/i18n/extractors/extractors.py :
- JSON: Use the comments extraction option in the extraction configuration file to define a JSON key from which to extract translator comments. You could create a key (e.g. _translatorComment, _l10nComment, _i18nComment; I’m suggesting a _prefix to differentiate it from keywords used by the game, but maybe that’s not necessary) in the corresponding files and configure it to be extracted.
- XML: comment XML attribute