Internationalization and Localization
Internationalization (i18n) is the process of designing an application so that
the outcoming product can be easily adapted to various languages and
cultures without programming.
Localization is the process of translating and formatting content and
configuring your product to the needs of users in a specific country or
culture.
Tammi has been designed to support internationalization based on Java locales,
resource bundles, formatters and character encodings.
Tammi finds automatically an appropriate localized template or resource
for a specific user if the naming conventions are followed.
Tammi provides convenient tools for template authors to format locale
dependent data.
Tammi configuration defines character encodings for templates,
resources, requests and responses.
The framework is flexible enough to serve e.g. with both typical Chinese
encodings GB2312 and Big5 (traditional) on demand.
How Tammi Derives Locale
The default locale and other locales supported by an application are configured
to LocaleFilter. The default locale is applied to requests without
a language in their accept-language header, which corresponds to any
of the supported locales. The default locale may also be forced for all requests
if the application does not support multiple locales.
The locale can also be specified explicitly with a request parameter
named lang or programmatically with the setLocale
method of the response before the response has been written.
NOTE: The Java resource bundle uses the server locale as the default locale when
the locale is unspecified or a locale specific resource is not found.
|