General Points of Internationalization Programming
Server Side Programming

The international server side programming (most of them, web programming) needs some different attentions than the client programing because you have to care about '2' platforms, sever one (server OS, web server application, .etc.) and clinet one (client OS, web browser, .etc).
The important point is the server needs process neutral, and the clinets need data localized.
  1. Awareness Of User Locales

    Messages, labels, date, currency, and any other culture related information should be shown in accordance to user's language (locale), not server one.
    User locales come to the server in HTTP requests from each browser, so you have to apply them to the server process. You need remember that the normal programming apply the running platform (server OS) locale to the application.
    The following are sample copdes of server process in each programming case.

  2. UTF-8 Encoding

    For writting Web UI (HTML), to use UTF-8 is recommended.
    Most of web browsers support UTF-8, and the all languages can be output in single encoding.
    The following are sample copdes of server process in each programming case.

  3. Neutral Format For Data Storing

    Date, currency, and other format data need 'some format' when it's stored in strages (e.g. databases), and if you use a 'culture specific' format for it, it means that the data depends on one specific culture. (e.g. If you write codes of storing date values in MySQL supposing that date columns are always Japanese format, your application will not run English setting MySQL.)
    For data stroring, to use ISO standard format is recommended which can be dealed with regardless of language settings.
    The following are sample copdes of server process in each programming case.

  4. UTC And Local Time

    The current time given by programming language in the server is based on the server's time zone.
    If you use this time directly, it cannot be handled correctly by the user who uses a different time zone from the server.
    (For example, the time stamp of the data updated at 9 AM on the server in Japan, should be around 8 PM on the previous day in America, because 9 AM in America is around 10 PM in Japan.)

    To solve this problem, user UTC (Universal Time, Coordinated) on the server and convert them to user local times based on each time zone.

    The following is a sample code of getting the current time as UTC and converting them to local times.

Go to Internationalization Programming Top


Copyright (C) 2012 Kokusaika JP, Inc.
All rights reserved. No reproduction or republication without written permission.