Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

How to get all string tables at runtime?

Discussion in 'Localization Tools' started by Dahka, Sep 24, 2021.

  1. Dahka

    Dahka

    Joined:
    May 4, 2015
    Posts:
    4
    Hello, I am currently writting a JSON exporter/importer and came across a problem, I cannot find a way to get access to all tables without passing their names as string or GUID, am I missing something? I assumed it would be in LocalizationSettings.StringDatabase but couldn't find anything nor any documentation on how to get all tables.
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,876
    We don't currently have support for this although it should be possible to do it through addressables.

    Code (csharp):
    1. var localeLabel = "Locale-" + selectedLocale.Identifier;
    2. var tables = Addressables.LoadResourceLocationsAsync(localeLabel, typeof(StringTable));
    3. yield return tables;
     
  3. Dahka

    Dahka

    Joined:
    May 4, 2015
    Posts:
    4
    Thank you for the answer!
     
  4. JBflowz

    JBflowz

    Joined:
    Feb 23, 2013
    Posts:
    8
    Id like to know if there is still no support to get all the localization string tables at runtime.
     
  5. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,876
    We do now have support.

    Code (csharp):
    1. LocalizationSettings.StringDatabase.GetAllTables()
     
  6. JBflowz

    JBflowz

    Joined:
    Feb 23, 2013
    Posts:
    8