When learning to code in C++, I was convinced by the advantage of iostream over C printf, such as better type checking. C++ syntactic features have been used to devise the stream operators and manipulators to match what printf provides. But one important thing is missing: format string localization.
Some examples are shown in GNOME #548950 for Ekiga trunk.
For example, to print how many users are found online, with printf and gettext we get (plural form is omitted here for simplicity):
printf (_("%d users found\n"), nUsers);
But with iostream we get:
std::cout << nUsers << " " << _("users found") << std::endl;
In printf case, translators are free to reorder words according to different grammars. For example, in case of Thai, it can be translated like:
msgid "%d users found\n" msgstr "พบผู้ใช้ %d คน\n"
(Literally, the Thai msgstr reads "found users %d persons".)
But this is impossible for iostream case. One must end up with very weird language usage like:
msgid "users found" msgstr "ผู้ใช้ถูกพบ"
(Thai msgstr here literally reads "users are found".)
And "3 ผู้ใช้ถูกพบ" sounds weird and unnatural to Thai readers. That is, with iostream, word orders in messages are tied to English.
I don't know how to solve this with iostream. It seems beyond what C++ syntax can achieve.
When combined with another case I found when working with POSIX file descriptor, for which fstream constructor has been dropped from C++ standard library, using iostream is simply a wrong decision in the first place. And the solution is to migrate the file manipulating codes to plain stdio C library.
Lesson learned: Don't use C++ iostream unless you really have limited use cases.