Hello! I've been following the tutorial and successfully managed to synchronize Unity's localization Package with Adventure Creator, and I'm able to add the translations to the text lines without issue.
However, there is a weird bug where the first time I click on the Language button on the menu (the basic one that the game has), the Unity Localization Package does detect the change, but Adventure Creator half-does.
I tracked down the MenuElement script and added a debug log onto one of the functions it calls when the language changes (I apologize, I do not remember which), and the function does get called and the language changes for the Localization package, but its not until the second click that Adventure Creator changes language.
In short:
Gathered all the text with the options:
Translatable Text types: Everything.
ID Number Recycling: Never.
Matching text ID merging: Always Merge.
Added a few of the translations using the Localization.
Basically, since it takes one click for the translation to actually happen, the game is always "behind" the actual language that should happen. I tested disabling one language so it was only two or gathering the text without merging the IDs, and the same happened.
It is important to notify that this issue was NOT happening when I tried the translations with only Adventure Creator without the Localization package.
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Thanks for the thorough write-up.
The Language/Locale sync should be one-way, so I'm not immediately sure as to how this behaviour is happening. It's only when AC's language itself changes, that the Locale is affected.
If you're going through the code to try to see what's going on: the synchronisation takes place in RuntimeLanguage's SetLocalCo function. Placing
Debug.Log ("Set Locale index: " + index);
at the top of it may help give a clue as to what's going on.Yeah, I imagine this is quite the weird bug.
Spanish is a rename of the "Original" language. It is written as "Español", but so are all the others in their respective languages (Catalan is written as "Català", and English to, well, "English").
The button itself (so, the "Language" part) is translated through the tables ("Idioma", "Llengua", etc.). The language name is NOT translated through the tables, using AC's Speech Manager directly since they're already in their respective languages.
I also tested adding the Debug.Log mentioned above:
What's the exact text in full (i.e. "Language: The language") at each state? You're welcome to share screenshots on imgur if it's easier.
To be clear: 1, 2, 0, 1 etc?
Start in Spanish, click once to Catalan. Exit Play mode and re-enter - does the Debug.Log start with index 1?
It's also possible to see the current language index from within the Save-game File Manager, available at the top of the Settings Manager. Is that showing the correct index?
Starting with the Localization in Spanish, it reads:
Yep, exactly that as can be seen above.
Correct, the index value is 1 and the Localization indicates it is the Catalan language.
If the "Language:" label is pulled from Localization, and the actual language name itself is from AC, then it sounds like the other way around - AC is updating, but Localization is one click behind. Or am I misinterpreting?
I think the best way for me to get to the bottom of this is for me to see it for myself. Are you able to PM me a .zip of the project? The Library folder and art assets can be omitted to reduce file size.
Hi again! Sorry for going radio silent, stuff came up.
To begin, sadly the project is under NDA, so for the time being I can't share anything.
However, I did eventually find a solution! On a clean branch (created a new project and just added the translation tables) the issue kept happening, so I tested with an ActionList and found out you can change the language with one action.
So I created a PopUp with 0, 1 and 2 and when clicking the language button, I call the action to change to the next language twice, one after another. This thankfully resolved the issue.
(I'm calling it two times in a row in all languages because after trying it on the first one and working, it was the second language that suddenly didn't change on the first click).
I've managed to recreate this.
Looks to be a case of the order in which events are hooked up. The Menus are updated while Locale is being set - but the latter is asynchronous process and can take a frame or two to occur.
I'll see this remedied in the next update - thanks for helping me to track this bug down.