Applying global parameters through code
4 years 2 months ago #4216
by Graham
Applying global parameters through code was created by Graham
I see an old example here
http://inter-illusion.com/forum/i2-localization/748-parameters-isn-t-change-when-i-apply-text-by-code#1973http://inter-illusion.com/forum/i2-localization/748-parameters-isn-t-change-when-i-apply-text-by-code#1973
but it seems outdated. Could I get an up to date example of translating a text and applying global parameters at the same time through code?
Thanks
Thanks
Please Log in or Create an account to join the conversation.
4 years 2 months ago #4217
by Graham
Replied by Graham on topic Applying global parameters through code
I've tried: (where the termKey = The best player was {[WINNER}]!)
string dialogue = LocalizationManager.GetTranslation(termKey);
LocalizationManager.ApplyLocalizationParams(ref dialogue, true);
But it doesn't do anything, I've added the GlobalParametersExample component to the scene.
string dialogue = LocalizationManager.GetTranslation(termKey);
LocalizationManager.ApplyLocalizationParams(ref dialogue, true);
But it doesn't do anything, I've added the GlobalParametersExample component to the scene.
Please Log in or Create an account to join the conversation.
4 years 2 months ago #4223
by Frank
Are you
Give I2L
5 stars!
Are you
Please lets us know how to improve it!
Replied by Frank on topic Applying global parameters through code
There seems to be a typo in the tags: instead of {[ }] use {[ ]} (see the order of ] and })
Also, you can avoid using ApplyLocalizationParams by doing:
Hope that helps,
Frank
Also, you can avoid using ApplyLocalizationParams by doing:
string dialogue = LocalizationManager.GetTranslation(termKey, applyParameters:true);
Hope that helps,
Frank
Are you

Are you

To get the betas as soon as they are ready,
check this out
Please Log in or Create an account to join the conversation.
Time to create page: 0.151 seconds