Localization mismatch with the addressable catalog when adding new locales

Hi,

I’m having an issue when adding new locales to Localization.

I’m using Addressable and CCD to deliever remote contents (levels,textures) and all the locale asset groups are local.

On my app start up, I setup the locale selector like this, using English as the fallback:

Everything works fine till I added new locales (CJK aka Chinese/Japanese/Korean) to my project recently. I try to use the previous player build (without CJK locale setup) to load new CCD content(with CJK locale setup). As we release the level updates periodically and the user wont update theri installed app immediately, this is common scenario we have to face.

In this case, after player update the catalog, Localization tries to load the CJK related assets and failed, which also leads to the failure that all locale asset failed to load.

2024/10/14 17:48:49.970 25170 25246 Info Unity Failed op : Resource<Locale>(Chinese (Traditional) (zh-hant).asset)
2024/10/14 17:48:49.971 25170 25246 Error Unity System.Exception: Unable to load asset of type UnityEngine.Localization.Locale from location Assets/BlockPuzzle/Localization/Locales/Japanese (ja).asset.
2024/10/14 17:48:49.971 25170 25246 Info Unity Failed op : Resource<Locale>(Japanese (ja).asset)
2024/10/14 17:48:49.972 25170 25246 Error Unity System.Exception: Unable to load asset of type UnityEngine.Localization.Locale from location Assets/BlockPuzzle/Localization/Locales/Korean (ko).asset.
2024/10/14 17:48:49.972 25170 25246 Info Unity Failed op : Resource<Locale>(Korean (ko).asset)
2024/10/14 17:48:49.973 25170 25246 Info Unity Failed op : Dependencies [Chinese (Traditional) (zh-hant).asset..., English (en).asset..., French (fr).asset..., German (de).asset..., Italian (it).asset..., Japanese (ja).asset..., Korean (ko).asset..., Portuguese (pt).asset..., Russian (ru).asset..., Spanish (es).asset..., Vietnamese (Vietnam) (vi-VN).asset...]
2024/10/14 17:48:49.982 25170 25246 Error Unity No Locale could be selected:
2024/10/14 17:48:49.982 25170 25246 Error Unity The following (8) Locales were considered:
2024/10/14 17:48:49.982 25170 25246 Error Unity 	Vietnamese (Vietnam) (vi-VN)
2024/10/14 17:48:49.982 25170 25246 Error Unity 	English (en)
2024/10/14 17:48:49.982 25170 25246 Error Unity 	French (fr)
2024/10/14 17:48:49.982 25170 25246 Error Unity 	German (de)
2024/10/14 17:48:49.982 25170 25246 Error Unity 	Italian (it)
2024/10/14 17:48:49.982 25170 25246 Error Unity 	Portuguese (pt)
2024/10/14 17:48:49.982 25170 25246 Error Unity 	Russian (ru)
2024/10/14 17:48:49.982 25170 25246 Error Unity 	Spanish (es)
2024/10/14 17:48:49.982 25170 25246 Error Unity The following (3) IStartupLocaleSelectors were used:
2024/10/14 17:48:49.982 25170 25246 Error Unity 	UnityEngine.Localization.Settings.CommandLineLocaleSelector
2024/10/14 17:48:49.982 25170 25246 Error Unity 	UnityEngine.Localization.Settings.SystemLocaleSelector
2024/10/14 17:48:49.982 25170 25246 Error Unity 	UnityEngine.Localization.Settings.SpecificLocaleSelector

As my understanding, Localization is built on Addressable system and Addressable catalog file holds all the assets management by the Addressable system, so Addressable catalog will includes all the Localization assets as internal ID, like Locales/String Tables. But I dont understand why the Localization tries to load the locales not existed in the local device and why Localization wont fallback to the existed locale in the local device.

Is there anything I can do the avoid this? At least the user could fallback to the existed locales.

My environment is as below:

  • Unity: LTS 2021.3.39
  • Addressable: 1.21.19
  • Localization: 1.4.4
  • CCD Management: 2.2.2

Thank you!

Is localization running before you have updated the catalog? When do you run the update?
What version of the package are you using?

Yes, Localization running before the catalog updating. Here is the startup sequence:

  • Addressable intialization
  • Localization initialization
  • Show the loading text (localized) and progress
  • Update the catalog
  • Predownload the remote content

Package version:

  • Unity: LTS 2021.3.39
  • Addressable: 1.21.19
  • Localization: 1.4.4
  • CCD Management: 2.2.2

You want localization to run after the catalog update or it will be using the wrong data.
If you can do the catalog updates in a scene that does not contain any localization so you can avoid it being initialized too early. If that wont work you can reset the localization system and start initialization again after your changes.

