This topic is now archived and is closed to further replies.


i18n in C++

Recommended Posts

atcdevil    145
Does anyone know of any simple tutorials on internationalization as it applies to programming in C++. I''ve looked at references on GNU gettext, Unicode, and wchar_t. Unfortunately I''ve been totally unsuccesful in even getting a program to get a simple Hello World program to switch between displaying Hello World and Hola Mundo. Eventually I would like to eventually be able to support any language I could find a translator for. Thanks, Andrew

Share this post

Link to post
Share on other sites
Kylotan    10008
You'll need something like the C++ locales for string and numeric handling: (a book you can buy)

As for translation, you pretty much have to maintain individual tables of strings, one for each language. Most projects I've seen just index into an array of strings (one array per language) or call a function with a constant referring to the message and some sort of internal state remembering what language you're using. Gettext seems massively complex for what it does, and while I'm not claiming that every feature there is not useful, I'm not entirely convinced it's all important.

[ MSVC Fixes | STL Docs | SDL | Game AI | Sockets | C++ Faq Lite | Boost
Asking Questions | Organising code files | My stuff | Tiny XML | STLPort]

[edited by - Kylotan on January 24, 2004 6:31:14 PM]

[edited by - Kylotan on January 24, 2004 6:35:19 PM]

Share this post

Link to post
Share on other sites