Substitution of ${pillbug} at HIVE

BGA localization discussions
User avatar
twistytroll
Posts: 12
Joined: 20 October 2014, 14:14

Substitution of ${pillbug} at HIVE

Post by twistytroll »

In all languages the system substitutes ${pillbug} by the English 'Pill bug'.
Why is that?

For instance:

HIVE contains a pattern
“moves the ${type_name} using a ${mosquito} copying a ${pillbug}.”

French humans correctly translated this to
“déplace une pièce ${type_name} avec un ${mosquito} copiant un ${pillbug}.”

Then, however, the system expands the pattern to
“déplace une pièce Cloporte avec un Mosquito copiant un Pill bug. ”

Thus the system correctly replaces ${type_name} by ‘Cloporte’, which is the French word for pill bug. However, ${pillbug} is replaced by the English ‘Pill bug’ even in French.

This applies to all other languages as well. For instance in German the system generates
“bewegt den Kellerassel durch einen Mosquito, der einen Pill bug kopiert.”
Last edited by twistytroll on 08 September 2017, 08:43, edited 1 time in total.
Liallan
Posts: 1221
Joined: 26 May 2014, 07:01

Re: Substitution of ${pillbug} at HIVE

Post by Liallan »

I can't tell you what the system does :P but I can tell you some stuff.

The strings have both Pillbug and Pill bug inconsistently. I can certainly fix these if need be, but I'm not always comfortable doing old games cause I'm not sure what it's going to do with it.

Even though on the internet in general, both Pillbug and Pill bug are used fairly equally, a search at Mirriam-Webster and Oxford both shows it as two words. Maybe more importantly, both the Google and MS translators will translate Pill bug appropriately to the other language. Both of them translate pillbug to pillbug, even in Klingon. :lol: So the "machine" translators think it's two words. My conclusion would be it should be two words throughout and replace the one word ones.

If it's doing any "machine" translating, it might be getting confused over those inconsistencies and not recognizing the "wrong" one? I don't have any clue when the machine translating is being done around here.

(Even if that's not the issue, I think that inconsistency ought to be fixed.)
User avatar
twistytroll
Posts: 12
Joined: 20 October 2014, 14:14

Re: Substitution of ${pillbug} at HIVE

Post by twistytroll »

(Even if that's not the issue, I think that inconsistency ought to be fixed.)
Both is true:
1. That’s not the issue. I added an example in the original post. It’s a software issue.
2. There is an inconsistency in the English version between ‘Pill bug’ and ‘Pillbug’ which ought to be fixed as well. Thanks for your investigation on which one to choose.
Liallan
Posts: 1221
Joined: 26 May 2014, 07:01

Re: Substitution of ${pillbug} at HIVE

Post by Liallan »

I might suggest you make note in your first post that you edited it, for those who are trying to follow. You both added an example, but also deleted something else.

Obviously, I'm not the one to answer questions about what the "system" is doing, but I can look stuff up and save someone else some time.

First I find it odd to see "${pillbug}" because all those things with $ and % and such stuff are... well, variables. And filling it in with a specific thing isn't a variable. i.e. it's not ${type_name} - it's a specific bug. As is the mosquito. (And I notice you haven't commented on the mosquito staying a "mosquito." Maybe French and German like that word just fine as is, though google is translating them.) The French human translation still has the word "pillbug" in there, i.e. not translated, probably because we're told never to touch anything that includes the variables. So that whole thing seems odd to me.

It's also a little odd that the strings contain both "Pill bug" and "Pillbug." And by that I mean the single word things you see that get substituted in for those variables, i.e. what would be used to substitute in for ${type_name}. So both versions exist for that, but I don't see that for any other bug. (2nd page not too far down, under "off" and "on")
User avatar
twistytroll
Posts: 12
Joined: 20 October 2014, 14:14

Re: Substitution of ${pillbug} at HIVE

Post by twistytroll »

You are right!
I just overlooked that the translation of ${mosquito} was wrong as well.
Correct translations are ‘Moustique’ in French and ‘Moskito’ in German as correctly set by our human BGA translators.

Now it’s clear what is going on:
it’s indeed a software bug:

There are variables like ${type_name}, ${type_copied} or ${player_name} which are first replaced by the game logic. These work fine, they are eventually translated into the foreign language.

There are other variables like ${mosquito} or ${pillbug} which are untouched by the game logic. These are always translated into English.


For instance:

“déplace une pièce ${type_name} avec un ${mosquito} copiant un ${pillbug}.”

The game logic transforms this (if the piece moved happens to be a pill bug) to something like

“déplace une pièce ${pillbug-French)} avec un ${mosquito} copiant un ${pillbug}.”

and then this is expanded to

“déplace une pièce Cloporte avec un Mosquito copiant un Pill bug.”
instead of the correct
“déplace une pièce Cloporte avec un Moustique copiant un Cloporte.”

And that’s the error we observe.

Thus foreign language handling is entirely missing for the second sort of variables.
User avatar
DrKarotte
Posts: 279
Joined: 22 September 2015, 23:42

Re: Substitution of ${pillbug} at HIVE

Post by DrKarotte »

When using strings with variables which should be translated together with the string these variables have to be "marked" when handed over to client side. It could also be that the text of the variable is not set translatable, but then it should not appear in the list of strings for translation.
I suppose that the "mark" is missing in the cases where the word is not translated. This could easily be fixed.
Liallan
Posts: 1221
Joined: 26 May 2014, 07:01

