35 Managing a Multilanguage Portal

Use the language support available in WebCenter Portal to manage translations at the application and portal level and for specific strings in a portal.

Note:

Beginning with 12c (12.2.1.3.0), Oracle WebCenter Portal has deprecated support for Jive features (announcements and discussions). If you are upgrading from a prior release, these features remain available in your existing installations that are being upgraded.

Permissions:

To perform the tasks in this chapter, you must be granted the following roles:

  • WebLogic Server: Admin or Monitor role granted through the Oracle WebLogic Server Administration Console.

  • WebCenter Portal: Administrator role granted through WebCenter Portal Administration or a custom role that grants the following permission:

    Basic Services: Edit Page Access, Structure, and Content permission.

See also Understanding Administrative Operations, Roles, and Tools.

About Languages in WebCenter Portal

If your portal must support different languages, you can configure it to display localized content based on the user's selected language and locale.

For example, if you know your page will be viewed by users who speak Italian, you can localize your page so that when Italian is selected (in browser, user preferences, portal, or application settings), text strings in the page appear in Italian.

Additionally, locale selection applies special formatting considerations that are applicable to the selected locale. For example, those considerations may include whether information is typically viewed from left to right or right to left, how numbers are depicted (such as monetary information), and so on.

There are three main types of information that are displayed in WebCenter Portal:

  • User interface (UI) elements, like field and button labels and seeded boilerplate text

  • User-entered metadata, including page names, the portal name, and the portal description

  • Content added by users, including published text and images, documents, announcements, and discussion forum content

Each type of information is handled differently when it comes to modification:

  • UI elements:

    Note:

    UI elements include out-of-the-box translations for 28 languages and 100 different locales. You need to change this text only if the default UI text is not suited to your company's needs or if your company must support additional languages.

    • To change the text for your entire WebCenter Portal application (rather than just one portal), edit the strings in the override bundle, SpacesSeedDataOverrideBundle.xlf.

    • To change the UI text for a particular portal, edit the strings in the portal-specific resource bundle, scope-resource-bundle.xlf.

  • User-entered metadata (such as page names, the portal name, and the portal description) is saved as strings in the resource bundle for the portal. Each portal has its own resource bundle. To change the user-entered metadata, edit the strings in the portal-specific resource bundle.

    Note:

    Generally, the user-entered metadata you want to display in multiple languages is company-wide content or customer-facing content that likely has translations available in some form. More specific content (for example, content specific to a particular department or region) is probably necessary in only one language, and therefore does not require translation.

  • Content added in content publishing components can be translated, and your system administrator can display translated WebCenter Content items using Content Presenter. Content added in announcements and discussion forums is generally displayed in the language used by the contributing user.

    For information about providing localized content, see Translating Portals into Other Languages in Building Portals with Oracle WebCenter Portal.

Languages Supported Out-of-the-Box by WebCenter Portal

WebCenter Portal provides runtime translations for 28 languages and 100 different locales.

The list in Table 35-1 includes all the languages available to WebCenter Portal out-of-the-box. Users can also select locales associated with particular languages. For example, a user can change the language to Arabic and, within that language group, select from 20 different locales, including Algeria, Bahrain, Djibouti, and so on.

Table 35-1 Languages Available for WebCenter Portal

A to Ge Gr to Ro Ru to T

Arabic

Greek

Russian

Brazilian Portuguese

Hebrew

Simplified Chinese

Czech

Hungarian

Slovak

Danish

Italian

Spanish

Dutch

Japanese

Swedish

English

Korean

Thai

Finnish

Norwegian

Traditional Chinese

French

Polish

Turkish

French-Canada

Portuguese

German

Romanian

Note:

Administrative tier that offers services to WebCenter Portal, including Oracle Enterprise Manager, provides a subset of the languages available to WebCenter Portal. These include:

  • English

  • Brazilian Portuguese

  • Simplified Chinese

  • Traditional Chinese

  • French

  • German

  • Italian

  • Japanese

  • Korean

  • Spanish

Discussions use WebCenter Portal's discussions server. Out-of-the-box, the discussions server application supports English and Spanish. It does not support other languages listed in Table 35-1. However, the application is open to your own translation files. For more information, refer to the Jive documentation site. This information is explicit to the discussion server application user interface.

Note:

The Pagelet Producer Administration UI supports 9 administration languages and Dutch.

Translating Portal Name, Title, and Description of Portals and Pages

To translate strings of a particular portal, you edit the portal-specific resource bundle, scope-resource-bundle.xlf. The strings that can be translated are portal display name, description, and page titles.

