45 Managing a Multilanguage Portal

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

This chapter includes the following topics:

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 Portal Builder Administration or a custom role that grants the following permission:

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

See also, Section 1.8, "Understanding Administrative Operations, Roles, and Tools."

45.1 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, such as announcements, documents, 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 by users is generally displayed in the language used by the contributing user.

45.1.1 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 45-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 45-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 45-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.

45.2 Modifying and Translating Strings at the Application Level

Whether you are modifying or translating UI text application-wide, UI text for a particular portal, or user-entered metadata in a portal, the process is basically the same: you just modify different files.

To modify seeded UI text application-wide, you edit the override bundle, SpacesSeedDataOverrideBundle.xlf.

To modify or translate strings at the application level:

  1. Start WLST. For information, see Section 1.13.3.1, "Running Oracle WebLogic Scripting Tool (WLST) Commands."

  2. Use the WLST command exportMetadata to export the override bundle:

    exportMetadata(application='webcenter',server='WC_Spaces',toLocation='/tmp/metadata',docs='/xliffBundles/SpacesSeedDataOverrideBundle.xlf')
    

    This example exports SpacesSeedDataOverrideBundle.xlf for WebCenter Portal (webcenter) on the WC_Spaces managed server to the /tmp/metadata folder. Always use webcenter as the application name.

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

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

    For more information, see Section 1.13.3.1, "Running Oracle WebLogic Scripting Tool (WLST) Commands." See also "exportMetadata" in Oracle Fusion Middleware WebLogic Scripting Tool Command Reference.

  3. Navigate to the folder into which you exported /xliffBundles/SpacesSeedDataOverrideBundle.xlf,

    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 /xliffBundles/SpacesSeedDataOverrideBundle.xlf in a text editor.

    If you want to translate the file into another language, create a language-specific version of the file. For example, to translate the application-wide UI text into Catalina, name the file SpacesSeedDataOverrideBundle_ca.xlf. For translation, you will generally need to send this file to the translation team, which will update the file and send it back to you.

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

    The ID attribute in SpacesSeedDataOverrideBundle.xlf corresponds to the resource key of the UI element displayed in Composer in WebCenter Portal.

    For example, here is the <trans-unit> block for the Announcements title in application-wide SpacesSeedDataOverrideBundle.xlf file.

    <trans-unit id="ANNOUNCEMENTS.TITLE">
    <source>Announcements</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 file back into WebCenter Portal. For example:

    importMetadata(application='webcenter',server='WC_Spaces',fromLocation='/tmp/metadata',docs='/xliffBundles/SpacesSeedDataOverrideBundle.xlf')
    

    This example imports the string file from the /tmp/metadata folder to the webcenter application on the WC_Spaces 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.

    For details, see Section 1.13.3.1, "Running Oracle WebLogic Scripting Tool (WLST) Commands." See also "importMetadata" in Oracle Fusion Middleware WebLogic Scripting Tool Command Reference.

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

45.3 Translating Strings for a Portal

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 Section 1.13.3.1, "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_Spaces',toLocation='/tmp/metadata')
      

      This example exports all string files for WebCenter Portal (webcenter) on the WC_Spaces 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_Spaces',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 Section 1.13.3.1, "Running Oracle WebLogic Scripting Tool (WLST) Commands." See also "exportMetadata" in Oracle Fusion Middleware WebLogic Scripting Tool Command Reference.

  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 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_Spaces',fromLocation='/tmp/metadata')
      

      This example imports all string files from the /tmp/metadata folder to the webcenter application on the WC_Spaces 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_Spaces',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 Section 1.13.3.1, "Running Oracle WebLogic Scripting Tool (WLST) Commands." See also "importMetadata" in Oracle Fusion Middleware WebLogic Scripting Tool Command Reference.

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

45.4 Modifying and Adding Translations for a Specific String of a Portal

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 the Announcements task flow in a specific instance on a page in a portal.

