Search Unity

Preloaded strings are not available in scripting (0.5.1)

Discussion in 'Localization Tools' started by stefankohl, Jan 16, 2020.

  1. stefankohl

    stefankohl

    Joined:
    May 30, 2014
    Posts:
    53
    I'm facing a problem regarding preloading of strings where some of the LocalizedStrings return an empty result when accessing those through scripting. For convenience, I've marked all string tables as preload content and I can see that the addressables have the preload label attached. As far as I understand, preloading is part of the InitializationOperation and I should be safe as long as I wait for this operation to finish. This is done on my bootstrapping code, ensuring that the content is not loaded before the system is initialized.

    However, calling something like "title.GetLocalizedString().Result" returns null.

    Am I missing out on something?
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,282
    Yes that should be fine. What is title.GetLocalizedString.Status? It should be completed
     
  3. stefankohl

    stefankohl

    Joined:
    May 30, 2014
    Posts:
    53
    Status is "None". This is what I get as debug output:

     
  4. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,282
    Are you able to share a project with the problem? You should be able to use the bug reporter like normal.
    Just post the bug number here so I can track it
     
  5. stefankohl

    stefankohl

    Joined:
    May 30, 2014
    Posts:
    53
    I haven't had time yet to isolate the issue or building a repo project. However, I went with the regular approach to just keep querying the status of the async operation and displaying the text only after it is set done. This works fine for now.
     
    karl_jones likes this.