Preserve spaces within an XML attribute

Troller0001

I've anxiously awaited your arrival!
Joined
Mar 9, 2016
Messages
755
Location
The Netherlands
So I was wondering if it'd be possible to preserve a white space within an XML attribute

Right now, this code:
Code:
...
<Row Tag="TXT_KEY_HQ_ESTABLISHED">
	<Text>International Headquarters have established within </Text>
</Row>
...
outputs as this: "International Headquarters have established within". However, I want it to output this: "International Headquarters have established within " (For those of you who don't see the difference, it's the white space at the end of the line :))

Is there any way to do that?

(Why do I want this: I'm using this TXT_KEY in a Lua code. However, there's a city name after the text line, meaning that I need a space there
"...established within Rabat" rather than "...established withinRabat")

Thanks in advance!
 
Use "International Headquarters have established within {1_CityName}" and pass the city name as the second parameter into Locale.ConvertTestKey(), eg

Code:
local sText = Locale.ConvertTextKey("TXT_KEY_HQ_ESTABLISHED", pHqCity:GetName())
 
Use "International Headquarters have established within {1_CityName}" and pass the city name as the second parameter into Locale.ConvertTestKey(), eg

Code:
local sText = Locale.ConvertTextKey("TXT_KEY_HQ_ESTABLISHED", pHqCity:GetName())

Thanks for the quick response!
 
For future reference, would this also work for units, leaders, Civ's names (not the leader name) and religions?
That would obviously mean that "pHqCity:GetName()" should be replaced by another function for the things mentioned above (E.g. pLeader:GetName() or sth like that; the ModWiki will help me there), but to what should I change the "{1_CityName}"?
 
Back
Top Bottom