Re: Substitution of ${pillbug} at HIVE
Posted: 09 September 2017, 12:22
I got readonly access to Hive and have checked this; the i18n array contains "mosquito" and "pillbug".
This turns out to be true.DrKarotte wrote:causing the variable names not to be translated at all - that's the reason that there does not appear the "English" string but the completely non-translated original (which is, of course, English, too)
In other words, it's doing the exact same thing it did to start with. It's not translating Mosquito and Pill bug (or pillbug). Because they're written as variables, and the (human) translators aren't supposed to mess with variables so they didn't get translated. (Except there's no reason for them to be variables since only those bugs can make those moves.)twistytroll wrote: And today BGA expands
“moves the ${type_name} using a ${mosquito} copying a ${pillbug}”
to
"moves the Pillbug using a Mosquito copying a Pill bug".
Thus ${pillbug} is not translated at all. What we see is the completely non-translated original "Pill bug".
If I were to make a guess, perhaps because that's "instructions" so to speak, to whatever is printing up the game log and action lines, etc. And if the game is initially done in English, it might need to have that in English. "${type_name}" is giving an instruction to pull up the bug name that is needed there, and if it were translated, it might not understand it. By being in English, it knows to dig up the string for, say, Queen Bee, if that's the bug just played. It understands "type name" but doesn't understand it in German. However, when it goes to grab the variable, Queen Bee, it pulls it from the correct location, and that word has been translated, and gets filled in with the correct translated word. OTOH, I could be full of it, because maybe it's just reading original instructions and not trying to read translated instructions. We need someone to explain this, in plain English. (Not in "code speak.")Since the 'i18n' array contains "mosquito" and "pillbug" there must be some other reason why constant placeholders are not translated at all.
Except that ${pillbug} isn't being translated, so going to the source where "pillbug" is translated isn't doing the trick. Fix that (easy) source and it won't fix it, because it'll still say ${pillbug} and not be translated. And there isn't going to be a great amount of typing to fix that. This problem is only in two places, so basically two extra times to type it as Assel.However, it's a good idea to have variables like ${mosquito} and ${pillbug}.
The reason is the following:
Suppose ${pillbug} is translated by "Kellerassel" in German. Later on it is realized that this word is way too long and that "Assel" should be used instead. If there was no variable ${pillbug} changing it to "Assel" would require a great amount of typing. With the variable a change at one single place is sufficient.
The main advantage of constant placeholders like ${pillbug} is CONSISTENCY:I do not see any reason to work with variables in this string
No, it is not.DrKarotte wrote:It would be interesting to know why the translation of "mosquito" and "pillbug" is not working here. The kind of reference is just the same as with "type_name".
I get what you're saying there. It gets written Pill bug in one place and pillbug in another. (Which already happened.) But trying to do ${pillbug} = "Pillbug" - it seems to me that would have to be programmed individually, where as ${type_name} already works and only has to be programmed once to pick up the name from the "database of bug names." If anything, maybe they should all be like that. (Which is a solution.) Keep in mind, ${pillbug} is not translating, so that is obviously not working.**twistytroll wrote:The main advantage of constant placeholders like ${pillbug} is CONSISTENCY:
If the game was properly set up from the very beginning all string would read like
"You cannot move a piece that was just moved by the ${pillbug}, or move with the ${pillbug} a piece that just moved"
and there would be one single variable
${pillbug} = "Pillbug".
If it was done this way no one could ever break consistency by editing a translation string.
Yeah, I'm totally aware of that. Even the English isn't consistent, and sometimes just due to carelessness, and randomly changing things without really taking the time to look at it. Or even just not having time to get through it all, especially one with lots of pages of strings. And some of the non-English translation inconsistencies may be due to the English not being consistent to start with.(At present we do have LOTS of inconsistencies since many strings got translated in a different manner.)
Yes, this. In those two strings it doesn't have ${type_name}.No, it is not.DrKarotte wrote:It would be interesting to know why the translation of "mosquito" and "pillbug" is not working here. The kind of reference is just the same as with "type_name".
${type_name} is handled by the game logic.
If the actual piece moved happens to be a grasshopper the game logic replaces ${type_name} by something like ${grasshopper?}.
It then manages to translate the variable to something like ${grasshopper-French}.