To translate strings for a portal:

  1. Start WLST. For information, see Running Oracle WebLogic Scripting Tool (WLST) Commands.
  2. Use the WLST command exportMetadata to export the string files:
    • To export all string files, do not include the docs attribute. For example:

      exportMetadata(application='webcenter',server='WC_Portal',toLocation='/tmp/metadata')
      

      This example exports all string files for WebCenter Portal (webcenter) on the WC_Portal managed server to the /tmp/metadata folder. Always use webcenter as the application name.

      Change the value for server to match the name of the managed server that hosts your installation of WebCenter Portal.

      Change the toLocation path to the location into which you want to export the string files.

    • To export only specific string files, include the docs attribute. For example:

      exportMetadata(application='webcenter',server='WC_Portal',toLocation='/tmp/metadata',docs='/oracle/webcenter/translations/scopedMD/PORTAL_GUID/scope-resource-bundle.xlf')
      

      This example produces similar results to the first example, but exports only a portal-specific resource bundle. Replace PORTAL_GUID with the GUID of the portal for which you are modifying strings.

      Note:

      To export more than one file, separate file locations with commas.

    For more information, see Running Oracle WebLogic Scripting Tool (WLST) Commands. See also exportMetadata in WLST Command Reference for Infrastructure Components.

  3. Navigate to the folder into which you exported the string files.

    Caution:

    Make sure to correctly encode your edited file or you receive an error when you try to import the translations. Oracle recommends using Oracle JDeveloper to edit the file because it automatically encodes special characters correctly.

  4. If you want to modify the strings in the base language, open /oracle/webcenter/translations/scopedMD/PORTAL_ GUID/scope-resource-bundle.xlf, replacing PORTAL_GUID with the GUID of the portal for which you are modifying strings.

    If you want to translate the file into another language, create a language-specific version of the file, and open it in a text editor. For example, to translate the portal UI text into Catalina, name the file scope-resource-bundle_ca.xlf.

  5. Find the <trans-unit> blocks you want to translate.

    The OBJECTGUID attribute in scope-resource-bundle.xlf corresponds to the resource key of the UI element displayed in Portal Composer in WebCenter Portal.

    For example, following is the <trans-unit> block for the display name of a page in a portal-specific scope-resource-bundle.xlf file:

    <trans-unit id="SCOPEGUID:s2f80d470_6cc4_479a_884c_9feb574b35d6:Pagedf7eed1_13eea02290b__7ff6:SERVICEID:oracle.webcenter.page:OBJECTTYPE:page:OBJECTGUID::PAGES.:Page2.jspx.DISPLAY_NAME">
    <source>Personal25</source>
    </trans-unit>
    
  6. Edit the text in the <source> block to fit your business needs, then save the file.
  7. Use the WLST command importMetadata to import the updated string files back into WebCenter Portal. For example:
    • To import all string files, do not include the docs attribute. For example:

      importMetadata(application='webcenter',server='WC_Portal',fromLocation='/tmp/metadata')
      

      This example imports all string files from the /tmp/metadata folder to the webcenter application on the WC_Portal managed server. Change the fromLocation path to the location from which you want to import the string files. Always use "webcenter" as the application name. Change server name to match the server that hosts your installation of WebCenter Portal.

    • To import only specific string files, include the docs attribute:

      importMetadata(application='webcenter',server='WC_Portal',fromLocation='/tmp/metadata',docs='/oracle/webcenter/translations/scopedMD/PORTAL_GUID/scope-resource-bundle.xlf')
      

      This example produces similar results to the first example, but imports only a portal-specific resource bundle. Replace PORTAL_GUID with the GUID of the portal for which you are modifying strings. It is recommended that you use the docs attribute.

      Note:

      To import more than one file, separate file locations with commas.

    For details, see Running Oracle WebLogic Scripting Tool (WLST) Commands. See also importMetadata in WLST Command Reference for Infrastructure Components.

  8. Restart the WC_Portal managed server, and confirm that the changes you made appear in the UI.

Translating Strings for Page Content

To suit your business needs, you may want to translate only a specific string of a portal. For example, you may want to translate only the title of a task flow on your portal page.