To add translation for a specific instance of a string in a portal:

  1. Use the WLST command exportMetadata to export the string file. For example:

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

    This example exports a portal-specific resource bundle for WebCenter Portal (webcenter) deployed on WC_Spaces to the /tmp/metadata folder. Replace PORTAL_GUID with the GUID of the portal for which you are modifying strings. If necessary, change the server name to match your WebCenter Portal installation. You must change the toLocation path to the location into which you want to export the string files.

    For more information, see Section 1.13.3.1, "Running Oracle WebLogic Scripting Tool (WLST) Commands." See also "exportMetadata" in Oracle Fusion Middleware WebLogic Scripting Tool Command Reference.

  2. Create a language/locale-specific version of the string file you want to translate.

    Copy /oracle/webcenter/translations/scopedMD/PORTAL_ GUID/scope-resource-bundle.xlf, replacing PORTAL_GUID with the GUID of the portal. Then save the file with the required name. For example, to translate the portal-wide UI text into Catalina, name the file scope-resource-bundle_ca.xlf.

  3. Send the files to be translated to your translation team to edit. Translation will involve the following steps:

    1. Open the string file in JDeveloper or a text editor.

      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.

    2. Find the <trans-unit> blocks you want to modify.

      Here is an example of a <trans-unit> block from a portal-specific scope-resource-bundle.xlf file. The SCOPEGUID shows the internal ID of the selected portal, and the OBJECTGUID shows the ID of the Announcements task flow.

      <trans-unit id="SCOPEGUID:s7735bad2_2e7d_4d73_a360_423a64bfc111:SERVICEID:oracle.webcenter.peopleconn:OBJECTTYPE:profile:OBJECTGUID:ANNOUNCEMENTS.TITLE">
      <source>Announcements</source>
      </trans-unit>
      

      The OBJECTGUID attribute (in scope-resource-bundle.xlf) corresponds to the resource key displayed for the required string in Composer. For information about resource key, see the "Finding the Resource Key for a String" section in Oracle Fusion Middleware Building Portals with Oracle WebCenter Portal.

    3. Translate the <source> text in the specified <trans-unit> block as required.

    4. Save the file.

  4. Use the WLST command importMetadata to import the updated string file back into WebCenter Portal. For example:

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

    This example imports the string file of the specified portal from the /tmp/metadata folder to WebCenter Portal (webcenter) deployed on the WC_Spaces managed server. Replace PORTAL_GUID with the GUID of the portal for which you are modifying strings. If necessary, change the managed server name to match your WebCenter Portal installation. Change the fromLocation path to the location from which you want to import the string files.

    For details, see Section 1.13.3.1, "Running Oracle WebLogic Scripting Tool (WLST) Commands." See also "importMetadata" in Oracle Fusion Middleware WebLogic Scripting Tool Command Reference.

  5. Update the resource key of the desired UI element in WebCenter Portal. For example, if you want to translate the title of a specific Announcements task flow in a portal, perform the following steps:

    1. Log on to WebCenter Portal, go to the desired portal, and open the Component Properties dialog for the Announcements task flow whose title you want to translate. For information about accessing the Component Properties dialog, see the "Modifying Components" section in Oracle Fusion Middleware Building Portals with Oracle WebCenter Portal.

    2. On the Display Options tab, in the Text field, specify a new resource key in the following format:

      #{o_w_f_t_TranslationsRBBean['trans-unit id']}
      

      Where, trans-unit id refers to the ID of the Announcements task flow in the scope-resource-bundle.xlf file. For example, specify the following resource key:

      #{o_w_f_t_TranslationsRBBean['SCOPEGUID:s7735bad2_2e7d_4d73_a360_423a64bfc111:SERVICEID:oracle.webcenter.peopleconn:OBJECTTYPE:profile:OBJECTGUID:ANNOUNCEMENTS.TITLE']}
      
    3. Click OK (Figure 45-1).

    Figure 45-1 Component Properties Dialog of the Announcements Task Flow

    Description of Figure 45-1 follows
    Description of "Figure 45-1 Component Properties Dialog of the Announcements Task Flow"

  6. Restart the WC_Spaces managed server, and verify that your changes appear in WebCenter Portal.

45.5 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 the "Using Spaces Extension Samples" white paper on the Oracle WebCenter Portal White Papers and Technical Notes page on Oracle Technology Network.