com.unity.localization without addressables

The localization components are great but the addressables are causing so much trouble (especially if you don’t need any of the benefits that addressables bring)

I know that the fact that the localization tables are addressables is a central feature, but has anyone tried to fork out the source to try to use the same system, editor and components but without relying on addressables for deployment? Anything simple like a csv file would do.

3 Likes

The earlier versions did just use asset files(json) however the problem arises when you need to support getting these asset files from different locations, platforms, servers etc. Managing the loading and unloading, especially of assets.
Essentially we needed an Addressable asset system and one came along at just the right time :wink:

What problems are you having with Addressables? Maybe we can improve that side of things.

I agree. I’ve spent a lot of time trying to get Addressables to be modding friendly, and it’s just not. The easiest way to do modding is with AssetBundles directly, or by loading json/csv etc. and other files directly from the file system. Addressables just complicates everything unnecessarily for my use case. There’s been many long threads on the Addressables forum regarding modding, and Unity staff never really gives any input in them. I’ve also given feedback on Addressables surveys about it. But it doesn’t look like it’s really a priority for the Addressables team.

I also would love to use the localization system you guys are developing, but when I saw that it relies on Addressables, I had to decide to stick with my own system. I can understand why you’ve chosen to go the Addressables route given all the things you need to support, but it would be nice to be able to have the localization database in the editor, then be able to serialize it to json/csv/xml or whatever in the editor to a chosen file location, and then be able to just import those files in at runtime. This makes the files easily editable in a build without having to use Addressables to create an AssetBundle for it. Will this be possible in the future?

1 Like

Yes we have plans to support this in the future. It is possible to do this through addressables, they don’t have to be asset bundles. This user wrote some code to use Csv Creating StringTable at Runtime

2 Likes

Does anyone found a way to build a project, that is using the localization feature, without the addressables?
As Korindian said the localization feature is awesome but I’m having problems because of addressables.
My builds are having font problems (they aren’t being loaded properly) and if I do the same build without the addressables then my font problem is fixed, but then I lose the localization feature benefits.

This is not possible at the moment. Addressables is a core component. We are making changes in 2.0 to make it easier to extend the system without using addressables but we won’t be completely removing addressable support, we would just have to create a new addressable system to replace it which makes no sense.
It would be simpler for us to fix the font issues you are having rather than create a new system :wink:
Have you filled a bug report?

1 Like

Hi Karl. Thank you for your answer.
Yes! I filled in a bug report.
I’m asking for this workaround because I figured out today that the problem was with the addressables and I thought someone could have found a solution for that.
I hope we find a solution soon. :slight_smile:

Do you have the bug number? Maybe I can find a workaround.

Yes. It is case 1425287.
When I submitted the bug my workaround script was working if my project have all text fields active on the scene.
However, the bug still occurs if I have hidden text fields that will appear after some interaction or if I change the current scene.
So now, even with the workaround script, I’m having problems with the text and fonts. Sometimes my scene is loaded with a blank text field because somehow the font is not loaded and the content isn’t visible.
My workaround script just set the correct font for a text field if the Localization Settings change. I got it from here: Localize Font

Thank you Karl

1 Like

Hey. It looks like this may be a bug with TextMeshPro. QA has now reproduced the issue. Unfortunately, I cant see a workaround for this at the moment. I think it could be related to WebGL.

1 Like

Hi Karl,

Thank you for checking this bug. I did the build for Windows and the bug still happens, so I don’t believe it’s a WebGL problem. It’s good to know that can be a problem with TextMeshPro.

What I think it’s weird is that this bug occurs when I use the addressable, even if I didn’t change the language while I’m using a build.
When I create a build without the addressable my fonts work properly.

In any case, I’ll check this thread frequently to see if anyone has some updates and I’ll wait for the bug report answer.

Thank you again for your help.

Hi Karl,
I did another test and it works as a workaround if I use that script to update the font and remove the font changes from the Game Object Localizer component (check the image)

1 Like

Hey I believe this is a duplicate of this bug Unity Issue Tracker - [iOS] Chinese locale fails and logs "Please assign a Font Asset to this Text (TMP) gameobject" when using TextMeshPro Text

We have now identified the issue and a fix will be available in the next release. More info here Works in editor but not in build - addressables build done - Unity Engine - Unity Discussions

1 Like

Awesome! Thank you, Karl.
Do you know when the next release will be available?

1.4 is due in October although we will aim to do a 1.3 patch release around June.

1 Like

After

Resources.UnloadUnusedAssets();
or 
AssetBundle.UnloadAllAssetBundles(true);

is used an exception occurs:

MissingReferenceException: The object of type ‘StringTable’ has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
UnityEngine.Object.get_name () (at /Users/bokken/buildslave/unity/build/Runtime/Export/Scripting/UnityEngineObject.bindings.cs:189)
UnityEngine.Localization.Tables.LocalizationTable.VerifySharedTableDataIsNotNull () (at Library/PackageCache/com.unity.localization@1.4.4/Runtime/Tables/LocalizationTable.cs:154)
UnityEngine.Localization.Tables.LocalizationTable.FindKeyId (System.String key, System.Boolean addKey) (at Library/PackageCache/com.unity.localization@1.4.4/Runtime/Tables/LocalizationTable.cs:147)
UnityEngine.Localization.Tables.DetailedLocalizationTable`1[TEntry].GetEntry (System.String key) (at Library/PackageCache/com.unity.localization@1.4.4/Runtime/Tables/DetailedLocalizationTable.cs:521)
GU.Launcher.Services.Localization.LocalizationStringTable.GetString (System.String stringName) (at Assets/Game/Client/Launcher/Scripts/Runtime/Services/Localization/LocalizationStringTable.cs:16)

How can I prevent this and prevent tables from being unloaded?

Unity 2019.4.34f1. Localization 1.4.5

Tables are stored in Asset bundles so if you do AssetBundle.UnloadAllAssetBundles(true) then its going to unload them. Why are you doing that?

When we exit the game scene and go to the lobby scene, we must unload all assets used by the game

That method unloads all assets including the ones being used.
You should unload the ones you know are not being used.
If you are using Addressables to handle it then you should release any references you have to assets and it will unload them for you.