35 Managing a Multilanguage 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, Space, or application settings), text strings in the page appear in Italian.

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

This chapter includes the following sections:

For information on language configuration options available in WebCenter Spaces, see Oracle Fusion Middleware User's Guide for Oracle WebCenter.

35.1 What You Should Know About Languages in WebCenter Spaces

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

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

  • User-entered metadata, such as Space and page names

  • Content added by users, such as announcements, documents, and discussion forum content

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

  • UI elements include out-of-the-box translations for 27 languages and 100 different locales. If the default UI text is not suited to your company's needs or if your company must support additional languages, you can edit the string files containing this text.

  • User-entered metadata can be translated the same way that UI elements are translated, by editing the string files.

    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, though there is a way that you can display translated content using Content Presenter.

35.1.1 Languages Supported Out-of-the-Box by WebCenter Spaces

WebCenter Spaces provides run-time translations for 27 languages and 100 different locales.

Table 35-1 Languages Available for Oracle WebCenter Spaces

A to Fi Fr to No P to T

Arabic

French

Polish

Brazilian Portuguese

German

Portuguese

Chinese (Simplified)

Greek

Romanian

Chinese (Traditional)

Hebrew

Russian

Czech

Hungarian

Slovak

Danish

Italian

Spanish

Dutch

Japanese

Swedish

English

Korean

Thai

Finnish

Norwegian

Turkish


The list in Table 35-1 includes all the languages available to WebCenter Spaces 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.

Note:

The administrative tier that offers services to WebCenter Spaces, including such tools as Oracle Enterprise Manager, provides a subset of the languages available to WebCenter Spaces. These include:
  • English

  • Brazilian Portuguese

  • Chinese (Simplified)

  • Chinese (Traditional)

  • French

  • German

  • Italian

  • Japanese

  • Korean

  • Spanish

The Discussions service uses the Jive application. Out-of-the-box, the Jive application bundled with WebCenter supports English and Spanish. It does not support other languages listed in Table 35-1. However, Jive is open to your own translation files. For more information, see http://www.jivesoftware.com/builds/docs/latest/documentation/developer-guide.html#i18n. This information is explicit to the Jive application user interface.

35.2 Adding Support for a New Language

You can include additional languages in WebCenter Spaces by adding a <language> tag for the new language in the supported-languages.xml configuration file and providing string files for the new language.

For more information, refer to the whitepaper “Using WebCenter Spaces Extension Samples (11.1.1.4.0)” available from Oracle Technology Network (OTN) at http://www.oracle.com/technetwork/index.html.

35.3 Modifying or Translating Default Strings

The text displayed in the UI is stored as strings in the override bundle (xliffBundles/SpacesSeedDataOverrideBundle.xlf). If you want to change the default UI text or must support a language that is not supported out-of-the-box by Oracle WebCenter, you can customize the strings.

To modify or translate the default strings:

  1. If you are editing a particular string (rather than all of them), find the resource key for the string:

    1. Open the page or resource in Oracle Composer. For details, see “Editing a Page Template in Oracle Composer”, “Editing a Page in a Space” or “Editing a Task Flow.”

    2. Click the Edit icon (wrench) for the component that includes the string you want to edit.

    3. In the Component Properties dialog box, click the Display Options tab.

    4. The resource key is the last part of the text in the Text box.

      For example, Figure 35-1 shows the resource key for the Announcements component. If you want to edit the string “Announcements” make note of the resource key ANNOUNCEMENTS.TITLE.

      Figure 35-1 Display Options for Announcements Component - Resource Key

      Description of Figure 35-1 follows
      Description of "Figure 35-1 Display Options for Announcements Component - Resource Key"

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

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

    You can specify any folder in the toLocation; /tmp/metadata is used only as an example.

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

  3. Navigate to the directory to which you exported the override bundle, and into the following subdirectory: /xliffBundles. For example:

    cd /tmp/metadata/xliffBundles
    
  4. If you want to modify the default UI text, edit the file SpacesSeedDataOverrideBundle.xlf:

    1. Find the <trans-unit> block for the element you want to modify.

      The OBJECTGUID attribute corresponds to the resource key you made note of in Step 1. For example, here is the <trans-unit> block for the Announcements title.

      <trans-unit id="SCOPEGUID:s1a448c10_c9b8_429f_bf83_a481d5f9e4bc:SERVICEID:oracle.webcenter.peopleconn:OBJECTTYPE:profile:OBJECTGUID:ANNOUNCEMENTS_TITLE">
      <source>Announcements</source>
      </trans-unit>
      
    2. Modify the <source> text to fit your business needs.

    3. Save the .xlf file.

  5. If you want to support a language that is not supported out-of-the-box, create a language/locale-specific version of the SpacesSeedDataOverrideBundle.xlf file for each language you want to support:

    Caution:

    Make sure to correctly encode your file or you receive an error when you try to import the translations. You might want to use Oracle JDeveloper to edit the file because it automatically encodes special characters correctly.
    1. Copy the xlf file and save it as a language/locale-specific version. For example, SpacesSeedDataOverrideBundle_de.xlf for German.

    2. Use a text editor (we recommend Oracle JDeveloper) to edit the <source> text to the translated values.

    3. Save the .xlf file.

  6. Use the WLST command importMetadata to import the updated override bundle back into Oracle WebCenter Spaces. For example:

    importMetadata(application='webcenter',server='WC_Spaces',fromLocation='/tmp/metadata','/xliffBundles/*')
    

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

  7. Restart the WC_Spaces managed server.

