Search Unity

Resolved Localization not working in WebGL build

Discussion in 'Localization Tools' started by Ardos12, Mar 30, 2023.

  1. Ardos12

    Ardos12

    Joined:
    Sep 25, 2019
    Posts:
    3
    Hello,
    This is the first time I'm using the Localization Tools and I'm facing a strange issue that I can't resolved by myself.

    I've made a small game and I used the Localization Tools to have it available both in French and English. It worked really well in the Editor, and it also worked when building the game for Windows. However, when I tried to make a WebGL export, the Localization functions stopped working.

    I have 3 tables, one for the UI strings, one for the dialogs and one to store the flags sprites.

    This is how the game looks in the Editor or in the Windows build: upload_2023-3-30_16-28-6.png

    And this is how it looks in the WebGL build:
    upload_2023-3-30_16-28-50.png

    "This should not appear" is the default text assigned to all my TextMeshPro components. The default sprite for the flag is an empty image. I also removed the Fullscreen and Quit button from the Web build. I have a LocalizeStringEvent on every text object but it does not update their text. Same issue with the LocalizeSpriteEvent.
    upload_2023-3-30_16-32-26.png

    I have tried several fixes that I found in the forum, including rebuilding the Addressables (I now use a script that automatically rebuild them each time I create a new build of the game), and I've also tried using
    LocalizationSettings.InitializationOperation
    to wait for the tables to load before displaying the text but it does not work either.
    I am now running out of ideas to solve this problem.

    I am using Unity 2022.1.23f1, with the lastest version of the Localization package (v1.0.5) and the lastest TextMeshPro release (v3.0.6)

    Thank you in advance for the help!
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,300
    Hi,
    I would first try updating the package to 1.4.3 (latest). If you cant see it in the package manager try enabling show all versions, if that does not work try editing the manifest.json file in the project Packages folder and setting the version manually.
    Do a clean and rebuild of the addressables again after this. If its still not working can you check the log file? There should be error messages in the javascript console.
     
  3. Ardos12

    Ardos12

    Joined:
    Sep 25, 2019
    Posts:
    3
    Hi, thank you for the quick response!

    I forced the package update (I had to manually edit the manifest.json file) and I created a new build. It did not fix the problem. I took a look at the javascript console and it seems that something is loading properly.

    I exported the logs, I filtered it to only keep the errors:

    Applying workaround to Firefox bug https://bugzilla.mozilla.org/show_bug.cgi?id=1397977 Mech's Mechanic - HTML.loader.js:1:1309
    Asset Bundle download is complete, but no data have been received
    Mech's Mechanic - HTML.framework.js.gz:3:35051
    RemoteProviderException : Unable to load asset bundle from : http://localhost:57902/StreamingAss...s_all_a42bff522bccfbea47e23b645e6fd46b.bundle
    UnityWebRequest result : ConnectionError : Received no data in response
    ResponseCode : 200, Method : GET
    url : http://localhost:57902/StreamingAss...s_all_a42bff522bccfbea47e23b645e6fd46b.bundle

    Mech's Mechanic - HTML.framework.js.gz:3:35051
    OperationException : GroupOperation failed because one of its dependencies failed
    RemoteProviderException : Unable to load asset bundle from : http://localhost:57902/StreamingAss...s_all_a42bff522bccfbea47e23b645e6fd46b.bundle
    UnityWebRequest result : ConnectionError : Received no data in response
    ResponseCode : 200, Method : GET
    url : http://localhost:57902/StreamingAss...s_all_a42bff522bccfbea47e23b645e6fd46b.bundle

    Mech's Mechanic - HTML.framework.js.gz:3:35051
    System.Exception: Dependency Exception ---> UnityEngine.ResourceManagement.Exceptions.OperationException: GroupOperation failed because one of its dependencies failed ---> UnityEngine.ResourceManagement.Exceptions.RemoteProviderException: RemoteProviderException : Unable to load asset bundle from : http://localhost:57902/StreamingAss...s_all_a42bff522bccfbea47e23b645e6fd46b.bundle
    UnityWebRequest result : ConnectionError : Received no data in response
    ResponseCode : 200, Method : GET
    url : http://localhost:57902/StreamingAss...s_all_a42bff522bccfbea47e23b645e6fd46b.bundle


    --- End of inner exception stack trace ---
    --- End of inner exception stack trace ---
    2 Mech's Mechanic - HTML.framework.js.gz:3:35051
    OperationException : GroupOperation failed because one of its dependencies failed
    System.Exception: Dependency Exception ---> UnityEngine.ResourceManagement.Exceptions.OperationException: GroupOperation failed because one of its dependencies failed ---> UnityEngine.ResourceManagement.Exceptions.RemoteProviderException: RemoteProviderException : Unable to load asset bundle from : http://localhost:57902/StreamingAss...s_all_a42bff522bccfbea47e23b645e6fd46b.bundle
    UnityWebRequest result : ConnectionError : Received no data in response
    ResponseCode : 200, Method : GET
    url : http://localhost:57902/StreamingAss...s_all_a42bff522bccfbea47e23b645e6fd46b.bundle


    --- End of inner exception stack trace ---
    --- End of inner exception stack trace ---
    Mech's Mechanic - HTML.framework.js.gz:3:35051
    ResourceManagerException : ProvideResources failed
    OperationException : GroupOperation failed because one of its dependencies failed
    System.Exception: Dependency Exception ---> UnityEngine.ResourceManagement.Exceptions.OperationException: GroupOperation failed because one of its dependencies failed ---> UnityEngine.ResourceManagement.Exceptions.RemoteProviderException: RemoteProviderException : Unable to load asset bundle from : http://localhost:57902/StreamingAss...s_all_a42bff522bccfbea47e23b645e6fd46b.bundle
    UnityWebRequest result : ConnectionError : Received no data in response
    ResponseCode : 200, Method : GET
    url : http://localhost:57902/StreamingAss...s_all_a42bff522bccfbea47e23b645e6fd46b.bundle


    --- End of inner exception stack trace ---
    --- End of inner exception stack trace ---
    Mech's Mechanic - HTML.framework.js.gz:3:35051
    OperationException : ChainOperation failed because dependent operation failed
    ResourceManagerException : ProvideResources failed
    OperationException : GroupOperation failed because one of its dependencies failed
    System.Exception: Dependency Exception ---> UnityEngine.ResourceManagement.Exceptions.OperationException: GroupOperation failed because one of its dependencies failed ---> UnityEngine.ResourceManagement.Exceptions.RemoteProviderException: RemoteProviderException : Unable to load asset bundle from : http://localhost:57902/StreamingAss...s_all_a42bff522bccfbea47e23b645e6fd46b.bundle
    UnityWebRequest result : ConnectionError : Received no data in response
    ResponseCode : 200, Method : GET
    url : http://localhost:57902/StreamingAss...s_all_a42bff522bccfbea47e23b645e6fd46b.bundle


    --- End of inner exception stack trace ---
    --- End of inner exception stack trace ---
    Mech's Mechanic - HTML.framework.js.gz:3:35051
    No Locale could be selected:
    No Locales were available. Did you build the Addressables?
    The following (3) IStartupLocaleSelectors were used:
    UnityEngine.Localization.Settings.CommandLineLocaleSelector
    UnityEngine.Localization.Settings.SystemLocaleSelector
    UnityEngine.Localization.Settings.SpecificLocaleSelector
    Mech's Mechanic - HTML.framework.js.gz:3:35051
    System.Exception: SelectedLocale is null. Database could not get table.
    Mech's Mechanic - HTML.framework.js.gz:3:35051
    OperationException : SelectedLocale is null. Could not get table entry.
    Mech's Mechanic - HTML.framework.js.gz:3:35051
    OperationException : Load Table Entry Operation Failed
    Mech's Mechanic - HTML.framework.js.gz:3:35051
    System.Exception: SelectedLocale is null. Database could not get table.
    Mech's Mechanic - HTML.framework.js.gz:3:35051
    OperationException : SelectedLocale is null. Could not get table entry.
    Mech's Mechanic - HTML.framework.js.gz:3:35051
    System.Exception: SelectedLocale is null. Database could not get table.
    Mech's Mechanic - HTML.framework.js.gz:3:35051
    OperationException : SelectedLocale is null. Could not get table entry.
    Mech's Mechanic - HTML.framework.js.gz:3:35051
    System.Exception: SelectedLocale is null. Database could not get table.
    Mech's Mechanic - HTML.framework.js.gz:3:35051
    OperationException : SelectedLocale is null. Could not get table entry.
    Mech's Mechanic - HTML.framework.js.gz:3:35051
     
  4. Ardos12

    Ardos12

    Joined:
    Sep 25, 2019
    Posts:
    3
    Well, I searched the forum for similar issues with the "RemoteProviderException" and I found that it is a bug with the Adressable when using WebGL that has been fixed in Unity 2022.1.24
    So I downloaded it and tried exporting and now it works. Mystery solved!

    Thank you for the help, I had not thought of opening my browser console to see the errors.
     
  5. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,300
    Ah great news. I was waiting on a response from the addressables team but it sounds like you solved it. :)