Forum rules - please read before posting.

Menu : Update content - Global variable and translation

Hello!

I have standardized menus (using AC menu with Unity UI Prefab as the source)

I update their content using the "Menu: Update content" action so I don't have to create multipe menus with multiple values. Initially, I directly typed the text into the action's text field, but I noticed that the text wasn't included in the gathered text for translation.

Then I thought I might need to use global variables, so I created (a lot) of them to store the strings and used them in various actionlists to display the strings in the menus.

The variables do appear in the translation export and are translated, but when I set the game to another language, the text in these menus remains in English.

If I directly assign the content of these label to the global variable in the menu manager and skip the actionlist, it works as expected and is translated. However, when I set the global variable in the actionlist, it always displays the original value and not the translated one.

Is there a solution ? (I hope, to create a menu for each possibilities will be a lot of work ^^')

I use AC V1.80.1 and Unity 2021.1.15f1

Thanks in advance ! :smile:

Comments

  • Thanks for the report.

    How are you mapping the variables to the elements - through tokens, or by setting your "Label type" fields to "Global Variable"?

    At the time you set the Global Variable's value, is the Menu already on? If so, does the Menu update correctly if the Menu is turned off and then on again?

  • Hey Chris, thanks again for your help :smile:

    Tokens is like putting a [Var:2] or something ?
    I set the "Label type" fields to "Global Variable"

    And then do that :

    I added your suggestion to turn it off then on again but it doesn't change the result

  • Is this a case of having multiple String variables for a given element, and then using Menu: Update content to change which variable is shown?

    An issue related to this workflow not including translations was fixed in v1.82.

    However, for this situation you may find it more manageable to rely on a single Variable, and then simply change the Variable's value.

    If you create a PopUp variable, instead of a String, you can enter in each of the possible values it can take in one place, the Variables Manager. If the element then links to this variable, you can change its text just by using Variable: Set to switch its value between the different popup labels you defined.

  • Hey Chris,

    The update to 1.82 seem to have corrected the issue, thanks !
    The variables are now translated in the menus :)

    I tried popup variables, and it can be useful for other situations, thanks for the suggestion, here as I use a lot of tags for the layout it's a little tricky to select the correct values hahaha

    Thanks again for your help !

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.