Oracle® Fusion Middleware Administrator's Guide for Oracle WebCenter Portal 11g Release 1 (11.1.1.6.0) Part Number E12405-17 |
|
|
PDF · Mobi · ePub |
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:
Section 37.1, "What You Should Know About Languages in the Spaces Application"
Section 37.2, "Limiting Edits to a Particular String or Space"
Section 37.5, "Presenting Translated Content Through a Content Presenter Template"
For information on language configuration options available in Spaces, see Oracle Fusion Middleware User's Guide for Oracle WebCenter Portal: Spaces.
There are three main types of information that are displayed in the Spaces application:
User interface (UI) elements, such as field and button labels and seeded boilerplate text
User-entered metadata, such as page names, the space name, and the space 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 27 languages and 100 different locales. You need only change this text 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 site (rather than just one space), edit the strings in the override bundle.
To change the UI text for a particular space, edit the strings in the space-specific resource bundle.
User-entered metadata (such as page names, the space name, and the space description) is saved as strings in the resource bundle for the space. Each space has its own resource bundle. To change the user-entered metadata, edit the strings in this space-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, though there is a way that you can display translated content using Content Presenter.
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.
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:
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:
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.
Click the Edit icon (wrench) for the component that includes the string you want to edit.
In the Component Properties dialog box, click the Display Options tab.
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
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:
Navigate to the space that includes the strings you want to edit.
Click the Actions menu, choose About, then choose This Space.
In the This Space dialog box, note the Internal ID value.
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:
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.
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.
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>
Edit the text in the <source>
block to fit your business needs, then save the file.
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.
Restart the WC_Spaces managed server, and confirm that the changes you made appear in the UI.
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:
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.
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).
Translate each language/locale-specific string file:
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.
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>
Save the file.
Repeat these steps for each string file you want to translate.
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.
Add the new language to the supported-languages.xml file.
In Oracle JDeveloper, open supported-languages.xml.
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.
Deploy the updated language list:
Ensure that the CustomLanguageAdditions project is selected in the deployment profile.
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.
Restart the WC_Spaces managed server, and confirm your changes appear in the user interface.
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.