can't get the parameters to work properly...
3 years 4 months ago - 3 years 4 months ago #4397
by jcskehan
can't get the parameters to work properly... was created by jcskehan
In my terms I have one called Common.Swarm_Number, which I've put as " Swarm {[Swarm_Num]}
Then, in my menu screen, I've added a localization params manager, and made a parameter called "Swarm_Num", which I set to 1.
Now, when I call "get translation", it should just automatically recognize that {[Swarm_Num]} is a parameter, look for it, and add it in, right?
So what gives? What am I doing wrong?
--
In my menu game object (which has a child object button with text on it that I'm trying to localize), I run
and then later on
where
Common.Swarm_Number = "Swarm {[Swarm_Num]}"
Then, in my menu screen, I've added a localization params manager, and made a parameter called "Swarm_Num", which I set to 1.
Now, when I call "get translation", it should just automatically recognize that {[Swarm_Num]} is a parameter, look for it, and add it in, right?
So what gives? What am I doing wrong?
--
In my menu game object (which has a child object button with text on it that I'm trying to localize), I run
private void Awake()
{
load_data();
LocalizationParamsManager locparams = this.gameObject.AddComponent<LocalizationParamsManager>();
LocalizationParamsManager.ParamValue swarm_num = new LocalizationParamsManager.ParamValue();
swarm_num.Name = "Swarm_Num";
swarm_num.Value = swarm_in_question.ToString();
locparams._Params.Add(swarm_num);
...
}
and then later on
swarm1_np.set_text(LocalizationManager.GetTranslation("Common.Swarm_Number"));
where
Common.Swarm_Number = "Swarm {[Swarm_Num]}"
Last edit: 3 years 4 months ago by jcskehan. Reason: clarity, and code examples.
Please Log in or Create an account to join the conversation.
Time to create page: 0.154 seconds