Skip Headers
Oracle® Fusion Middleware Administrator's Guide for Oracle WebCenter Portal
11g Release 1 (11.1.1.6.0)

Part Number E12405-17
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

37 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 Spaces, see Oracle Fusion Middleware User's Guide for Oracle WebCenter Portal: Spaces.

37.1 What You Should Know About Languages in the Spaces Application

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

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

37.1.1 Languages Supported Out-of-the-Box by Spaces

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

Table 37-1 Languages Available in 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 37-1 includes all the languages available to 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 Spaces, including such tools as Oracle Enterprise Manager, provides a subset of the languages available to Spaces. These include:

  • English

  • Brazilian Portuguese

  • Chinese (Simplified)

  • Chinese (Traditional)

  • French

  • German

  • Italian

  • Japanese

  • Korean

  • Spanish

The Discussions service uses WebCenter Portal's Discussion Server. Out-of-the-box, the discussion server application supports English and Spanish. It does not support other languages listed in Table 37-1. However, the application 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 discussion server application user interface.

37.2 Limiting Edits to a Particular String or Space

You might need only to edit a particular string or the strings for a particular space. In that case, you need to find the values associated with the string or the space:

37.2.1 Finding the Resource Key for a String

If you want to edit a particular string, you need to know the resource key for the string so you can find it in the string files.

To find the resource key for a string:

  1. Open the page or resource in Composer. For details, see “Editing a Page Template in Composer”, “Editing a Page in a Space” or “Editing a Task Flow” in Oracle Fusion Middleware User's Guide for Oracle WebCenter Portal: Spaces.

  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 37-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 37-1 Display Options for Announcements Component - Resource Key

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

37.2.2 Finding the GUID for a Space

If you want to edit the UI text for a particular space or edit user-entered metadata, you need to find the GUID for the space.

To find the GUID for a space:

  1. Navigate to the space that includes the strings you want to edit.

  2. Click the Actions menu, choose About, then choose This Space.

  3. In the This Space dialog box, note the Internal ID value.

    Figure 37-2 GUID for a Space

    Description of Figure 37-2 follows
    Description of "Figure 37-2 GUID for a Space"

37.3 Modifying Strings

Whether you are modifying UI text site-wide, UI text for a particular space, or user-entered metadata in a space, the process is basically the same, you just modify different files. To modify UI text site-wide, you edit the override bundle (SpacesSeedDataOverrideBundle.xlf). To modify UI text or user-entered metadata for a particular space, you edit the space-specific resource bundle (scope-resource-bundle.xlf).

To modify strings:

  1. Use the WLST command exportMetadata to export the string files:

    • To export all strings, do not include the docs attribute. For example:

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

      This example exports all string files from the “webcenter” application on the “WC_Spaces” server to the “/tmp/metadata” folder. Always use “webcenter” as the application name. Change server name to match the server that hosts your installation of Spaces. Change the toLocation 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='/xliffBundles/SpacesSeedDataOverrideBundle.xlf,/oracle/webcenter/translations/scopedMD/SPACE_GUID/scope-resource-bundle.xlf')
      

      This example produces similar results to the first example, but exports only the site-wide override bundle and a space-specific resource bundle.

      • To edit site-wide UI strings, use the first docs value that points to the SpacesSeedDataOverrideBundle.xlf.

      • To edit space-specific UI strings and user-entered metadata, use the second docs value that points to the scope-resource-bundle.xlf, replacing SPACE_GUID with the GUID of the space 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 the Oracle Fusion Middleware WebLogic Scripting Tool Command Reference.

  2. Navigate to the folder into which you exported the string files, and open the string file in a text editor.

    Caution:

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

    • To edit the site-wide UI text, open /xliffBundles/SpacesSeedDataOverrideBundle.xlf.

    • To edit space-specific UI text or user-entered metadata, open /oracle/webcenter/translations/scopedMD/SPACE_ GUID/scope-resource-bundle.xlf, replacing SPACE_GUID with the GUID of the space for which you are modifying strings.

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

    The ID attribute (in SpacesSeedDataOverrideBundle.xlf) or OBJECTGUID attribute (in scope-resource-bundle.xlf) corresponds to the resource key you made note of when looking at the component in Composer.

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

    <trans-unit id="ANNOUNCEMENTS_TITLE">
    <source>Announcements</source>
    </trans-unit>
    

    Here is the <trans-unit> block for the Announcements title in a space-specific scope-resource-bundle.xlf file.

    <trans-unit id="SCOPEGUID:s1a448c10_c9b8_429f_bf83_a481d5f9e4bc:SERVICEID:oracle.webcenter.peopleconn:OBJECTTYPE:profile:OBJECTGUID:ANNOUNCEMENTS_TITLE">
    <source>Announcements</source>
    </trans-unit>
    
  4. Edit the text in the <source> block to fit your business needs, then save the file.

  5. Use the WLST command importMetadata to import the updated string files back into Spaces. For example:

    • To import all strings, 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” server. Change the fromLocation 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 Spaces.

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

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

      This example produces similar results to the first example, but imports only the site-wide override bundle and a space-specific resource bundle.

      • To import site-wide UI strings, use the first docs value that points to the SpacesSeedDataOverrideBundle.xlf.

      • To import space-specific UI strings and user-entered metadata, use the second docs value that points to the scope-resource-bundle.xlf, replacing SPACE_GUID with the GUID of the space for which you are modifying strings.

      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 the Oracle Fusion Middleware WebLogic Scripting Tool Command Reference.

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

