How Can I Refresh UI Language After Change Language?

Announcements, support questions, and discussion for the Dialogue System.
wlchfl5359
Posts: 29
Joined: Sat Jan 02, 2021 4:27 pm

How Can I Refresh UI Language After Change Language?

Post by wlchfl5359 »

Hi,
When after I change language, language on UI is still same.
So after I deactive and active again, it changes with new language.
Is there way to refresh languages immediately after change language?
Thank you.
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: How Can I Refresh UI Language After Change Language?

Post by Tony Li »

Hi,

How are you changing language? If you use DialogueManager.SetLanguage(), it should update UIs.
wlchfl5359
Posts: 29
Joined: Sat Jan 02, 2021 4:27 pm

Re: How Can I Refresh UI Language After Change Language?

Post by wlchfl5359 »

Thank you for reply.
I update using DialogueManager.SetLanguage("english");

But UI shows past language...

It changes when I deactive gameobject and active it again.
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: How Can I Refresh UI Language After Change Language?

Post by Tony Li »

Hi,

Are you using the current version of the Dialogue System? (Version 2.2.34 as of this reply.)
wlchfl5359
Posts: 29
Joined: Sat Jan 02, 2021 4:27 pm

Re: How Can I Refresh UI Language After Change Language?

Post by wlchfl5359 »

No, I'm using 2.2.25.1
Is not working in this version??
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: How Can I Refresh UI Language After Change Language?

Post by Tony Li »

A bug was fixed in a later version. Please back up your project, make sure the backup is good, and then update to the current version. You can review release notes here: Release Notes
wlchfl5359
Posts: 29
Joined: Sat Jan 02, 2021 4:27 pm

Re: How Can I Refresh UI Language After Change Language?

Post by wlchfl5359 »

Thank you for reply.
But it is weird. I just updated to the current version and it is still same.
I have a Localize UI component and TextMeshPro - Text(UI) in text object and it changes language only when i deactive and active object..
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: How Can I Refresh UI Language After Change Language?

Post by Tony Li »

How are you changing languages? Are you using DialogueManager.SetLanguage()?
wlchfl5359
Posts: 29
Joined: Sat Jan 02, 2021 4:27 pm

Re: How Can I Refresh UI Language After Change Language?

Post by wlchfl5359 »

I use only this code DialogueManager.SetLanguage("english");
do i have to change something in dialogue system controller or somewhere?
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: How Can I Refresh UI Language After Change Language?

Post by Tony Li »

That's correct. Are there any warnings in the Console window when you change languages?

During play, are there more than one UILocalizationManager components? (There should be only one.)

Can you send a reproduction project to tony (at) pixelcrushers.com?

If not, then please open UILocalizationManager.cs in your code editor. Put a breakpoint in the UpdateUIs() method at the bottom of the script. Play the scene, change languages, and step through the code to make sure that it finds all of the LocalizeUI components and tells them to update their texts.
Post Reply