I can't integrate unity localization with the dialog system

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
DeadLik
Posts: 5
Joined: Thu Jul 21, 2022 5:56 am

I can't integrate unity localization with the dialog system

Post by DeadLik »

Hi, I can't integrate unity localization with the dialog system, according to the guide (http://www.pixelcrushers.com/dialogue_s ... ionPackage), you need to go to Tools → Pixel Crushers → Dialogue System → Third Party → Localization → Dialogue To Localization Table, I don't have a Third Party there, how do I link localization to the dialog system?
Dialog System version 2.2.27
Attachments
Screenshot_1.png
Screenshot_1.png (87.42 KiB) Viewed 3127 times
User avatar
Tony Li
Posts: 21975
Joined: Thu Jul 18, 2013 1:27 pm

Re: I can't integrate unity localization with the dialog system

Post by Tony Li »

Hi,

Did you import the Plugins ► Pixel Crushers ► Dialogue System ► Third Party Support ► Localization Package Support unitypackage?
DeadLik
Posts: 5
Joined: Thu Jul 21, 2022 5:56 am

Re: I can't integrate unity localization with the dialog system

Post by DeadLik »

I would like to clarify, I can't pinpoint exactly where these add-ons are, I'm using unity 2020.3, or maybe there's a direct link to the package?
DeadLik
Posts: 5
Joined: Thu Jul 21, 2022 5:56 am

Re: I can't integrate unity localization with the dialog system

Post by DeadLik »

I found everything, thank you, I thought it would be in the tools, it turned out to be in the folder
Attachments
Screenshot_1.png
Screenshot_1.png (13.5 KiB) Viewed 3100 times
User avatar
Tony Li
Posts: 21975
Joined: Thu Jul 18, 2013 1:27 pm

Re: I can't integrate unity localization with the dialog system

Post by Tony Li »

Sounds good. I recommend following the integration instructions closely. Unity's Localization package is a little complicated.
DeadLik
Posts: 5
Joined: Thu Jul 21, 2022 5:56 am

Re: I can't integrate unity localization with the dialog system

Post by DeadLik »

Now I don't understand how to use it, is there a guide? The package has been installed, everything has been added, everything has been added to the localization table, too, but does not want to translate

At the same time, everything else is localized, something that is not related to the dialog system
Attachments
Screenshot_4.png
Screenshot_4.png (93.27 KiB) Viewed 3068 times
Screenshot_2.png
Screenshot_2.png (70.1 KiB) Viewed 3079 times
Screenshot_3.png
Screenshot_3.png (28.91 KiB) Viewed 3089 times
Screenshot_1.png
Screenshot_1.png (15.43 KiB) Viewed 3089 times
User avatar
Tony Li
Posts: 21975
Joined: Thu Jul 18, 2013 1:27 pm

Re: I can't integrate unity localization with the dialog system

Post by Tony Li »

Hi,

If you're having trouble changing locales and getting the Dialogue System to recognize the locale change, please import the updated Localization Support package (direct download) from the Dialogue System Extras page.

Make sure you've added a Dialogue System Localization Package Bridge component to your Dialogue Manager GameObject, and that you've assigned the Localized String Table(s) and left the Unique Field Title set to "Guid".

Change the locale using LocalizationSettings.SelectedLocale = locale. If you're doing this in a Start or OnEnable method, remember that the Localization package requires you to wait until it has initialized. Example:

Code: Select all

private IEnumerator Start()
{
    yield return LocalizationSettings.InitializationOperation;
    LocalizationSettings.SelectedLocale = locale;
}
DeadLik
Posts: 5
Joined: Thu Jul 21, 2022 5:56 am

Re: I can't integrate unity localization with the dialog system

Post by DeadLik »

Thank you, the update and initialization worked, a small question, where do you advise to initialize the language localizer?
User avatar
Tony Li
Posts: 21975
Joined: Thu Jul 18, 2013 1:27 pm

Re: I can't integrate unity localization with the dialog system

Post by Tony Li »

It's up to you. The bridge component will make the Dialogue System automatically use whatever you set the locale to.

I recommend initializing it in your first scene, using a Start() method like the example above. You can store the player's current localization choice in PlayerPrefs. In Start(), look up the value stored in PlayerPrefs and set the locale accordingly. Something very roughly like:

Code: Select all

public List<Locale> locales;

// Set the player's selected locale when starting:
private IEnumerator Start()
{
    yield return LocalizationSettings.InitializationOperation;
    if (PlayerPrefs.HasKey("Locale"))
    {
        int index = PlayerPrefs.GetInt("Locale");
        if (0 <= index && index < locales.Count)
        {
            LocalizationSettings.SelectedLocale = locales[index];
        }
    }
}
When changing locales, also set PlayerPrefs:

Code: Select all

LocalizationSettings.SelectedLocale = locale;
PlayerPrefs.SetInt("Locale", locales.IndexOf(locale));
Post Reply