37.4 Adding Support to Spaces for a New Language

If you want to support a language in Spaces that is not supported out-of-the-box provide string files for the new language, and add a <language> tag for the new language in the supported-languages.xml configuration file.

To add support for a new language:

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

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

    This example exports all string files for a Spaces application (“webcenter”) deployed on the “WC_Spaces” server to the “/tmp/metadata” folder. If necessary, change the server name to match your Spaces installation. You must change the toLocation 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 the Oracle Fusion Middleware WebLogic Scripting Tool Command Reference.

  2. Create a language/locale-specific version of each string file you want to translate. For example, to translate the site-wide UI text into Catalina, create SpacesSeedDataOverrideBundle_ca.xlf.

    • To translate site-wide UI text, copy /xliffBundles/SpacesSeedDataOverrideBundle.xlf.

    • To translate space-specific UI text or user-entered metadata, copy /oracle/webcenter/translations/scopedMD/SPACE_ GUID/scope-resource-bundle.xlf, replacing SPACE_GUID with the GUID of the space.

      Note:

      There are probably very few spaces that need to support new languages. However, you might want some spaces to be translated into the newly supported language (for example, any company-wide spaces).

  3. Translate each language/locale-specific string file:

    1. Open one of the copied string files in a text editor.

      Caution:

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

    2. Translate the <source> text in each <trans-unit> block.

      Here is an example of a <trans-unit> block from the site-wide SpacesSeedDataOverrideBundle.xlf file.

      <trans-unit id="ANNOUNCEMENTS_TITLE">
      <source>Announcements</source>
      </trans-unit>
      

      Here is an example of a <trans-unit> block from a space-specific scope-resource-bundle.xlf file.

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

    4. Repeat these steps for each string file you want to translate.

  4. Use the WLST command importMetadata to import the updated string files back into Spaces. For example:

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

    This example imports all string files from the “/tmp/metadata” folder to a Spaces application (“webcenter”) deployed on the “WC_Spaces” server. If necessary, change the server name to match your Spaces installation. Change the fromLocation 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 the Oracle Fusion Middleware WebLogic Scripting Tool Command Reference.

  5. Add the new language to the supported-languages.xml file.

    1. In Oracle JDeveloper, open supported-languages.xml.

    2. Add a <language> tag for the new language. For example, to support Catalina, add the following:

      <language name="Catilina" id="ca" used="true" translated="true"/>
      

      Specify the language name you want to appear in the UI as the value for the name attribute.

      Specify the language ID you added as the suffix of your translated string files as the value for the id attribute.

  6. Deploy the updated language list:

    1. Ensure that the CustomLanguageAdditions project is selected in the deployment profile.

    2. Build and deploy the customized Spaces .WAR. For details, see “Extending Spaces Using JDeveloper” in Oracle Fusion Middleware Developer's Guide for Oracle WebCenter Portal.

  7. Restart the WC_Spaces managed server, and confirm your changes appear in the user interface.

37.5 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 Portal.