Hello, I’m testing the Unity Localization to see if its worth it for me to move from I2. However, I’ve found two issues which I have not seen others encountered and I have not found a way yet of solving them.
First one: When I play in the Editor, the screen seems to retain the previous values and everything starts getting sticky. Here is a video:
Second one: From the documentation, it seems that when I have a “LocalizedString” in the inspector, it’s supposed to allow me to create and choose existing localized terms. However, I’m only getting the option to add keys and values. Am I doing something wrong?
using UnityEngine;
using UnityEngine.Localization;
public class Apples : MonoBehaviour
{
public int appleCount = 1;
[SerializeField] LocalizedString stringToChange;
[SerializeField] LocalizedString stringToAdd;
}
And lastly two questions, sometimes I want to move around a string component in the scene for position it seems that it just moves around the instance of that language rather than the general object (aka: if I change the language, the object goes back to the previous position). Do I need to keep pressing “None” language, or set to “Not tracking” whenever I want to move localized text around the scene?
And, do the variables to use smartstrings need to be always public? We don’t really have anything public in our game other than methods and properties.
That looks like the camera is not clearing. Do you have a camera and does it have Clear Flags set to clear?
Something is interfering with the property drawers, I see this a lot when the Odin plugin is used. Try adding an exception so that it does not handle LocalizedString.
I would either set the language to “None” or disable tracking when not making language-specific changes.You don’t need to do both though, just disabling tracking is enough unless the value is already being tracked in which case it will update the existing tracked values.
If you are using reflection then they do need to be public. There are other ways to pass values in if you dont want them to be public. Wrap them in a different class/struct and pass that in. Use a dictionary or persistent variable source.
You were right, although I do not have that specific variable, I found one with similar options in the 2D URP project. That issue happens when the Environment => Background Type is set to Skybox. If I change it to Solid Color is gone.
Seems like Odin updated this, I grabbed the last update and now is working fine!
Sounds good. Thinking more about it, most of my concatenation would happen within my scripts rather than on the inspector. I’m using “smart string” and something like “stringToChange.Add(“heart”, stringToAdd);”. That seems to work fine.
One extra questions regarding features:
Is there a way to extract all the unique characters being used in the game for a specific language? That is super useful when creating a static font in TextMeshPro.