This will reset it:

var disposable = (IDisposable)LocalizationSettings.Instance;
disposable.Dispose();

Thanks Carls, I’ll try your suggestion.

1 Like

Hi Karl,

I disable the Addressable setting Only update catalog manually (which make sure that catalog will be updated during the Addressable initialization and I confirm this happened via Addressable logs ) and tried again. The Localization still try to load the CJK locale assets which not exist.

Did the errors change or were they the same as before?
Did you try resetting the localization system?

The errors are the same as before. And I also tried the ‘reset’, the result is still the same.

Above tests are all based on real Android device, but I found that this issue does not occur on Editor Player (With Play Mode Script is Use Exisiting Build).

Im not really sure what it could be, we will need to debug the project. Could you please file a bug report so we can take a look? Unity QA: Building quality with passion

Hi Karl,

Thanks for your swift support!

I’ll try to build a mini project which could reproduce this issue.
If you have any idea or possible solution on this issue, please let me know :smiley:

1 Like

Hi Karl,

I’ve filed a bug report with CASE IN-86605 (from the confirmation email) and submit a mini project which should reproduce this issue.

1 Like

@karl_jones

Hi Karl,

I want to confirm one thing.
Is the Localization intitialization process depending on the internal ids listed in the addressable catalog.
If one locale assets were not listed in the catalog, the Localization wont load the assets belonged to that locale during intialization, even if those assets do exist in the local device. Right?

"m_InternalIds": [
    ...,

    "{UnityEngine.AddressableAssets.Addressables.RuntimePath}/Android/localization-assets-shared_assets_all.bundle",
    "{UnityEngine.AddressableAssets.Addressables.RuntimePath}/Android/localization-locales_assets_all.bundle",
    "{UnityEngine.AddressableAssets.Addressables.RuntimePath}/Android/localization-string-tables-english(en)_assets_all.bundle",
    "{UnityEngine.AddressableAssets.Addressables.RuntimePath}/Android/localization-string-tables-french(fr)_assets_all.bundle",
    "{UnityEngine.AddressableAssets.Addressables.RuntimePath}/Android/localization-string-tables-german(de)_assets_all.bundle",
    "{UnityEngine.AddressableAssets.Addressables.RuntimePath}/Android/localization-string-tables-italian(it)_assets_all.bundle",
    "{UnityEngine.AddressableAssets.Addressables.RuntimePath}/Android/localization-string-tables-portuguese(pt)_assets_all.bundle",
    "{UnityEngine.AddressableAssets.Addressables.RuntimePath}/Android/localization-string-tables-russian(ru)_assets_all.bundle",
    "{UnityEngine.AddressableAssets.Addressables.RuntimePath}/Android/localization-string-tables-spanish(es)_assets_all.bundle",
    "{UnityEngine.AddressableAssets.Addressables.RuntimePath}/Android/localization-string-tables-vietnamese(vietnam)(vi-vn)_assets_all.bundle",

    ...,

    "Assets/Localization/Locales/English (en).asset",
    "Assets/Localization/Locales/French (fr).asset",
    "Assets/Localization/Locales/German (de).asset",
    "Assets/Localization/Locales/Italian (it).asset",
    "Assets/Localization/Locales/Portuguese (pt).asset",
    "Assets/Localization/Locales/Russian (ru).asset",
    "Assets/Localization/Locales/Spanish (es).asset",
    "Assets/Localization/Locales/Vietnamese (Vietnam) (vi-VN).asset",
    "Assets/Localization/StringTable/AppInfoIOS/AppInfoIOS Shared Data.asset",
    "Assets/Localization/StringTable/AppInfoIOS/AppInfoIOS_de.asset",
    "Assets/Localization/StringTable/AppInfoIOS/AppInfoIOS_en.asset",
    "Assets/Localization/StringTable/AppInfoIOS/AppInfoIOS_es.asset",
    "Assets/Localization/StringTable/AppInfoIOS/AppInfoIOS_fr.asset",
    "Assets/Localization/StringTable/AppInfoIOS/AppInfoIOS_it.asset",
    "Assets/Localization/StringTable/AppInfoIOS/AppInfoIOS_pt.asset",
    "Assets/Localization/StringTable/AppInfoIOS/AppInfoIOS_ru.asset",
    "Assets/Localization/StringTable/AppInfoIOS/AppInfoIOS_vi-VN.asset",
 
    ...,

  ],

Yes they need to be in the addressables catalog. We rely on addressables to find the assets. For content updates you can update the catalog like so Content update workflow | Addressables | 1.16.19