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

Question Alternative to LocalizationEditorSettings.GetStringTableCollection in build

Discussion in 'Localization Tools' started by GPaduanoImmerxive, Oct 3, 2022.

  1. GPaduanoImmerxive

    GPaduanoImmerxive

    Joined:
    Jan 19, 2022
    Posts:
    14
    Hi, I'm using the following code to check if a specific entry is smart or not:

    Code (CSharp):
    1. var collection = LocalizationEditorSettings.GetStringTableCollection(tableName);
    2. var englishTable = collection.StringTables[0];
    3. var entry = englishTable.GetEntry(entryName);
    4. var isSmart = entry.IsSmart;
    The problem is that I cannot build the application because LocalizationEditorSettings can be used only in editor.

    Is there an alternative to achieve the same solution?

    Thank you :)
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,876
    You would call LocalizationSettings.StringDatabase.GetTable
     
    GPaduanoImmerxive likes this.
  3. GPaduanoImmerxive

    GPaduanoImmerxive

    Joined:
    Jan 19, 2022
    Posts:
    14
    Thank you :)

    I used the following code:

    Code (CSharp):
    1. LocalizationSettings.StringDatabase.GetTable(tableName).GetEntry(entryName).IsSmart
     
    karl_jones likes this.