C++ version of Locale.ConvertTextKey

whoward69

DLL Minion
Joined
May 30, 2011
Messages
8,728
Location
Near Portsmouth, UK
What's the C++ version of

Code:
local sText = Locale.ConvertTextKey("TXT_KEY_SOMETHING", 100, "a", "b", "c", "d")

where TXT_KEY_SOMETHING does NOT have to contain all of {1}, {2}, {3}, {4}, {5} and they don't have to appear in numerically ascending order

eg

TXT_KEY_SOMETHING = "From {3} to {2} via {5} costs {1_num} moves"

does anyone know if

Code:
Localization::String sText = Localization::Lookup("TXT_KEY_SOMETHING");
sText << 100;
sText << "a";
sText << "b";
sText << "c";
sText << "d";

handles this correctly?
 
Looking into the DLL source code, I haven't found anything other than the stream operations like the ones you posted. I don't know if it handles things correctly when some of the {numbers} are missing, as the localization code doesn't seem to be exposed in the DLL. So I guess you need to test this.
 
Does anyone know if

Code:
Localization::String sText = Localization::Lookup("TXT_KEY_SOMETHING");
sText << 100;
sText << "a";
sText << "b";
sText << "c";
sText << "d";

handles this correctly?

I do now :) and the answer is "Yes"
 
Back
Top Bottom