Portlet Factory, Version 6.1.2


 

Importing localized pages into the web application

You can import pages according to the locale of a user by using a Localized Resource builder call in conjunction with the Localization inputs in the Imported Page builder call. The URL to the pages consists of the Import Page builder call's Localized Base URL + Locale Key in the Localized Resource builder call + the Page to Import value in the Imported Page builder call.

You can use this construction to import localized pages based on a directory name or part or all of a file name.

To import pages based on the user's locale into the web application:

  1. Create the directory structure and the localized 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 Locale Key in the Localized Resource builder call. The imported page inserts the value of the Locale Key between the Localized Base URL and the Page to Import values to build the URL to the page to import.

    Pages differentiated by locale-specific directory

    /pages/spanish/index.htm

    /pages/russian/index.htm

    /pages/japanese/index.htm

    Pages differentiated by locale-specific file name

    /pages/russian_imported.htm

    /pages/japanese_imported.htm

    /pages/spanish_imported.htm

    Note: The differentiator in the path names is the locale key.

  2. Add Localized Resource builder call and specify the default value for the Locale Key input.

  3. Profile-Enable this input (click the button) and create a profile set (or use the default).

  4. Create a profile for each locale.

  5. Specify a value for the Locale Key entry. This locale key 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, you can create a profile set called "Language" and create three profiles named "Spanish", "Russian", and "Japanese", with a value for the LocaleKey entry being "spanish", "russian", and "japanese", respectively.

  6. Add an Import Page builder call for each page of which you want to import a localized version. Following inputs to the Imported Page builder.

    Localize Page

    Enable this checkbox.

    Localize URL Base

    Enter the path from the servable content root directory down to the portion of the URL defined by the Locale Key. For example, "pages/"

    Page to Import

    Enter the remaining portion of the URL to the file. For example, "_imported.htm"
    As a result of these input settings, the URL to the imported page will be: page/LocaleKeyValue _imported.htm, where LocaleKeyValue is defined by the profile determined by the browser's locale setting.

Parent topic: About localizing content


Library | Support |