35.4 Modifying or Translating Component Tags

Component tags are used in reusable WebCenter Spaces components such as the Login or Administration links and in custom components that include custom text (such as a title). The text for these components is stored as strings. Each Space has its own set of strings, stored in oracle/webcenter/translations/scopedMD/SPACE_GUID/scope-resource-bundle.xlf.

If you want to modify or translate the strings for a particular instance of a component on a page or page template, you can customize the strings.

Note:

The following procedure uses an example to demonstrate the steps. The example describes how to display a localized “Welcome User” message at the top of WebCenter Spaces by adding a Current User Profile component to the page, translating the “Welcome” string, and changing the properties for the component to refer to the translated strings.

Note:

If you wan to change the text for all instances of a WebCenter Spaces component, modify the strings in the override bundle, as described in Section 35.3, "Modifying or Translating Default Strings."

To modify or translate component tags:

  1. In Oracle WebCenter Spaces, add a reusable component to the page. For example, open the Template Development folder, and add the Current User Profile component.

  2. Get the Space's GUID by clicking the About menu and choosing About Group Space. For example, s0f5677ff_03d8_4a71_a6dd_fa584f80e5f2.

  3. Use the WLST command exportMetadata to export the strings. For example:

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

    You can specify any folder in the toLocation; /tmp/metadata is used only as an example.

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

  4. Navigate to the directory to which you exported the strings, and into the following subdirectory: /oracle/webcenter/translations/scopedMD/SPACE_GUID, where SPACE_GUID is the GUID of the Space for which you are translating content. For example:

    cd /tmp/metadata/oracle/webcenter/translations/scopedMD/s0f5677ff_03d8_4a71_a6dd_fa584f80e5f2/
    
  5. Edit the file scope-resource-bundle.xlf:

    1. Copy an existing <trans-unit> block and paste it below the block you copied or into another appropriate location within the <body> tag.

    2. Modify the id attribute and the <source> text. The id attribute must be unique, as this is the ID you refer to in the application to display the correct string. For example:

      <trans-unit id="SCOPEGUID:s1a448c10_c9b8_429f_bf83_a481d5f9e4bc:SERVICEID:oracle.webcenter.peopleconn:OBJECTTYPE:profile:OBJECTGUID:::WELCOME">
      <source>Welcome</source>
      </trans-unit>
      
    3. Save the .xlf file.

  6. Create a language/locale-specific version of the scope-resource-bundle.xlf file for each language you want to support:

    Caution:

    Make sure to correctly encode your file or you receive an error when you try to import the translations. You might want to use Oracle JDeveloper to edit the file because it automatically encodes special characters correctly.
    1. Copy the xlf file and save it as a language/locale-specific version. For example, scope-resource-bundle_de.xlf for German.

    2. Use a text editor (we recommend Oracle Fusion Middleware Configuring and Managing JDBC for Oracle WebLogic Server) to edit the <source> text to the translated values. For example, the scope-resource-bundle_de.xlf file would contain the following block:

      <trans-unit id="SCOPEGUID:s1a448c10_c9b8_429f_bf83_a481d5f9e4bc:SERVICEID:oracle.webcenter.peopleconn:OBJECTTYPE:profile:OBJECTGUID:::WELCOME">
      <source>Willkommen</source>
      </trans-unit>
      
    3. Save the .xlf file.

  7. Use the WLST command importMetadata to import the updated strings back into Oracle WebCenter Spaces. For example:

    importMetadata(application='webcenter',server='WC_Spaces',fromLocation='/tmp/metadata',docs='/oracle/webcenter/translations/scopedMD/s6d510603_b8f2_4d97_a1eb_507e1327c13a/*')
    

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

  8. Restart the WC_Spaces managed server.

  9. In Oracle WebCenter Spaces, edit the page with the reusable component, changing the properties for the component to refer to the translations. For example, change the text from #{security.userDisplayName} to #{uib_o_w_f_t_Translations['SCOPEGUID:s1a448c10_c9b8_429f_bf83_a481d5f9e4bc:SERVICEID:oracle.webcenter.peopleconn:OBJECTTYPE:profile:OBJECTGUID:::WELCOME']} #{security.userDisplayName}

  10. Save and close the page.

    Based on the example, the user profile component should display “Welcome userid” when English is selected, and “Willkommen userid” when German is selected.

