Jump to content
  • Advertisement

Archived

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

atcdevil

i18n in C++

This topic is 5322 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
Advertisement
You'll need something like the C++ locales for string and numeric handling:

http://www.research.att.com/~bs/3rd_loc0.html
http://www.amazon.com/exec/obidos/tg/detail/-/0201183951/102-0574646-8345703?v=glance (a book you can buy)
http://www.tacc.utexas.edu/services/userguides/pgi/pgC++_lib/stdlibug/sta_9169.htm

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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!