Welcome, Guest
Username: Password: Remember me

TOPIC: Dynamically assign translation?

Dynamically assign translation? 4 years 9 months ago #158

  • aholla
  • aholla's Avatar
  • Offline
  • New Member
  • Posts: 7
  • Karma: 0
Hi I was wondering how I would access the Translation in code? I have a list of fields and wan to to be able to look up the terms based upon an id or a string or something.

Thanks,

Adam
The administrator has disabled public write access.

Dynamically assign translation? 4 years 9 months ago #159

  • Frank
  • Frank's Avatar
  • Offline
  • Administrator
  • Posts: 1206
  • Thank you received: 256
  • Karma: 78
Hi,

You can translate any term (ID) by using
string Translation = ScriptLocalization.Get( Term )

If what you want its changing the localization to attach numbers or other things, Like transforming
"THE SCORE IS {SCORE}" into "THE SCORE IS 320"

Then you can use the localization callbacks. There is an example on the "UnityStandards Localization" scene


More details at: www.inter-illusion.com/forum/i2-localiza...irectly-from-scripts


If you want to execute your scripts everytime the language is changed, use the LocalizationManager.OnLocalizeEvent
www.inter-illusion.com/forum/i2-localiza...-call-without-target

Thanks,
Frank
Are you :-) Give I2L 5 stars!
Are you :-( Please lets us know how to improve it!
To get the betas as soon as they are ready, check this out
The administrator has disabled public write access.
The following user(s) said Thank You: aholla
Time to create page: 0.104 seconds
Template by JoomlaShine