Search Unity

Get string of another locale from LocalizedString

Discussion in 'Localization Tools' started by Kvadratt, Apr 4, 2022.

  1. Kvadratt

    Kvadratt

    Joined:
    Mar 7, 2021
    Posts:
    8
    Hello! I've found out how to get string from LocalizedString, but it only works for active Locale. Is there any way to get strings of another Locales (without switching them globally in settings, of course)?
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,297
    Yes this is supported. How are you currently getting your strings? If you are using a LocalizedString then you can set the LocaleOverride property to point to a different Locale. All the GetLocalizedString API also supports an optional locale.

    There is an example here https://docs.unity3d.com/Packages/c...ocalization_LocalizedReference_LocaleOverride
     
  3. Kvadratt

    Kvadratt

    Joined:
    Mar 7, 2021
    Posts:
    8
    karl_jones likes this.
  4. NerdOne

    NerdOne

    Joined:
    Aug 3, 2021
    Posts:
    5
    I have a similar problem, i have a local multiplayer game that needs to support individual language choice. Is there a way to use the override with the standard Localize string event, or should i make my own script to update the strings?
     
  5. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,297
    Will this be the language choice on a single machine or running on the same machine such as split screen?
     
  6. NerdOne

    NerdOne

    Joined:
    Aug 3, 2021
    Posts:
    5
    It will be split screen, thats what makes it complicated