How do you internationalize strings built up from multiple string fragments?
void printStuff(ostream Os,
string WarningPart, string SizePart, string EndPart, int Size) {
//The English version might look like:
//"Warning: Size too big (200). Get smaller."
Os << WarningPart << SizePart << Size << EndPart << endl;
};
I expect that if I thought about the problem for a few minutes (and was unable to find any C++ i18n libraries) I would come up with something much nicer and easier to use than this thing I spent ten seconds working on. :)printf format strings are well thought-out. I was demonstrating that the same ideas can easily be used with io*stream.
:)
[0] http://www.boost.org/doc/libs/1_60_0/libs/locale/doc/html/in...
[1] http://www.boost.org/doc/libs/1_60_0/libs/locale/doc/html/he...
[2] http://www.boost.org/doc/libs/1_60_0/libs/locale/doc/html/me...
With printf, we have gettext. I don't really see how there's any analogy for gettext in iosream-world.
Funny thing. Boost more-or-less uses gettext, too! https://news.ycombinator.com/item?id=10774941