35.5 Translating User Content

There are two main types of content in a Group Space: user-entered metadata, such as page names and Space names; and uploaded content, such as file content. The method you use for translation depends on which type of content you want to translate. This section includes the following sections:

35.5.1 Translating Page Names, Space Names, and Space Descriptions

When a user enters page names, the Space name, and the Space description, the values are saved as strings in a base .xlf file. Each Space has its own base .xlf file, stored in oracle/webcenter/translations/scopedMD/SPACE_GUID/scope-resource-bundle.xlf. If you want to translate this text you export the xlf file, translate the strings, then import the .xlf file back into Oracle WebCenter Spaces.

If you want to translate the page names, Space name, and Space description, you can customize the strings.

To translate page names, the Space name, and the Space description:

  1. In Oracle WebCenter Spaces, navigate to the Space you want to translate.

  2. Get the Space's GUID by clicking the About menu and choosing About Group Space. For example, s0f5677ff_03d8_4a71_a6dd_fa584f80e5f2.

  3. Use the WLST command exportMetadata to export the base .xlf file. For example:

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

    You can specify any folder in the toLocation; /tmp/metadata is used only as an example.

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

  4. Navigate to the directory to which you exported the xlf file, and into the following subdirectory: /oracle/webcenter/translations/scopedMD/SPACE_GUID, where SPACE_GUID is the GUID of the Space for which you are translating content. For example:

    cd /tmp/metadata/oracle/webcenter/translations/scopedMD/0f5677ff_03d8_4a71_a6dd_fa584f80e5f2/scope-resource-bundle.xlf
    
  5. Create a language/locale-specific version of the scope-resource-bundle.xlf file for each language you want to support:

    Caution:

    Make sure to correctly encode your file or you receive an error when you try to import the translations. You might want to use Oracle JDeveloper to edit the file because it automatically encodes special characters correctly.
    1. Copy the xlf file and save it as a language/locale-specific version. For example, scope-resource-bundle_de.xlf for German.

    2. Use a text editor (we recommend Oracle JDeveloper) to edit the <source> text to the translated values. For example, the scope-resource-bundle_de.xlf file would contain the following block:

      <trans-unit id="SCOPEGUID:s1a448c10_c9b8_429f_bf83_a481d5f9e4bc:SERVICEID:oracle.webcenter.peopleconn:OBJECTTYPE:profile:OBJECTGUID:::WELCOME">
          <source>Willkommen</source>
      </trans-unit>
      
    3. Save the .xlf file.

  6. Use the WLST command importMetadata to import the updated strings back into Oracle WebCenter Spaces. For example:

    importMetadata(application='webcenter',server='WC_Spaces',fromLocation='/tmp/metadata',docs='/oracle/webcenter/translations/scopedMD/s0f5677ff_03d8_4a71_a6dd_fa584f80e5f2/*')
    

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

  7. Restart the WC_Spaces managed server.

Based on the example, the page name should display “Sales Department” when English is selected, and “Vertriebsabteilung” when German is selected.

35.5.2 Presenting Translated Content Through a Content Presenter Template

To display translated content, you must create a Content Presenter template that looks up the display language and then displays content from a language-specific folder. For information on creating a Content Presenter template, see “Creating Content Presenter Display Templates” in Oracle Fusion Middleware Developer's Guide for Oracle WebCenter.