The localization works well on editor. but when i try to do it on build on an actual Iphone device I get the below. On the screen, the text becomes blank, probably because no font asset is found. However, it seems to only happens after i do an Addressables loadScene.
Please assign a Font Asset to this Text (TMP) gameobject.
TMPro.TextMeshProUGUI:Rebuild(CanvasUpdate)
UnityEngine.UI.CanvasUpdateRegistry:performUpdate()
UnityEngine.WillRenderCanvases:Invoke()
I confirm that i have done the addressables āNew buildā. Many times in fact. I also have done the Addressables Analysis - no errors.
Hi Karl, thanks for responding. Submitted https://fogbugz.unity3d.com/default.asp?1419084_cjlbvkiprbq37i85 (Case 1419084). I created a whole new app within nothing but two scenes, two tmp_texts, two buttons, addressables/localization, and is able to replicate the problem.
I also added a screenshot on how it looks on unity vs the actual app. Itās a bit strange, the initial scene is fine but after addressables loading, all the text goes blank.
(Also i dont know why but my phone is in Chinese yet the app dosenāt change anything, on scene1).
Hi Karl, sorry not sure if i was doing it correctly. I looked at the link you provided and followed the steps. I submited the bug in unity ā Help->Report a Bug in the menu
Can i also ask a stupid question, i saw in some threads there were samples but i couldnāt find any link. Is there a demo / or sample repository/scene somewhere which I can take a look to see?
Yes thatās correct.
The samples are in the package manager window under the localization package details. There is a section near the bottom of the panel
Hi, I spent almost two days trying to figure this out - to no avail. It appears itās a problem even with a completely new project and just a single scene with 1 text, 1 string table key. The localization doesnāt get picked up on ios build. (unrelated to loadSceneAsync)
I can confirm that the SelectedLocaleAsync picks up a locale: Chinese (Simplified) (zh-Hans). But the error is seen in xcode: Please assign a Font Asset to this Text (TMP) game object. I think, as a result, nothing is picked up, and neither the English nor Chinese text is not picked up. Addressables: 1.19.17, Localization: 1.2.1, Unity 2023.3.27f1:
Itās really weird. It works with the sample āLanguage Selection UGUIā, also with just 1 text string. I checked file by file (addressables settings, localization settings, fonts, localization tables, scene control), and even the addressables, localization version. But the same setup dosenāt work with a completely new project.
Thereās literally nothing much to set up: localization locales (selector, identifier), string table, scene control, creating TMP font asset, adding it in the Chinese active locale. (did exactly the same in both the sample repo and a new repo). Confused
Giving up for nowā¦ and wondering why no one has had this issue. I created another bug report (Case 1419539) because itās a different description than the earlier one.
Hi Karl, I was wondering if there might be any workaround, I am unable to get any translation at all working, even if itās just 1 string and nothing else in the entire code. The error was also replicated by QA.
Unfortunately, I have some client pilots upcoming, and I donāt any workaround for this.
Hmm. I dont seem to have permission to view your bug report (IN-2140). We are in the process of changing bug tracking systems so it could be that. Ill ask them. I was able to look at 1419539.
I dont see any problems with 1419539. I dont have access to an iOS device to test but I could use the device simulator, does the error reproduce for you when using the xcode device simulator?
Hey! So after spending some time I can now say this is indeed a Localization package bug.
The GameObjectLocalizer works by applying changes to the target object using JSON. When applying changes to a Unity Object reference we need to apply the reference by its instance id.
E.G if the object has id 3276 then the font json would look like:
ām_fontAssetā : {
āinstanceIDā : 3276
}
The problem is that in earlier versions of Unity (before 2022.2) this property name was actually different in the player and would not work, instead we needed to use ā.m_FileIDā in the player, not āinstanceIDā. I reported this and it was subsequently fixed in 2022.2. We added a workaround:
However, this was only applied to localized assets(assets in an Asset table), not those that were local(using a UnityObjectProperty). It looks like we had hardcoded ā.instanceIDā for local objects.
The reason QA thought it was fixed in the latest release was down to this fix in 2022.2.
Iāll get it fixed in the package for the next release, thanks for your help.
For now you can work around this by not using local assets, use assets in Asset tables instead. This means you need to create an empty asset table and assign it to the Asset Table field in the Scene Controls. Now changes will be stored in the asset table instead of the component. Localized Property Variants | Localization | 1.3.2
You will need to remove and recreate the existing variants you have.
Assets go into the asset tables and the strings go into the string tables. So you need both.
We are working on changes in 2.0 so there will be 1 universal table type so in the future it can just be 1 table but thatās far away now.
I still canāt get it to work properly Neither the traditional or simplified Chinese characters seems to populate correctly, even when using Assets. The characters donāt even show squares, just missing characters.
Do you have any tips? I did try a completely new project with 2021 version instead. Though it looks like it works thereā¦ Should I try with an updated unity version?
Those squares indicate that the font is missing the character. If its working in 1 version but not the other then that does seem to indicate thereās a bug but it may have been fixed in the newer versions. Feel free to file a bug report so we can look into it.