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.
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
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?
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
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
Have you filled a bug report?
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.
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
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.
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.
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)
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?
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.