LINUX TIPS AND TRICKS --- August 04, 2000

Published by ITworld.com, the IT problem-solving network 
http://www.itworld.com/newsletters 

*********************************************************************

Internationalization and Localization 
by Danny Kalev 

Internationalization (a common acronym for internationalization is I18N) 
in the Linux community is too often neglected. Despite the token 
attempts to change this situation, Linux remains confined to North 
American English 10-years after its inception. Mozilla's failure to 
become a viable competitor to Internet Explorer in non-English speaking 
countries can be directly attributed to its lacking internationalization 
support. StarOffice is no different in this regard, either. If there's 
something to learn from Microsoft, it's their commitment to steadfastly 
localizing their software. 

Internationalized software must enable easy porting to other locales. A 
locale defines language and specific cultural conventions. The process 
of adjusting internationalized software to a particular locale is called 
localization (a common acronym for this term is L10N). You can think of 
software internationalization as a prerequisite for localization. 
Localization consists of more than just translating the user interface. 
Consider North America and Britain, for instance. Seemingly, they use 
the same language; however, not only do these locales differ in spelling 
(program vs. programme, realize vs. realise, color vs. colour, etc....), 
they also differ in certain cultural conventions such date formatting -- 
the monetary system and measurement units. Other locales exhibit 
additional cultural differences. In Germany and other European 
countries, the decimal fraction sign is represented as a comma, e.g., 
10,5. In North America, the radix is called "decimal point", and as the 
name suggests, it's represented as follows:  10.5. Double quotes in 
French appear as <<quoted text>>. 

Locales use different character codesets (7-bit ASCII, EBCDIC, Unicode) 
and fonts (Latin, Hebrew, Cyrillic). Although a complete tutorial on 
software internationalization is beyond the scope of this newsletter, 
there are a few basic guidelines to follow in order to ensure easy 
software localization: 

    * Avoid any hard code literal text in your code. Instead, use string 
      tables or environment variables. 

    * Use wide characters instead of narrow characters. C and C++       
      support the wchar_t datatype. C++ also provides the wstring class. 
      Use these types instead of char and string. 

    * Compose decimal numbers and dates from dynamic substrings that    
      contain a locale-specific representation of a fraction sign,      
      currency symbol, and date format separators. 

    * Don't assume anything about text directionality. Semitic languages 
      such as Arabic and Hebrew are written right-to-left, as opposed to 
      European languages. Consequently, menus, frames and pages are     
      aligned differently in such languages. Other languages are written 
      top-down. 

    * Be ready to deal with several calendars such as the Muslim,       
      Chinese and Hebrew calendars in addition to the Gregorian       
      calendar. 

    * Avoid any assumption about religious matters and holidays. For    
      example, in non-Christian countries, December 25 is usually an    
      ordinary business day and so is Sunday. An internationalized      
      banking system should be ready to process transactions from       
      foreign branches on Sunday, for example. 

Resources 

Internationalize your software, Part 1 
Learn how to develop software for the global marketplace. 
http://www.javaworld.com/jw-12-1998/jw-12-internationalize.html 

Internationalize your software, Part 2 
Learn how to develop software for the global marketplace 
http://www.javaworld.com/javaworld/jw-01-1999/f_jw-01-internationalize.html 

Internationalize your software, Part 3 
Learn how to develop software for the global marketplace. 
http://www.javaworld.com/javaworld/jw-02-1999/jw-02-internationalize.html 

************************************************************************

About the author 
---------------- 
Danny Kalev is a system analyst and software engineer with more 
than 10 years of experience, specializing in C++ and 
object-oriented analysis and design on various platforms including 
VMS, DOS, Windows, Unix, and Linux. His technical interests involve 
code optimization, networking, and distributed computing. He is 
also a member of the ANSI C++ standardization committee and the 
author of ANSI/ISO C++ Professional Programmer's Handbook (Que, 
1999). Contact him at linuxnl@excite.com. 
  
*********************************************************************

CUSTOMER SERVICE 

You can subscribe or unsubscribe to any of your e-mail newsletters by 
updating your form at: 
http://www.itworld.com/cgi-bin/w3-msql/newsletters/subcontent12.html? 

For subscription changes that cannot be handled via the web, please send 
an email to our customer service dept: support@itworld.com 

********************************************************************* 

CONTACTS 

* For editorial comments, write Andrew Santosusso, Associate Editor, 
Newsletters at: andrew_santosusso@itworld.com 
* For advertising information, write Dan Chupka, Account Executive at: 
dan_chupka@itworld.com 
* For recruitment advertising information, write Jamie Swartz, Eastern 
Regional Sales Manager at: jamie_swartz@itworld.com or Paul Duthie, 
Western Regional Sales Manager at: paul_duthie@itworld.com 
* For all other inquiries, write Jodie Naze, Product Manager, 
Newsletters at: jodie_naze@itworld.com 

********************************************************************* 

Copyright 2000 ITworld.com, Inc., All Rights Reserved. 

http://www.itworld.com 
