Forum rules - please read before posting.

Translation ignores empty String Variables...

Hi,

Unity version: 2019.2.15f1 , AC ver: 1.69.5

I've found a pretty severe issue in my game Burnhouse Lane (already released - now we're adding translations) that I think is AC related. At some points I use string variables to tell the game what text to display inside some of the UI (a notebook with objectives for the player or later for the end credits). Like this:

https://imgur.com/yeT7wdh

When changed/removed/completed I set the string variable to nothing using an action like this one:

https://imgur.com/Pd1sbiy

So CreditsText1 shows nothing (acting as if this menu element was turned off) in normal English version of the game. No problem there. The problem starts with translations - the string set as empty gets ignored and these string variable values are still shown.

Another example of this:

https://imgur.com/9Q58sUv

Above we see objectives list - just one here currently - FIND TREASURE.

But as we switch to Portuguese version (still WIP so text here's still in English) we suddenly get 2 more objectives that were already completed and removed with the above method (Leave milk for the cat, play piano) :

https://imgur.com/KMvcOuf

Is there anything that can be done at this point to resolve this?...

Thanks,

-Rem

Comments

  • edited February 13

    I haven't come across this issue yet, but I think it may have something to do with the fact that AC uses the main language (in this case, English) as a "fallback" language - meaning that when the Portuguese column in the database has an empty string, the corresponding string in English is displayed instead.

    Imho this is a very important feature because:

    • You generally don't want a partially translated game to show empty strings everywhere. If anything, it makes it harder to do Loc QA (it's much easier to tell something is in the wrong language than to notice it is missing altogether).
    • To avoid this, AC used to propagate the English text to the Portuguese database when the translation string was empty, and this would cause all sorts of problems. For example, if you translated the whole game and then added a couple of new strings in a new update, there was no easy way for you to find the new strings in a newly exported spreadsheet because there would already be words in them (English ones!)
    • If I remember this correctly, in order to address this issue, Chris removed the propagation of EN strings to localised ones, and implemented the use of a fallback language.

    What you're seeing is most likely a necessary side-effect of that. I'd suggest two possible solutions:

    • Simply hide the UI element instead of setting the string to empty?
    • If for some reason that's not practical, perhaps set the string to a non-breaking space instead? It'd look empty, but AC would likely see it as a non-empty string and a fallback language would not be used.
  • edited February 14

    Yes, spaces instead of empty strings would work. It's related to the fact that empty strings aren't included in translations. Adding a string would have it be included, and then updated correctly for all languages.

    It's a bit hacky, but if you want to avoid having to manually update your Actions with spaces you can modify the Action to gather up empty text. To do this, open ActionVarSet, and replace line 1040:

    if (variable != null && variable.type == VariableType.String && !string.IsNullOrEmpty (stringValue))
    

    with:

    if (variable != null && variable.type == VariableType.String)
    
  • Thank you both for help! (only replying now because I've been away, sorry! ;) )

    I've replaced that line of code. Is there anything else I should do now? Gather game's text again? Or will just changing that line make empty strings now show as required?

  • Yes, you'll need to re-gather - be sure to back up beforehand!

    After gathering, empty strings should then be gathered up in the Speech Manager. Like I said, it's a bit hacky, but should cause empty lines to then be respected by the translation system.

  • This works! (as far as I can tell not knowing all those languages)

    Thank you, Chris! :)

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.