An Efficient Approach for Internationalizing a
Intended Audience: Software Engineers, Managers, Systems Analysts, Testers, Web Designers
Session Level: Beginner, Intermediate
In this paper, we want to share an efficient approach that we had taken to internationalize our web-based application with database backend. Traditionally, to internationalize a database application, a table that contains locale-specific data is split into two tables- parent and child. The locale-neutral data is kept in the parent table and the locale-specific data is moved to the child table. In applications where all of the locale- specific data are UI elements, this approach is not necessary. In these applications, user-created data is locale-neutral. However, it can be in any languages.
Unlike the traditional approach, ours does not require making any modifications to the existing table structures. Instead of storing locale-specific data in the database, we store them in the properties files of the supported locale bundles. Only the keys, which are locale-neutral, are stored in the database. The data access layer is re-factored to be locale-sensitive. That is, a dynamic translation lookup is implemented for values of the keys that are retrieved from the database based on the current locale.
Our approach is more efficient and requires less effort in code re-factoring than the traditional approach. No join is needed for retrieving locale-specific data. The dynamic translation lookup is done in memory. Only the data access layer code is re-factored. Furthermore, it is easier to upgrade the existing customers since the schema is not modified.