Re: Substitution of ${pillbug} at HIVE

Post by Liallan »

You've quoted this one:
“moves the ${type_name} using a ${mosquito} copying a ${pillbug}.”

Have you noticed if the same thing happens with this one?"
"moves the ${type_name} using a ${pillbug}."

Sorry, I can't speak in the official code of these things. The "type_name" is one of those variables, replaced within context of the move made. But "mosquito" and "pillbug" are not variables - they aren't "instructions" so to speak. I've looked at the French translation and things like "type_name" stay English, so it stands to reason that ${pillbug} would remain in English. (Though I have no clue why it would change to Pill bug as two words.

But here's the thing. I'm looking at the rules. (Jeez, what a tough game!!) The mosquito is the only bug that can "copy" another bug. Hence, why is the "mosquito" in that first line inside the brackets like it's a variable? My logic says it should simply say mosquito since only a mosquito can do this. Furthermore, only a pillbug can "move" another bug. So the entire second line can only be a pillbug, and the first line can only be a mosquito copying a pillbug since it involves a "move." Only the moved bug should be a variable.

Can't the $ and brackets just be removed? Obviously I can't know that won't bust something, but I have seen in another games, where if something can only happen in one circumstance, it simply uses the needed word and doesn't use a variable thing like that. So it seems that should work. (Sorry, DrKarotte, I'm not sure quite what you're talking about, but it seems this solution would not require having to "mark" anything.)

Of course, someone who really knows the game quite well would have to confirm the above.
User avatar
twistytroll
Posts: 12
Joined: 20 October 2014, 14:14

Re: Substitution of ${pillbug} at HIVE

Post by twistytroll »

Liallan wrote:You've quoted this one:
“moves the ${type_name} using a ${mosquito} copying a ${pillbug}.”

Have you noticed if the same thing happens with this one?"
"moves the ${type_name} using a ${pillbug}."
It's a general issue, yes.
If the piece moved happens to be a pill bug BGA generates
"déplace une pièce Cloporte avec un Pill bug".

Here is a link to a game where these messages appear:
https://fr.boardgamearena.com/#!gamerev ... e=32797180
(Move 13 and Move 19).
Lillian wrote:Can't the $ and brackets just be removed?
Yes, they could, but ...

It would indeed be possible to solve the issue by replacing all patterns like
“déplace une pièce ${type_name} avec un ${mosquito} copiant un ${pillbug}”
by
“déplace une pièce ${type_name} avec un Moustique copiant un Cloporte”.

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.

(You will immediatly argue that ${pillbug} is not used consistently anyway. That's right. But it could be done consistently for new games.)

Varibles like ${mosquito} and ${pillbug} are a fine thing to have. And as DrKarotte points out the bug should be easy to fix.

I have one more suggestion: It would be fine to see the variable NAMES on the translations site. At present we just see the English content of the variables.
User avatar
DrKarotte
Posts: 279
Joined: 22 September 2015, 23:42

Re: Substitution of ${pillbug} at HIVE

Post by DrKarotte »

I think I can explain why "pillbug" becomes "pill bug".

The "original" string from the code is "pill bug", and this is translated to English as "pillbug" (check the English->English translation). Unfortunately the dev of Hive probably did not hand over the special translation argument (the "mark" I have mentioned above: a simple line in the notification listing all variables which should be translated, like this: 'i18n' => array( 'variableNameToTranslate1', 'variable2' ...), ) in this notification, 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).

After thinking again on this I do not understand why there are variables used for constant values (normally the variable should be something like ${insect_name}. If in this situation only a mosquito can move the pillbug (I don't know the game), then it would have been much easier to simply write a string without any variables.

Removing the variable markers in the translation is not a good idea, even if this would certainly fix this special issue (which is in fact a double issue: used constant as variable and forgot to set the translation argument) - if the variable contains variable values then it would not work. The dev may also have named his variable "pillbug" but in fact stores any insect name there. Are you sure about this? I am not even sure if it is possible to remove the $ from the translated strings?
User avatar
twistytroll
Posts: 12
Joined: 20 October 2014, 14:14

Re: Substitution of ${pillbug} at HIVE

Post by twistytroll »

DrKarotte wrote:The "original" string from the code is "pill bug", and this is translated to English as "pillbug" (check the English->English translation).
Oh dear. Things are going to get messy:
There are two variables for pill bugs:
id="toTranslate_10212" originally "Pill bug", also "Pill bug" till yesterday (Here the space we see stems from). Someone changed this to "Pillbug" today (on 09/09/2017 at 06:19)!
id="toTranslate_10235" originally "Pillbug", still "Pillbug" today. This one is irrelevant for this thread.

The first one appears to be the variable ${pillbug}.
DrKarotte wrote: I do not understand why there are variables used for constant values.
See my arguments above.
DrKarotte wrote:The dev may also have named his variable "pillbug" but in fact stores any insect name there.
If the species of insect varies ${type_name} is used and this works fine. The variable ${pillbug} is constant.
At least as long as no game extension pops up and it would not be constant any more.
(You see: One more argument for having variables.)
DrKarotte wrote:the "mark" I have mentioned above
I don't know anything about the internals of BGA. But your explanation sounds reasonable to me: no one cares about inserting the variables ${mosquito} and ${pillbug} in that mark list.

This is what should be persued further.
Post Reply

Return to “Translations”