Hi there,
I’m trying to get a Language-switching Combo Box to work, but no matter what, the language doesn’t want to switch.
I’ve definitely done everything correctly, making sure that my culture codes are correct, that my cultures are ticked in Project Settings > Packaging > Localization, that all my UI elements have localization enabled, and so on.
In fact, it’s easier for me to prove it mostly works by saying that when I launch the game with the language preview enabled (the button with the globe at the top of the UI editor window.), the previewed language works. It’s only when I want to change the language using a combo box that the issue appears. Let me explain in further detail exactly what happens.
1. Normal Launch:
When launched normally without any language preview on, the game is in the default English language, which is as intended. Then, after navigating to the correct page of the options menu and changing the combo box to any of my available languages (these being English (en), Polish (pl), and Portuguese (pt)), the language remains the same. I’ve put a print string on every step of the way to analyze exactly what happens, and after setting these cultures, the boolean outputted by the Set Current Culture node always results in yes, and the Get Current Culture node that I put at the end of my code always outputs the right corresponding language with the same culture code (e.g. ‘en’, ‘pl’, ‘pt’) as the one that I see if I hover over every language in the Localization Dashboard window.
Yes, it’s literally a case of everything seems to be good under the hood, but the car still doesn’t drive.
2. A weird observation:
If I go ahead and launch the game with the language preview set to Polish, it works perfectly fine, with everything being displayed in Polish. Then, if I navigate to the correct menu again and change the language using the combo box, the language resets to the default English, no matter which language I choose. Even if I choose Polish, which is already the selected one thanks to the preview, it resets to English. And, you guessed it, all the Print String outputs seem to be as if the program worked, the outputted Boolean from the Set Current Culture node being True, and the outputted string from the Get Current Culture node being the corresponding culture code to the one I selected in the combo box. Very weird.
So, I’ve already asked ChatGPT about 50 questions regarding what to do to fix the issue, updating my observations with every step, but to no good. So, sorry if the last thing you’re looking forward to is the person with the issue dumping all their code on your screen and you having to do the entire job for them.
It’s my last choice, so… here it comes.
COMBO BOX CODE:
LOCALIZATION DASHBOARD CULTURE SECTION:
PROJECT SETTINGS > PACKAGING > LOCALIZATION
Any help is hugely appreciated, because this forum almost never replies.
Thank you as always!