Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: capitalj on July 18, 2013, 05:40:21 PM

Title: Localizing formatted strings
Post by: capitalj on July 18, 2013, 05:40:21 PM
Hi,

I'm trying to localize strings with {0} type of formatting. If I inspect the code with breaks the text gets properly formatted, but in the editor the text either doesn't get replaced or reverts back to the original localization:

Localization text file:
weaponRange = Range: {0}

Script:
  1. rangeLocalize.key = "weaponRange";
  2. rangeLocalize.Localize();
  3. rangeLabel.text = string.Format(rangeLabel.text, stats.range);
Title: Re: Localizing formatted strings
Post by: ArenMook on July 19, 2013, 01:44:45 AM
rangeLabel.text = string.Format(Localization.Localize("weaponRange"), stats.range);
Title: Re: Localizing formatted strings
Post by: capitalj on July 19, 2013, 02:37:46 PM
That worked! thank you.

-JJ