Welcome,
Guest
. Please
login
or
register
.
October 03, 2024, 08:49:12 AM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Localizing formatted strings
« previous
next »
Print
Pages: [
1
]
Author
Topic: Localizing formatted strings (Read 1814 times)
capitalj
Jr. Member
Thank You
-Given: 5
-Receive: 0
Posts: 88
Localizing formatted strings
«
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:
rangeLocalize
.
key
=
"weaponRange"
;
rangeLocalize
.
Localize
(
)
;
rangeLabel
.
text
=
string
.
Format
(
rangeLabel
.
text
, stats
.
range
)
;
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: Localizing formatted strings
«
Reply #1 on:
July 19, 2013, 01:44:45 AM »
rangeLabel.text = string.Format(Localization.Localize("weaponRange"), stats.range);
Logged
capitalj
Jr. Member
Thank You
-Given: 5
-Receive: 0
Posts: 88
Re: Localizing formatted strings
«
Reply #2 on:
July 19, 2013, 02:37:46 PM »
That worked! thank you.
-JJ
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Localizing formatted strings