Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: jeldrez on April 08, 2013, 06:22:45 PM

Title: [solved] Localization text with callbacks?
Post by: jeldrez on April 08, 2013, 06:22:45 PM
There's any way to introduce callback in localized strings?


For example:
Hi <user>, it's been a while since we met.


And <user> is defined in other screen with and  input widget.


is this possible?


Thanks!
Title: Re: Text with callbacks?
Post by: Nicki on April 09, 2013, 01:58:48 AM
Consider using string.Format?

  1. string.Format("Hello {0}. How are you today?", mName);
Title: Re: Text with callbacks?
Post by: jeldrez on April 09, 2013, 01:04:10 PM
But I've the string in the .txt file for localization.
can I string format the key?
Title: Re: Text with callbacks?
Post by: ArenMook on April 09, 2013, 09:39:31 PM
label.text = string.Format(Localization.Localize("Some Key"), 123);

Some Key = There are {0} questions in this forum
Title: Re: Text with callbacks?
Post by: jeldrez on April 10, 2013, 10:33:47 AM
Thanks a lot Aren!