To translate the task flow header of a task flow added to your portal page:

  1. Get the internal ID of the portal.

    1. In Oracle WebCenter Portal, navigate to the portal in which you want to implement translations.

    2. From the Pages and Portals Actions menu, select Manage, then All Settings.

    3. On the General page, from the Internal ID field, note down the internal ID of your portal. For example, sc8f0a967_de9a_4f8e_aeaa_f10e5a100c94.

  2. Note down the Object GUID of the task flow that you want to translate:

    1. Open the portal page, which contains the task flow, in the edit mode.

    2. Select the task flow, then from the Actions menu, select Display Options.

    3. From the Text field, note down the value.

      For example, for the Message Board task flow the value might look like this:

      #{uib_o_w_s_r_DefaultGroupSpaceCatalog['WALL_MAINVIEW.TITLE']}

      The EL expression shows the Object GUID of the task flow. So, for Message Board the Object GUID is WALL_MAINVIEW.TITLE.

  3. Export the scope-resource-bundle.xlf file to a stage location by using the exportMetadata WLST command.

    exportMetadata(application='webcenter',server='WC_Portal',toLocation='Stage-Folder',docs='/oracle/webcenter/translations/scopedMD/Portal-Internal-ID/**')

    For example:

    exportMetadata(application='webcenter',server='WC_Portal',toLocation='/home/oracle/testcases/translations/metadata',docs='/oracle/webcenter/translations/scopedMD/sc8f0a967_de9a_4f8e_aeaa_f10e5a100c94/**')

    Note:

    It is important that you export the translation files every time you want to make changes.

  4. Back up the original scope-resource-bundle.xlf file. For example:

    cd /home/oracle/testcases/translations/metadata/oracle/webcenter/translations/scopedMD/sc8f0a967_de9a_4f8e_aeaa_f10e5a100c94
    cp scope-resource-bundle.xlf scope-resource-bundle.xlf_ori
  5. Edit the scope-resource-bundle.xlf file and add a trans-unit block for the task flow you want to customize in the following format:

    <trans-unit id="SCOPEGUID:<Portal-Internal-ID>:OBJECTGUID:object_GUID_taskflow">
    <source>task_flow_title</source>
    </trans-unit>

    For example, you can add the following trans-unit block for the Message Board task flow:

    <trans-unit id="SCOPEGUID:sc8f0a967_de9a_4f8e_aeaa_f10e5a100c94:OBJECTGUID:WALL_MAINVIEW.TITLE">
    <source>Message Board</source>
    </trans-unit>
  6. Create a language or locale-specific version of the scope-resource-bundle.xlf file for the desired language.

    For example, for Arabic:

    cp scope-resource-bundle.xlf scope-resource-bundle_ar.xlf

  7. Edit the language or locale-specific version of the scope-resource-bundle.xlf file (for example, scope-resource-bundle_ar.xlf file) and make the appropriate translations.

    For example, for the Message Board task flow ensure you have the following entry and translate it to the corresponding language:
    <trans-unit id="SCOPEGUID:<Portal-Internal-ID>:OBJECTGUID:WALL_MAINVIEW.TITLE">
    <source>translated text for message board</source>
    </trans-unit>
  8. Import the modified files using the importMetadata WLST command.

    importMetadata(application='webcenter',server='WC_Portal',fromLocation='Stage-Folder',docs='/oracle/webcenter/translations/scopedMD/Portal-Internal-ID/scope-resource-bundle_lanugage_specific.xlf')
    importMetadata(application='webcenter',server='WC_Portal',fromLocation='Stage-Folder',docs='/oracle/webcenter/translations/scopedMD/Portal-Internal-ID/scope-resource-bundle.xlf')

    For example:

    importMetadata(application='webcenter',server='WC_Portal',fromLocation='/home/oracle/testcases/translations/metadata',docs='/oracle/webcenter/translations/scopedMD/sc8f0a967_de9a_4f8e_aeaa_f10e5a100c94/scope-resource-bundle_ar.xlf')
    importMetadata(application='webcenter',server='WC_Portal',fromLocation='/home/oracle/testcases/translations/metadata',docs='/oracle/webcenter/translations/scopedMD/sc8f0a967_de9a_4f8e_aeaa_f10e5a100c94/scope-resource-bundle.xlf')

  9. Update the task flow with the new value for the Text field:

    1. In WebCenter Portal, open the portal page, which contains the task flow, in the edit mode.

    2. Select the task flow, then from the Actions menu, select Display Options.

    3. In the Display Options dialog, update the value in the Text field.

      For example, for the Message Board task flow the value might look like this:

      #{uib_o_w_s_r_DefaultGroupSpaceCatalog['WALL_MAINVIEW.TITLE']}

      Replace this value with a value in following format:

      #{composerContext.inEditMode ? uib_o_w_s_r_DefaultGroupSpaceCatalog[‘OBJECTGUID'] : o_w_f_t_TranslationsRBBean['task-flow trans-unit id']}

      For example:

      #{composerContext.inEditMode ? uib_o_w_s_r_DefaultGroupSpaceCatalog[' WALL_MAINVIEW.TITLE '] : o_w_f_t_TranslationsRBBean['SCOPEGUID:sc8f0a967_de9a_4f8e_aeaa_f10e5a100c94:OBJECTGUID:WALL_MAINVIEW.TITLE']}

    4. Click OK.

  10. Save your portal page.

  11. View your portal and test the translation by switching language to Arabic and back to English.

    You should be able to see the task flow title translated to the corresponding language you translated.

    Note:

    For task flows such as the RSS task flow, if you want to have several task flows of the same type you can append a number to have a different translation for each task flow. For example:

    <trans-unit id="SCOPEGUID:sc8f0a967_de9a_4f8e_aeaa_f10e5a100c94:OBJECTGUID:RSS_VIEWER.TITLE_1">
    <source>Oracle - Critical Patch Updates</source>
    </trans-unit>
    <trans-unit id="SCOPEGUID:sc8f0a967_de9a_4f8e_aeaa_f10e5a100c94:OBJECTGUID:RSS_VIEWER.TITLE_2">
    <source>OTN - Headlines</source>
    </trans-unit>

Adding Support for a New Language to WebCenter Portal

You can add support for a new language that is not supported out-of-the-box in WebCenter Portal. To enable WebCenter Portal to support an additional language, you must translate portal strings into the new language within a resource bundle, update two language configuration files (supported-languages.xml and faces-config.xml), and then deploy your language updates to a custom shared library.

For information about adding support for a new language, see Using Spaces Extension Samples white paper on the Oracle WebCenter Portal White Papers and Technical Notes page on Oracle Technology Network.