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
  4. Dismiss Notice

Did you build the addressables? Localization not working

Discussion in 'Localization Tools' started by tknippenberg, May 9, 2021.

  1. tknippenberg

    tknippenberg

    Joined:
    Feb 15, 2017
    Posts:
    12
    Recently I implemented localization and I noticed it wasn't working on my Windows build. Now I have set the Play Mode Script to Use Existing Build in Window -> Asset Management -> Addressables -> Groups and I get the same error in Unity when hitting Play.

    I've already tried clicking Build -> New build -> Default script and in Assets/AddressableAssetsData/Windows the addressables_content_state.bin file shows up when doing so. A quick investigation of this .bin file in Notepad++ shows that the name of my localization files shows up (localization-string-tables-dutch(nl)) so it's at least doing something with it.

    What should I do to get my game working?




    Code (CSharp):
    1. No Locale could be selected:
    2. No Locales were available. Did you build the Addressables?
    3. The following (4) IStartupLocaleSelectors were used:
    4.     UnityEngine.Localization.Settings.SpecificLocaleSelector
    5.     UnityEngine.Localization.Settings.SpecificLocaleSelector
    6.     UnityEngine.Localization.Settings.CommandLineLocaleSelector
    7.     UnityEngine.Localization.Settings.SystemLocaleSelector
    8.  
    9. UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1/<>c__DisplayClass58_0<System.Collections.Generic.IList`1<UnityEngine.Localization.Locale>>:<add_CompletedTypeless>b__0 (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1<System.Collections.Generic.IList`1<UnityEngine.Localization.Locale>>)
    10. DelegateList`1<UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1<System.Collections.Generic.IList`1<UnityEngine.Localization.Locale>>>:Invoke (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1<System.Collections.Generic.IList`1<UnityEngine.Localization.Locale>>) (at Library/PackageCache/com.unity.addressables@1.17.15/Runtime/ResourceManager/Util/DelegateList.cs:69)
    11. UnityEngine.ResourceManagement.ResourceManager:Update (single)
    12. MonoBehaviourCallbackHooks:Update () (at Library/PackageCache/com.unity.addressables@1.17.15/Runtime/ResourceManager/Util/MonoBehaviourCallbackHooks.cs:26)
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,846
    Could you check that the locale addressable group has the schemas, like in your screenshot?
    Also try running the addressable analyzers
     
    tknippenberg likes this.
  3. tknippenberg

    tknippenberg

    Joined:
    Feb 15, 2017
    Posts:
    12
    These all have a "Content packing & loading" section where the build path is set to LocalBuildPath.
    • Default Local Group
    • Localization-Assets-Shared
    • Localization-Locales
    • Localization-String-Tables-Dutch (nl)
    • Localization-String-Tables-English (en)
    For Localization-Locales I've added a screenshot:


    I ran the Analyzers (Window > Asset Management > Addressables > Analyze > Analyze Selected Rules) and there's about 15 seconds of progress bars moving, then the progress bar popup closes, but I don't really see any result.
    When reading the documentation it's not entirely clear to me what the next step would be with these Analyzers.
     
  4. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,846
    Once complete you should be able to expand the analyzer rule and see either a message saying nothing was wrong or a list of problems. Can you share the project?
     
    tknippenberg likes this.
  5. tknippenberg

    tknippenberg

    Joined:
    Feb 15, 2017
    Posts:
    12
    I guess I was expecting something from the analyzer in the logs, but after your comment I found how to expand the rule :)


    Those were errors I could work with, so I renamed some files and localization is now working both in- and outside Unity.

    Thank you for your help!
     
    karl_jones likes this.
  6. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,846
    Ah great. There is an auto fix option for those issues but you can also fix them manually :)
     
  7. XIV_Dis

    XIV_Dis

    Joined:
    Mar 20, 2020
    Posts:
    8
    Hi @karl_jones, I updated addressables to 1.18.13 from 1.18.11 and i build my project for android. There was no error in 1.18.11 but now when i call LocalizedString.GetLocalizedString(); it breaks everything.
    I got 2021/07/30 23:44:22.415 7316 7361 Error mono Step depth: 1 message on Android Logcat and thats all i can get. When im trying to debug it doesnt throw any exception or doesnt show any error.
    Steps that i followed :
    - When i updated the package i went to Addressables Groups -> Build -> Clean Build -> All
    - I rebuild the addressables by going Addressables Groups -> Build -> New Build -> Default Build Script
    - I deleted all addressable groups that related to localization and run the analyzer by goin Addressables Groups -> Tools -> Window -> Analyze -> Clicked on Analyze Rules -> Analyze Selected Rules
    - It was showing some errors about locales and error was locales not marked as Addressable. Then I selected the rules and clicked Fix selected rules.
    - Build the project again but problem is still there.

    Should i go back to previous version of Addressable?
     
    Last edited: Jul 31, 2021
  8. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,846
    Yes I would roll back and see if it works. If it does then please file a bug report. We have not tested with the latest addressables yet so something may have changed causing this.
     
    XIV_Dis likes this.
  9. XIV_Dis

    XIV_Dis

    Joined:
    Mar 20, 2020
    Posts:
    8
    I updated Addressables to 1.18.11 but problem is still there and unfortunately im not able to file bug report with this project. I will try to reproduce the issue with an example project. Maybe you can follow my steps that i described previous post and reproduce the issue. Right now i will remove and reimport the packages and try again.
     
    karl_jones likes this.