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

Question How to get Localization working when loading from multiple projects?

Discussion in 'Localization Tools' started by vasyl_unity176, Aug 22, 2023.

  1. vasyl_unity176

    vasyl_unity176

    Joined:
    May 11, 2023
    Posts:
    8
    Hi everyone! Addressables system allows for having the source and secondary project where the former builds the bindaries and latter the content.

    The current issue is that when I create a new string table it gets added to the table collection of the secondary project. Then I use that localization table from the GameObjectLocalizer.cs which allows me to localize a text on a game object. When I build addressables content in the secondary project and then "Use Existing Build (Android)" - everything works fine. But when I upload the built content to a CDN and try to load the scene with the localized text on a game object I get the following issues:
    1. A warning on the scene loaded from the CDN:
      upload_2023-8-22_10-56-10.png
    2. An exception when I change the locale in the primary project for the first time:
      upload_2023-8-22_10-56-59.png
      Given this error, the localized text doesn't change and stays the same as if the locale weren't changed.
    3. And another exception when trying to change the locale one more time:
      upload_2023-8-22_10-58-29.png
    Some additional info:
    1. The localization groups in the secondary project are configured to be remote and also the remote catalog is built.
    2. The other content updates are working fine (except for shaders, but it's a different issue).

    Please, could you let me know if it's at all possible to have the localization working give the setup above?

    @karl_jones, I figured you're the guy who always answers localization related question, so tagging you here. Thanks!
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,820
    Yes, it's possible to have the content remote however our editors do not know about the remote tables and so produce the above warning. It should still work when you enter play mode though. Could you please file a bug report for this? It will help us to prioritize adding support for this workflow.
    https://unity3d.com/unity/qa/bug-reporting
     
  3. vasyl_unity176

    vasyl_unity176

    Joined:
    May 11, 2023
    Posts:
    8
    @karl_jones, thanks for such a quick response!

    Yeah, I could get it working by having the table collections in a separate package. Could you clarify what bug ticket would you like me to file please? About the tables collections not being included in the asset bundles or the localizers not seeing it and throwing the warning?

    Also, the issue with the exceptions is still not resolved. I could get it to work only if I select a locale before loading a scene from a remote asset bundle. Changing locales from the loaded remote scene wouldn't work and would throw the above exceptions.

    I can file a bug ticket for this as well.
     
  4. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,820
    I think we may need a bug report for both issues. The editor warning and the exceptions you are getting.

    Are you using this workflow? https://docs.unity3d.com/Packages/com.unity.addressables@1.21/manual/MultiProject.html
     
  5. vasyl_unity176

    vasyl_unity176

    Joined:
    May 11, 2023
    Posts:
    8
  6. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,820
    Ok. It should work then. Could you please file a bug report with the issues you are having?
    I noticed you are using 1.4.3, Its also worth trying the latest patch 1.4.4. If you cant see it in the package manager you can manually edit the manifest.json file in the Packages folder.
     
  7. vasyl_unity176

    vasyl_unity176

    Joined:
    May 11, 2023
    Posts:
    8
    I will try, thanks!

    Could you clarify please, what did you mean by "it should work then"? I could get it to work in the way I described above. This is when using the Multiple Projects workflow. I still have to satisfy the limitations of having the localization tables and their collection in both projects and also preventing to change a locale from the loaded remote scene.
     
  8. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,820
    Having the tables in both projects has not been tested so may cause some issues. If the addressables catalogs have been set up correctly then, in theory, it should support this usage providing you are using the use existing build addressables playmode, the default fast mode will not work as it uses local assets only.

    What do you mean by this? Loading a scene should not trigger a locale change unless localization is initializing, is it initializing twice?
     
  9. vasyl_unity176

    vasyl_unity176

    Joined:
    May 11, 2023
    Posts:
    8
    @karl_jones it's not causing any issues, I have tested it, although for it to work the main project addressable content build should exclude the localization addressable groups in order for the remote ones to be used by the scene that is loaded from the remote asset bundle. I have tested it out: if we have a table A (and it's collection) in both main and secondary projects and we build the secondary project's table A addressable group as remote and then also build the main project table A addressable groups as local bundle - the latter takes precedence in the loaded remote scene.

    I mean, it's not triggering a locale change, but if I had some UI in the loaded remote scene that would allow to change the locale I would get the errors I mentioned in the first message.
     
  10. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,820
    Oh yes there would be duplicate asset names which would conflict.

    That sounds like a bug. Can you please file a bug report?
     
  11. vasyl_unity176

    vasyl_unity176

    Joined:
    May 11, 2023
    Posts:
    8
    Sure, I am going to file two bugs as we discussed above soon.
     
    karl_jones likes this.
  12. vasyl_unity176

    vasyl_unity176

    Joined:
    May 11, 2023
    Posts:
    8
    @karl_jones, here are the bug reports IDs:
    • IN-52410
    • IN-52413
    Please, let me know if I have filed them correctly, thanks!

    P.S. And thanks for being so responsive!
     
    karl_jones likes this.
  13. vasyl_unity176

    vasyl_unity176

    Joined:
    May 11, 2023
    Posts:
    8
    @karl_jones, you were right, it's not required to have the tables and their collections in both projects. I have just tried to have the tables and collections in the secondary project only and the localization seems to work in the primary project when I load the remote scene.

    So, regardless of the warning (shown in the initial thread post) the localized string can still be loaded.

    The rest of the issues (exceptions) still remain, so would be great if you get them fixed! Thanks!
     
    karl_jones likes this.