Localizing content
In this topic ...
Import Localized Pages into my Application
Related Topics ...
We can localize pages in your Web application by using the Imported Page and Localized Resource Builders. The Imported Page Builder allows you to import a page into the Web application based on a profile associated with the request.
The Localized Resource Builder adds a resource bundle to the Web application based on the language and/or language_COUNTRY value of the request.
We can use the Imported Page Builder to add localized content to the Web application and use the Localized Resource Builder to localize the input values for Button labels, Text fields, etc.
How do I...
Import Localized Pages into my Application
We can import pages according to the locale of a user by using a Localized Resource Builder call in conjunction with the Imported Page Builder call.
The URL to the pages consists of the following items:
- Localized Base URL - From the Imported Page Builder
- Language or Language_COUNTRY identifier - From the Localized Resource Builder
- Page to Import value - From the Imported Page Builder the
The Factory automatically combines these three elements to access localized pages and content.
To import pages based on the user's locale into the Web application:
- Create the directory structure illustrated below. In this structure place localized versions of files that you want to import into a Web application. Keep in mind that the directory structure or file names should be differentiated by the possible values of the Language or Language_COUNTRY in the Localized Resource Builder call. The Imported Page Builder will insert the value of the Language or Language_COUNTRY between the Localized Base URL and the Page to Import values to build the URL to the page to import.
Pages differentiated by language-only directory:
/pages/sp/index.htm
/pages/ru/index.htm
/pages/ja/index.htm
Pages differentiated by language_COUNTRY directory:
/pages/ru_RU/imported.htm
/pages/ja_JA/imported.htm
/pages/sp_SP/imported.htm
Note: The differentiator (in Bold) in the path names is the Language or Language_COUNTRY key.
- Add Localized Resource Builder call and specify the default value for the Language or Language_COUNTRY key input.
- Profile-Enable this input (click the button) and create a profile set (or use the default).
- Create a profile for each Language or Language_COUNTRY.
- Specify a value for the Language or Language_COUNTRY entry.
This locale will be used to determine the path to an imported page.
For example, for the directory and file names used in the example in Step 1, we can create a profile set called "Language" and create three profiles named "Spanish", "Russian", and "Japanese", with a value for the Language entry being "sp", "ru", and "ja", respectively.
For more information about creating profile sets and profiles, see the "Profiling Overview."
- Add an Imported Page Builder call for each page of which you want to import a localized version.
The Imported Page Builder will automatically choose the page in the directory for the selected profile, based on the Localized Resource Builder