180 likes | 208 Views
Internationalization: Engineering Software for Localization. Andy Shawaluk. What are they?. Internationalization (I18N) Common aspects Data Formatting Numbers Currency Dates Times Character Sets Text Orientation Framework. What are they?. Localization (L10N) Specific aspects
E N D
Internationalization:Engineering Software for Localization Andy Shawaluk
What are they? • Internationalization (I18N) • Common aspects • Data Formatting • Numbers • Currency • Dates • Times • Character Sets • Text Orientation • Framework
What are they? • Localization (L10N) • Specific aspects • Behavior • Input methods • Extra data fields • Translation • Cultural issues • Done for each individual region
Advantages • I18N • Makes L10N much easier • Relatively easy • L10N • Larger audience • Increased productivity • Selling point over competitors • Profit
When to start? • As early as possible • Before implementation • Worst case: After release • “Easy way out” • Fork for each localized version • Pros • Each version has its own team • Each team can handle issues independently • Less work for you • Cons • Multiple source trees • Version control nightmare • Costs you more money
Internationalization • Multiple character set support • Unicode • System locale support • Date/Time and Number/Currency formats • Separate user interface from logic • Text strings • Dialog boxes • Images
Example 1 – The Worst Case // en/program.cpp ... MessageBox(hWnd, "Press OK to continue, CANCEL to abort", "Application", MB_OK | MB_CANCEL); ... • Each version in its own tree • Far more maintenance required // jp/program.cpp ... MessageBox(hWnd, "続くために「OK」をクリックして、中断するために""「CANCEL」をクリックして下さい", "アプリ", MB_OK | MB_CANCEL); ...
Example 2 – A Slight Improvement // program.cpp ... #ifdef LANG_EN MessageBox(hWnd, "Press OK to continue, CANCEL to abort","Application", MB_OK | MB_CANCEL); #endif #ifdef LANG_JP MessageBox(hWnd, "続くために「OK」をクリックして、中断するために""「CANCEL」をクリックして下さい", "アプリ", MB_OK | MB_CANCEL); #endif ... • All versions in same source tree • Still horrible for maintenance
Example 3 – Making progress // lang_en.h wchar_t OKCancel[] = "Press OK to continue, CANCEL to abort"; wchar_t AppName[] = "Application"; • Each localization in its own resource • Trivial to add more // lang_jp.h wchar_t OKCancel[] = "続くために「OK」をクリックして、“ "中断するために「CANCEL」をクリックして下さい"; wchar_t AppName[] = "アプリ"; // program.cpp #include "lang.h" ... MessageBox(hWnd, OKCancel, AppName, MB_OK | MB_CANCEL); ... // lang.h #ifdef LANG_EN #include "lang_en.h“ #endif #ifdef LANG_JP #include "lang_jp.h“ #endif
Resources • Contain all UI-related data • Text strings • Dialog boxes • Menus • Graphics • Separate resource set for each localization • Access to source code not required
Resources • Issues • Usually environment-specific • Can only contain data, not code • Must be selected at compile time • Solutions • Use cross-platform toolkits • Trolltech QT • wxWidgets • XLIFF – XML Localization Interchange File Format • Region-specific routines • Load modules at runtime (DLLs)
DLLs and Shared Objects • Allow selecting localization at runtime • Choose during installation • Select from configuration • Switch on the fly • Embed code for specific regions • In DLL, not in main program • Support new regions without rebuilding the main program
Which to use? • Resources selected at compile time • Pros • Easy to design • Easy to implement • Cons • Longer build times • Region-specific behavior in main source tree • Multiple installation packages • Multiple installation media
Which to use? • Modules loaded at runtime • Pros • More flexible • Single package • Smaller than equivalent with resources • Support multiple regions with a single installation • Cons • Harder to implement • Minor performance impact
Tools • Tools • Alchemy Catalyst • RC-WinTrans • PASSOLO • Common Features • Resource editing • VC++/.NET resources, EXEs, DLLs • XLIFF support • Custom formats • C++, VB, Java
Conclusion • I18N and L10N are essential to making a successful product • Easy, if planned properly • Many different approaches • Numerous tools to choose from
References • Wikipedia, the Free Encyclopedia. Retrieved March 31, 2005, from http://en.wikipedia.org/wiki/Internationalization_and_localization • Kaneko, Atsushi (1999). Software localization on Windows. Computing Japan, May 1999, Vol. 6 Issue 5, p17-8 • Unicode Technical Introduction. Retrieved April 3, 2005, from http://www.unicode.org/standard/principles.html • Dohler, Per N. (1997). Facets of Software Localization – A Translator’s View. http://accurapid.com/journal/softloc.htm • Trolltech QT. Retrieved March 31, 2005, from http://www.trolltech.com/ • wxWidgets. Retrieved March 31, 2005, from http://www.wxwidgets.org/ • Alchemy Catalyst. Retrieved March 31, 2005, from http://www.alchemysoftware.ie/products/catalyst.html • RC-WinTrans. Retrieved April 3, 2005, from http://www.wernerschaudin.de/51.0.html • PASSOLO. Retrieved April 3, 2005, from http://www.passolo.com/en/home.htm • Tribute, Andrew (1995). Hitext of Belgium: Localizing software for multinational environs. Seybold Report on Publishing Systems, 1/30/95, Vol. 24 Issue 10, p18-23