This chapter explains how to configure multilingual support for a site.
This chapter contains the following sections:
When you configure a site for multilingual support, users in that site gain the ability to assign locale (language version) designations to assets, and to create translations of assets. You also have the option to create site-specific delivery rules for multilingual content that determine which language versions of assets will be shown on the online site, and what to do if a visitor's request is for a language version in which the content does not yet exist.
This chapter describes important topics you need to consider when planning and implementing the design of your site with respect to multilingual support. The chapter then goes on to describe the procedures necessary to configure your site to support multilingual assets and related features.
This section contains the following topics:
Locale designations in WebCenter Sites are implemented through the concept of dimensions. A dimension is an identifier that differentiates assets that are otherwise semantically identical. A locale (such as en_US
for US English) is thus a type of dimension that differentiates two translations of the same content.
Dimensions are represented by assets of type Dimension. This asset type must be enabled by developers on a per-site basis so that users can create Dimension assets (of subtype Locale), and so that content providers can assign locale designations to assets they wish to translate.
Note:
Users cannot create translations of assets that have no locale designation assigned.
Each Dimension asset represents a locale in the site. For example, an en_US
Dimension asset represents US English, and an fr_CA
Dimension asset represents Canadian French. When a content asset is assigned a locale, the assignment is recorded in the assetType_Dim
table for the corresponding asset type.
Publishing content in a given locale requires enabling the locale on the online site, that is, publishing the Dimension asset representing the locale to the delivery system, and including the locale in the site's dimension set. See Section 30.1.2, "Dimension Sets."
When you have created your locales, we recommend that you create at least one dimension set. A dimension set is a grouping of dimension assets (locales), which affects the delivery of content to the site visitor in the following ways:
A dimension set defines which locales are designated as enabled for the online site. In other words, a dimension set determines the languages in which content will be shown to the visitors. For example, one dimension set would contain European languages, another Asian languages, and so on.
A dimension set defines to filter content based on locale. For example, how to handle content that does not exist in the visitor's preferred language at the time the visitor requests it. If you do not publish a dimension set to the delivery system, locale filtering will not function. For information on locale filtering, see Section 30.2, "Working with Locale Filtering."
Note:
Dimension sets do not affect the operation of WebCenter Sites user interfaces.
For locale filtering to function on the online site, you must approve and publish to the delivery system both the DimensionSet assets and the Dimension assets referenced by each dimension set. (Because referenced Dimension assets are dependents of the DimensionSet assets referencing them, they must be approved with their respective DimensionSet assets.)
If you are setting up multilingual support in more than one site, you can choose to implement one of the following scenarios:
Create the locales, but no dimension sets
This option allows content providers to manage content in multiple languages, but does not enable render-time locale filtering. Use this option only if translations in all required languages will exist for each asset from the very beginning.
Create the locales and a dimension set, and share them across your sites
This option provides the simplest way of enabling multilingual support on multiple sites. Sites set up in this way share the properties stored in the dimension set (locales enabled for display on the online site, the locale filtering method, and, if applicable, the fallback hierarchy (the path the Hierarchical filter traverses when looking up asset translations at render time). See Section 30.2.2.3, "The Hierarchical Filter" for details. If you are creating a bare-bones site that you will replicate into multiple target sites, it is best to share your locales to the target sites.
Create separate locales and dimension sets for each site
This option affords the most flexibility, at the cost of increased configuration complexity. Sites set up this way benefit from the fact that properties such as locale filter type or fallback hierarchy can be tailored to each site.
Note:
While creating duplicate Dimension assets to represent the same language in multiple sites is possible, it is not recommended, as it introduces unnecessary complexity.
A mixture of the latter two options
This option provides the right balance between flexibility and configuration complexity. As a possible best practice, you would create a pool of unique locales, share the locales required by each site from that pool, and share or create dimension sets for each site as needed.
When an asset is assigned a locale for the first time, it gains master, or dimension parent, status. Master status allows the formation of a multilingual set (a group of assets whose content is semantically identical, but exists in different languages. (Note that this is not the same as a dimension set; a dimension set only affects the online site and the way assets are rendered.)
Note:
The terms master asset and dimension parent are equivalent. Master asset is displayed in WebCenter Sites's user interfaces; dimension parent is used in the Oracle Fusion Middleware WebCenter Sites Tag Reference, database table names (such as assetType_DimP
), and element code.
For example, when you designate an Article asset as US English (en_US
), and create translations of it in whichever locales are enabled in the site (such as French (fr_CA
) and German (de_DE
)), the translations point to their dimension parent (the US English asset) to indicate they are semantically equivalent to the master and one another.
When you create a translation of an asset with master status, WebCenter Sites copies the asset and assigns the locale of your choice to the copy. You then enter the translated content and save the translation as a new asset.
At this point, the source asset and its translation are linked into a multilingual set, and the translation adopts the source asset as its master, or dimension parent. Any member of the set that is not the master can be given master status; however, only one set member at a time can be the master.
The linking is accomplished through the assetType_DimP
table for the asset type. The table stores the following information:
ID of the master (dimension parent) asset
ID of the translation asset
ID of the locale dimension asset assigned to that translation
Even though WebCenter Sites interfaces allow you to initiate the creation of a translation from either the master asset or any of its existing translations, all translations in the multilingual set always point to the dimension parent (master) asset.
Note:
If a locale-aware asset is being revision-tracked, changes to asset locale data (such as locale designation or master status) do not generate a new version of the asset.
The way asset relationships are handled when an asset is translated is summarized in the following table:
Relationship Type | Behavior |
---|---|
Associations |
When an asset containing associations is translated, all assets associated with the source asset are automatically associated with the translation. You then have the choice to translate the associated assets and associate the translated versions with the translated parent asset. |
Collections |
When you create a translation of a Collection asset, the new Collection asset retains the member assets of the source asset. You then have the choice to translate the member assets and place the translated versions in the new Collection asset, replacing the member assets carried over from the old collection. |
Static Lists Recommendations |
When you create a new language version of a Static Lists recommendation, the new Recommendation asset retains the member assets of the source asset. You then have the choice to translate the member assets and place the translated versions in the new Recommendation asset, replacing the member assets carried over from the old collection. |
Dynamic Lists Recommendations |
Since Dynamic Lists recommendations are populated by element code, they are not affected. |
Related Items Recommendations |
When an asset containing Related Items associations is translated, all assets associated with the source asset are automatically associated with the translation. You then have the choice to translate the associated assets and associate the translated versions with the translated parent asset. |
Asset-Type Attributes |
When an asset containing associations through asset-type attributes is translated, all assets associated with the source asset are automatically associated with the translation. You then have the choice to translate the associated assets and associate the translated versions with the translated parent asset. |
Embedded Links |
Embedded links are not affected. When an asset containing embedded links is translated, you must manually update the links to point to the corresponding translations of the linked content (if such translations exist). |
For information on handling asset relationships at render time, see Section 30.2, "Working with Locale Filtering."
An approval dependency exists between two assets when editing one of the assets causes the other's approval status to change. The following table summarizes the approval dependencies affecting localized assets:
Dependency | Effect on Asset Approval |
---|---|
An Exists dependency exists between a localized asset and the Dimension asset representing the assigned locale. |
To approve a localized asset for publishing, the corresponding Dimension asset must also be approved. |
In a multilingual set, an Exists dependency exists between the master asset and each translation linked to it. |
When you create the first translation of an asset, you must approve both the asset and its translation. To approve a translation, you must also approve the corresponding master asset, unless the master asset has already been approved. You must reapprove all members of the set if:
|
An Exists dependency exists between a DimensionSet asset and the Dimension assets representing the locales enabled in that dimension set. |
To approve a dimension set, the corresponding Dimension assets must also be approved. |
Ideally, a multilingual site would be complete in terms of its content before it is launched. That is, all assets and their relatives would exist in all of the required languages. However, in many situations, this is not so. In such cases, you would use a locale filter to decide at render time which language version of an asset to show on the site depending on the circumstances and the language preference specified by the visitor. For example, you could let the business logic decide what to do if a requested asset does not exist in the requested language.
By using locale filtering, you can also spread editorial work over time by allowing content providers to create the required translations after the original content is published to the online site. Locale filtering allows the site to automatically pick up the missing translations as soon as they are published to the delivery system.
Keep in mind that locale filtering introduces additional load on the delivery system. The amount of additional load depends on the complexity of the filtering logic.
This section contains the following topics:
The way you choose to implement locale filtering will have an influence on how asset relationships on your site are structured, and vice versa, depending on the way you want the online site to behave.
You can choose to implement one of the following options:
Maintain different asset relationship trees for each locale
When rendering assets, this model renders whatever assets are associated with the requested asset.
For example, if an asset exists in English and French, and each version has a unique set of associated assets, each version is rendered with its respective associated assets. Filtering is only used to look up and deliver a version of the requested asset matching the language preference specified by the visitor; the associated assets are expected to already have been translated into all required languages.
This model allows for completely independent content for each language. It is used in the First Site II sample site.
Use the same asset relationship tree for all locales
When rendering assets, this model substitutes the associated assets of the requested asset with the assets associated with a specific language version of the requested asset, regardless of the language preference specified by the visitor.
For example, if an asset exists in English and French, each version has a unique set of associated assets, and the visitor specified French as their language preference, filtering will look up and deliver the French version of the requested asset, but it will substitute the associated assets of the English version in place of those of the French version (assuming the language version from which filtering is to derive associations is English).
This model ensures consistent content across all languages.
A mixture of the two models
Allows for the greatest amount of flexibility and customization for your site. The optimal proportion between the two models will depend on the intended behavior of your site.
WebCenter Sites ships with the following locale filters:
The Hierarchical Filter (also known as the Fallback filter)
You also have the option to implement custom locale filters, if desired. See Section 30.2.3, "Custom Locale Filters" for more information on custom filters.
Note that depending on the type of filter you choose to implement, the assets being filtered must satisfy one, or both of the following conditions:
Assets must have locale designations assigned. Assets without locale designations will be ignored by locale filters.
Assets that are translations of one another must be linked into multilingual sets (that is, designated as translations of one another through a master asset). Otherwise, the filters will not be able to perform the necessary translation lookups.
The Simple filter is a possible choice for a site that should only be rendered in one language, but whose content exists in multiple languages. The filter checks the following:
Whether the requested asset is in the language specified by the visitor
Whether the locale of the asset is listed in the site's dimension set
If both conditions are met, the filter passes the asset to the template for rendering; otherwise, nothing is rendered.
The Simple filter has the least impact on delivery system performance, but increases the amount of editorial work that needs to be done, as assets must exist in the required language versions or they will not be displayed on the online site.
The SimpleLookup filter is ideal for a site that should only be rendered in one language, but whose content may exist in multiple languages, and for which there is no guarantee that all of the necessary translations exist at render time. The filter checks the following:
Whether the requested asset is in the language specified by the visitor
Whether the locale of the asset is listed in the site's dimension set
If the requested asset is not in the visitor's preferred language, the filter looks up a suitable replacement by checking the asset's translations. If the filter finds a matching translation, it passes it to the template; otherwise, nothing is rendered. (The filter will also return nothing if the locale of the translation is not included in the site's dimension set.)
This filter offers a reasonable balance between performance and functionality. While the lookup queries slightly increase the load on the delivery system, the amount of editorial work done to create assets can be reduced, as the required translations can be created after the original content is published to the online site. The lookup mechanism will pick up the missing translations as soon as they are published to the delivery system.
The FirstSiteII sample site uses this filter as the default locale filter.
The Hierarchical filter checks whether the locale of the requested asset matches the locale requested by the visitor. If the locales do not match, the filter checks the asset's translations to see if a suitable replacement exists. If the filter finds a matching translation, it passes it to the template; otherwise, it substitutes translations of the requested asset according to the fallback hierarchy you set up when you configure the site's dimension set. The fallback hierarchy determines which language versions the filter should substitute for the requested asset, and in what order.
For example, consider the following hierarchy:
· en_US (US English)
· de_DE (German)
· de_CH (Swiss German)
· de_AT (Austrian German)
· fr_FR (French)
· fr_BE (Belgian French)
· fr_CA (Canadian French)
· en_UK (British English)
In our example, when the visitor requests an asset in Swiss German (de_CH), the filter looks up the asset's translations and if it finds a Swiss German version of the asset, it passes that version to the template. If the filter cannot find a Swiss German version, it falls back to the next best locale in the hierarchy path, German (de_DE). If, in turn, no German translation exists, the filter follows the path specified in the hierarchy until it reaches the top of the tree. If no match is found in the process, nothing is rendered.
Note that the above example describes a situation in which the visitor specifies a single preferred language. If the user specifies multiple preferred languages (in most cases, in the form of an ordered list), the filter attempts to find a match in the fallback hierarchy for the visitor's most preferred language. If no match is found, the filter checks the next language on the visitor's list, until a match in the fallback hierarchy is found. When that happens, the filter attempts to substitute translations of the requested asset by tracing a path from the matching locale to the top of the fallback tree, as described earlier.
For example, if the user's preferred languages are Japanese, French, and English (in that order), the filter attempts to locate Japanese in its fallback hierarchy. Since Japanese is not in the hierarchy, the filter then attempts to locate French. French is in the hierarchy, so the filter traces a path from French to the root node of the tree, and attempts substitution according to that path, as illustrated by the example earlier in this section.
While powerful and convenient, the hierarchical filter has the following drawbacks:
The additional database queries run by the filter tax the performance of the delivery system. To minimize the performance hit, editorial work should be done to ensure that content exist in as many of the required languages as possible, so that the filter's activity is minimized. (You may also choose to use a different filter.)
Control over which assets to display on the online site is put exclusively in the hands of the site developer or administrator. This is because the filter follows the fallback tree configured in the dimension set, rather than the preference order specified by the site visitor (assuming the site is set up to accept multiple language preferences from each visitor).
Depending on the design of your site, you may decide to create custom filters. For example, your site design might call for a hierarchical (fallback) filter that favors the locale priority specified by the visitor, rather than the one defined in the dimension set. In such cases, a field in the Edit form for the DimensionSet asset lets you specify a custom filter class.
If you decide to incorporate locale filtering on your site, you must account for the additional compositional dependencies that are introduced as a result. Compositional dependencies determine how pages are cached on your delivery system.
When using locale filtering to look up a translation of an asset, the following factors determine how pages are cached, based on which assets are loaded during the lookup process:
The filtering logic employed
The page and asset from which the lookup request originates
The language preference specified by the visitor
A cached page containing the requested asset is dependent on all assets loaded during the lookup process. Thus, if an asset that is loaded during the lookup process is modified, the affected page is flushed from the cache.
For example, consider the SimpleLookup filter and the following multilingual set:
· en_US (master)
· fr_FR (translation)
· de_DE (translation)
If a visitor requests a page containing the French version, but the visitor's language preference is German, the lookup chain is as follows:
fr_FR > en_US > de_DE
In this example, all three assets are loaded, because the filter must first load the master asset linked to the French version, and then use the master asset to look up the German version. Thus, if any of these three assets is modified, the affected page is flushed from the cache.
If, on the other hand, the user requested the US English version, which is the master asset of the set, then the lookup chain would be shorter:
fr_FR > en_US
In such case, the French and US English versions are loaded, but the German version is not. Thus, modifying the German version would not cause the corresponding page to be flushed from the cache, but modifying the French or US English versions would.
For a detailed explanation of the lookup mechanisms employed by locale filters included with WebCenter Sites, see Section 30.2.2, "Included Locale Filters."
Section 30.2.4.2, "Caching Rules" explains the caching rules applicable to multilingual assets.
Once the translation lookup occurs and the affected page is cached, the page is flushed from the cache whenever one of the following occurs:
A new language is added to the multilingual set
A translation that was part of the lookup chain when the page was rendered is edited
A translation that is a member of the multilingual set is deleted
The set's master asset is edited
Another member of the set is designated as the master
To add support for locale filtering to your site, you must modify the templates and element code used on your site.
When the template code fetches an asset via the asset's c/cid
values, the locale filter executes its business logic on the incoming c/cid
values and returns the resulting c/cid
values (or nothing) to the template for rendering.
The structure of your site will influence how you implement locale filtering in your templates, and vice versa. It will also determine the behavior of your site in different scenarios.
For example, imagine five articles, each existing in two languages, en
(English), and fr
(French). The articles would be a1en
, a1fr,
a2en
, a2fr,
and so on. We can decide to put these articles into a collection and implement locale filtering in one of the following ways:
Create an English collection, c1en
, and assign all of the English articles to it. This way, before we render the collection, we would simply filter the c/cid
of the c1en
asset, then render its children without filtering their c/cid
values, because we trust the c1en
collection to be in a single language.
Create a multilingual collection (without assigning a locale to it) and add the articles in whatever languages are desired. Then, when rendering each article, filter the article c/cid
values so that the article is rendered in the locale specified by the visitor.
The rest of this section provides code examples based on the FirstSiteII sample site. We recommend that you examine the FirstSiteII code to get an idea of how it multilingual support.
Usually, you would place your filter code into a utility element and call the element at the top of the template to process the c/cid
values.
The following example shows how the FSIILayout
template calls the filter code stored in the FSIICommon/Multilingual/Filter
element asset via the render:lookup
tag:
<%-- Execute the Dimension filter to look up the translated asset that corresponds to the locale that the visitor requested. --%> <render:lookup site='<%=ics.GetVar("site")%>' varname="Filter" key="Filter" match=":x" tid='<%=ics.GetVar("tid")%>' /> <render:callelement elementname='<%=ics.GetVar("Filter")%>' scoped="global"/>
For filtering to work, you have to allow the visitor to specify a preferred language (locale). This preference must then be propagated throughout the entire site (that is, passed to all the templates).
The example below shows how this is accomplished in the FSIIWrapper
element. The last section of this example shows how the locale variable is set by taking the value from the session variable (earlier in the example, we ensure that the session variable exists).
<%-- The session variable locale refers to the id of the dimension with the subtype of Locale that specifies which language the site is to be rendered in. Users can select the locale of their choice from a menu on every page of the site, and once selected, it is stored in session. A default locale is mapped to this CSElement and is set if it has not already been set. --%> <ics:if condition='<%=ics.GetSSVar("preferred_locale") == null%>'> <ics:then> <render:lookup site='<%=ics.GetVar("site")%>' varname="default:locale:name" key='DefaultLocale' ttype="CSElement" tid='<%=ics.GetVar("eid")%>' match=":x"/> <asset:load name="defaultLocale" type="Dimension" field="name" value='<%=ics.GetVar("default:locale:name")%>'/> <asset:get name="defaultLocale" field="id" output="default:locale:id"/> <ics:setssvar name="preferred_locale" value='<%=ics.GetVar("default:locale:id")%>'/> </ics:then> </ics:if> <%-- Call the wrapped child page. There is no need to look up the template or to enable any special PageBuilder functionality, so we can use the render:satellitepage tag in this situation. --%> <render:satellitepage pagename='<%=ics.GetVar("childpagename")%>' packedargs='<%=ics.GetVar("packedargs")%>'> <render:argument name='c' value='<%=ics.GetVar("c")%>'/> <render:argument name='cid' value='<%=ics.GetVar("cid")%>'/> <render:argument name='p' value='<%=ics.GetVar("p")%>' /> <render:argument name="locale" value='<%=ics.GetSSVar("preferred_locale")%>'/> </render:satellitepage>
If your online site contains search functionality, you may choose to filter the search results returned to the visitor, based on the visitor's language preference.
The following example shows how the Page/SearchDetailView
template filters an IList
of search results so that the query can go against all languages but only return the desired results:
<%-- look up the dimension set and filter the ProductList results --%> <asset:load name="GlobalDimSet" type="DimensionSet" field="name" value='<%=ics.GetVar("GlobalDimSet")%>' /> <dimensionset:filter name="GlobalDimSet" tofilter="ProductList" list="ProductList"> <dimensionset:asset assettype="Dimension" assetid='<%=ics.GetVar("locale")%>'/> </dimensionset:filter>
For more information, see the Oracle Fusion Middleware WebCenter Sites Tag Reference. Additionally, examine the code in the FirstSiteII sample site to see how it implements multilingual support.
Before you start configuring a site for multilingual support, make sure you have satisfied the following prerequisites. It is best to make these decisions in agreement with your site administrators.
Determine how many languages to initially implement on your site (or sites), based on your organization's content management needs. You can either:
Build a site (or sites) to support a single language initially, and add support for additional languages as the need arises.
Plan ahead for all the languages you expect to incorporate across all of your sites and create the appropriate locales in advance.
Determine whether you will share existing locales and dimension sets to the new site (or sites), or create separate ones. For more information, see Section 30.1.3, "Cross-Site Multilingual Support."
Decide how asset relationships are going to be handled at render time with respect to locales, and choose the locale filtering method(s) appropriate to your decision. The choices you make will have to strike a balance between the desired levels of automation, delivery system performance, and editorial workload, and are thus best made in agreement with your site administrators. For more information, see Section 30.2, "Working with Locale Filtering." Note the following:
Different filtering methods provide different levels of automation at the cost of a performance hit on the delivery system. The more complex the filter, the higher the performance hit. For example, the SimpleLookup filter provides better performance than the Hierarchical filter.
Depending on the filtering method you implement, editorial work on site content can be spread over time, as translations can be created after the original content is created and published to the live site. The filtering logic you implement will decide what to do content that does not yet exist in the required language versions.
If you are converting a monolingual site to a multilingual site, obtain the element code you will use to assign the default locale to the assets in the site. Sample code based on the FirstSiteII sample site is provided in the section, Section 30.4.10.1, "Sample Element Code for Bulk-Assigning a Default Locale."
Note:
When replicating a site containing multilingual sets, make sure the master assets are available on the target site (by either sharing or copying). Otherwise, the set members will no longer be linked as translations of each other on the target site.
This section describes the procedures necessary to configure a site for multilingual support.
This section contains the following topics:
Section 30.4.2, "Enabling the Dimension and DimensionSet Asset Types"
Section 30.4.3, "Enabling the Locale Subtype of the Dimension Asset Type"
Section 30.4.9, "Configuring the Fallback Hierarchy of the Hierarchical Filter"
Section 30.4.10, "Bulk-Assigning a Default Locale to Assets in a Site"
This section provides an overview of the steps necessary to configure multilingual support for a site. Use this list as a quick reference during the configuration process.
To configure multilingual support for a site
Make the necessary decisions and preparations as described in Section 30.3, "Planning Multilingual Support for a Site."
Enable the Dimension and DimensionSet asset types on the site. For instructions, see Section 30.4.2, "Enabling the Dimension and DimensionSet Asset Types."
Enable the Locale subtype of the Dimension asset type on the site. For instructions, see Section 30.4.3, "Enabling the Locale Subtype of the Dimension Asset Type."
Create or share the desired locales. For instructions, see the following sections:
For creating new locales, see Section 30.4.4, "Creating a Locale."
For sharing existing locales, see Section 30.4.5, "Sharing a Locale to Another Site."
For help in determining whether to create new locales or share existing ones, see Section 30.1.3, "Cross-Site Multilingual Support."
Create or share a dimension set. For instructions, see the following sections:
For creating a new dimension set, see Section 30.4.6, "Creating and Configuring a Dimension Set."
For sharing an existing dimension set, see Section 30.4.7, "Sharing a Dimension Set to Another Site."
For help in determining whether to create a new dimension set or share an existing one, see Section 30.1.3, "Cross-Site Multilingual Support."
(Optional) If you are converting an existing monolingual site to a multilingual site, execute element code that assigns a default locale to each asset in the site. For instructions, see Section 30.4.10, "Bulk-Assigning a Default Locale to Assets in a Site." The section includes sample code which you can customize for your site.
Modify the templates used in the site to include support for the locale filter you selected when you configured the dimension set. For an overview of the process, see Section 30.2.5, "Adding Filtering Support to Your Site."
Note:
In addition to locale filtering, you will have to implement the following site functionality:
Allow the visitor to specify their language preference
Propagate the visitor's language preference throughout the site (by passing it to all templates on the site)
Maintain the visitor's language preference for the duration of the session.
Before you can create Dimension and DimensionSet assets in your site, you must enable the corresponding asset types and subtypes. This procedure describes how to enable the Dimension and DimensionSet asset types on your site. The next procedure describes how to enable the Locale subtype of the Dimension asset type on your site.
To enable the Dimension and DimensionSet asset types on your site
Log in to the WebCenter Sites interface and select the site in which you want to enable the asset types.
Select the Admin interface.
In the tree, select the Admin tab.
In the Admin tab, drill down the following hierarchy:
Expand the Sites node.
Under the Sites node, expand the node corresponding to the desired site.
Under the desired site node, expand the Asset Types node.
Under the Asset Types node, double-click the Enable node.
WebCenter Sites displays the Enable Asset Types form.
In the Enable Asset Types form, select the check boxes next to the Dimension and DimensionSet asset types.
Click Enable Asset Types.
WebCenter Sites displays the Start Menu Selection form.
In the Start Menu Selection form, select all of the check boxes, and click Enable Asset Types.
WebCenter Sites displays a message confirming the asset types have been enabled for the site.
Before you can assign locales to assets in your site, you must enable the Locale subtype of the Dimension asset type on your site.
To enable the Locale subtype of the Dimension asset type on your site
Log in to the WebCenter Sites interface and select the site in which you want to enable the subtype.
Select the Admin interface.
In the tree, select the Admin tab.
In the Admin tab, drill down the following hierarchy:
Expand the Asset Types node.
Under the Asset Types node, expand the Dimension node.
Under the Dimension node, double-click the Subtypes node.
WebCenter Sites displays the Subtypes for Asset Type: Dimension form.
In the form, click the Edit (pencil) icon next to the Locale subtype.
WebCenter Sites displays the Edit Dimension Subtype: Locale form.
In the Sites field, Ctrl+click the site in which you want to enable the Locale subtype.
Note:
You must Ctrl+click the name of your site in order to keep the existing site selections intact; if you simply click on the site name, other selected sites (if any) will be deselected.
Click Save.
To add a new locale to your site, create a Dimension asset of subtype Locale representing the desired locale, by performing the following steps:
Note:
If the locale you want to create designates a language that is already represented by a Dimension asset in another site in your WebCenter Sites system, share the existing Dimension asset representing that language to your current site instead to avoid redundancy.
In the button bar, click New.
In the list of asset types, click New Dimension.
WebCenter Sites displays the New Dimension form.
In the New Dimension form, do the following:
In the Name field, enter a descriptive name for the locale. It is recommended that you use the following convention as a best practice:
xx_YY
where:
xx
is the two-letter ISO 639-1 language code (for example, fr
for French)
YY
is the two-letter ISO country code (for example, CA
for Canada)
To complete the above example, the name fr_CA
would denote Canadian French.
In the Description field, enter a description of the language this locale represents.
In the Subtype drop-down list, select Locale.
Click Save.
To share a locale to another site, you must share the corresponding Dimension asset.
To share a locale to another site
Log in to the WebCenter Sites interface and select the site containing the Dimension assets for the locales you want to share.
Select the Admin interface.
Find the desired Dimension asset and open its Inspect form:
In the button bar, click Search.
In the list of asset types, click Find Dimension.
Enter the desired search criteria (if any), and click Search.
In the list of search results, navigate to the desired asset and click its name.
WebCenter Sites opens the asset in the Inspect form.
In the action bar, select Share Dimension.
WebCenter Sites displays the Share Dimension form.
In the Share Dimension form, select the check boxes next to the sites to which you want to share the Dimension asset. (To share the asset to all sites on your WebCenter Sites system, select the All Sites check box.)
Click Save Changes.
WebCenter Sites displays a message confirming the asset is now available in the sites you selected.
To create and configure a new dimension set
Add the Dimension assets (locales) you want to include in the dimension set to your Bookmarks by doing the following:
In the button bar, click Search.
In the Search form, click Find Dimension.
Enter the desired search criteria (if any) and click Search.
In the list of search results, navigate to the desired Dimension assets and select their check boxes.
Click Add to My Bookmarks.
Create and configure the dimension set by doing the following:
In the button bar, click New.
In the New asset list, click New DimensionSet.
WebCenter Sites displays the New DimensionSet form.
In the Name field, enter a descriptive name for the dimension set.
In the tree, select the Bookmarks tab.
In the Bookmarks tab, select a locale you want to add to the dimension set and click Add Selected Items. Repeat this step for each additional locale you want to add.
In the Dimension Filter Class field, select the desired locale filter type. The Advanced option lets you specify a custom filter class.
For more information on locale filter types, see Section 30.2, "Working with Locale Filtering."
(Optional) If you selected Advanced in step 2, enter the name of the custom filter class into the text box that appears.
When you are finished, click Save Changes.
(Optional) If you selected the Hierarchical filter in step 2, complete the steps in Section 30.4.9, "Configuring the Fallback Hierarchy of the Hierarchical Filter" to configure the filter's fallback hierarchy.
To share a dimension set to another site, you must share the corresponding DimensionSet asset.
To share a dimension set to another site
Log in to WebCenter Sites and select the site containing the DimensionSet asset you want to share.
Select the Admin interface.
Find the desired DimensionSet asset and open its Inspect form:
In the button bar, click Search.
In the list of asset types, click Find DimensionSet.
Enter the desired search criteria (if any), and click Search.
In the list of search results, navigate to the desired asset and click its name.
WebCenter Sites opens the asset in the Inspect form.
In the action bar, select Share DimensionSet.
WebCenter Sites displays the Share DimensionSet form.
In the Share DimensionSet form, select the check boxes next to the sites to which you want to share the DimensionSet asset. (To share the asset to all sites on your WebCenter Sites system, select the All Sites check box.)
Click Save Changes.
WebCenter Sites displays a message confirming the asset is now available in the sites you selected.
Usually, you configure the locale filter when you create the dimension set for your site. To make changes to the locale filter configuration in an existing dimension set, do the following:
Find the dimension set whose locale filter you want to configure and open in the Inspect form:
In the button bar, click Search.
In the Search form, click Find DimensionSet.
Enter the desired search criteria (if any) and click Search.
In the list of search results, navigate to the desired asset and click its name.
WebCenter Sites opens the asset in the Inspect form.
In the Dimension Filter Class field, select the option next to the desired filter type. The Advanced option lets you specify a custom filter class.
For more information on locale filters, see Section 30.2, "Working with Locale Filtering".
(Optional) If you selected Advanced in step 2, enter the name of the custom filter class into the text field that appears.
Click Save Changes.
(Optional) If you selected the Hierarchical filter in step 2, complete the steps in Section 30.4.9, "Configuring the Fallback Hierarchy of the Hierarchical Filter" to configure the filter's fallback hierarchy.
If you selected the Hierarchical (Fallback) locale filter when configuring your dimension set, perform the following steps to configure the filter's fallback hierarchy:
To configure the fallback hierarchy of the Hierarchical locale filter
If you plan to add new locales or rearrange existing locales in the fallback hierarchy, add the Dimension assets representing the locales to be included in the hierarchy to your Bookmarks by doing the following:
In the button bar, click Search.
In the Search form, click Find Dimension.
Enter the desired search criteria (if any) and click Search.
In the list of search results, navigate to the desired Dimension assets and select their check boxes.
Click Add to My Bookmarks.
Find and open in the Inspect form the dimension set that contains the Hierarchical filter you want to configure:
In the button bar, click Search.
In the Search form, click Find DimensionSet.
Enter the desired search criteria (if any) and click Search.
In the list of search results, navigate to the desired DimensionSet asset and click its hyperlinked name.
WebCenter Sites displays the DimensionSet asset in the Inspect form.
Configure the fallback hierarchy:
Note:
When configuring the fallback hierarchy, note the following:
A locale can appear in the fallback hierarchy only once.
If you need to delete a locale from the hierarchy, click the Delete (trash can) icon next to the locale node.
If you need to change the position of a locale in the hierarchy, delete it, then add it under the desired parent node.
In the Dimension Filter Class field, click Configure Locale Hierarchy.
WebCenter Sites displays the Configure Locale Hierarchy form.
In the Configure Locale Hierarchy form, click Edit.
WebCenter Sites displays an editable version of the form.
In the tree, select the Bookmarks tab.
(Optional) If the hierarchy is empty, select in the Bookmarks tab the locale you want to designate as the top node of the fallback hierarchy, then click Add Selected Items.
Select a parent node for the locale you want to add to the hierarchy.
If you are building a hierarchy from scratch, your only choice will be the top-level node you added in step d.
When building your hierarchy, keep in mind the direction in which the fallback process occurs (from most-specific to least-specific; that is, towards the root node of the tree).
In the Bookmarks tab, select the locale you want to appear under the parent node you selected in step e, then click Add Selected Items.
Repeat steps e and f for each additional locale you want to add to the hierarchy.
When your fallback hierarchy is complete, click Save Changes.
If you are converting a monolingual site to a multilingual site, you must assign a default locale to all assets in the site. The fastest way to accomplish this is to execute an element that assigns the default locale to the assets.
Note:
For your convenience, sample element code for this procedure is provided Section 30.4.10.1, "Sample Element Code for Bulk-Assigning a Default Locale." The sample code is intended as an example, and will have to be customized for your site.
To bulk-assign a default locale to assets in a site
Create a CSElement asset to hold the element code that will assign a default locale to your assets.
Create a SiteEntry asset that references the CSElement asset you created in step 1.
Call the SiteEntry asset you created in step 2 in a URL, as follows:
http://<host>:<port>/<context>/ContentServer?pagename= <siteentry_name>
where:
<host>
is the host of your WebCenter Sites system
<port>
is the port number on which WebCenter Sites is listening for connections
<context>
is the application context root assigned to the WebCenter Sites application.
<siteentry_name>
is the name of the SiteEntry asset you created in step 2.
When the element code completes execution, check to make sure that your assets have the desired locale assigned. If not, check the element code for possible errors.
This section contains sample element code written for the FirstSiteII sample site. The code does the following:
Creates a Dimension asset named en_US
to represent your default locale designation within the site (US English in this example).
Assigns this default locale to all Page assets within the site.
Note:
The code in this section is provided as an example. If you decide to use it, be sure to customize it for your site. Test the code before deploying it; no error checking is included in this example.
<%@ taglib prefix="cs" uri="futuretense_cs/ftcs1_0.tld"%> <%@ taglib prefix="asset" uri="futuretense_cs/asset.tld"%> <%@ taglib prefix="ics" uri="futuretense_cs/ics.tld"%> <%@ taglib prefix="render" uri="futuretense_cs/render.tld"%> <%@ taglib prefix="user" uri="futuretense_cs/user.tld"%> <cs:ftcs> <%-- Record dependencies for the SiteEntry and the CSElement --%> <ics:if condition='<%=ics.GetVar("seid")!=null%>'> <ics:then> <render:logdep cid='<%=ics.GetVar("seid")%>' c="SiteEntry"/> </ics:then> </ics:if> <ics:if condition='<%=ics.GetVar("eid")!=null%>'> <ics:then> <render:logdep cid='<%=ics.GetVar("eid")%>' c="CSElement"/> </ics:then> </ics:if> <%-- log in as firstsite--%> <user:login username="firstsite" password="firstsite"/> <%-- create the Dimension asset (this can be done manually) --%> <asset:create name="en_US" type="Dimension"/> <asset:setsubtype name="en_US" value="Locale"/> <asset:set name="en_US" field="name" value='en_US'/> <asset:set name="en_US" field="description" value='US English'/> <%-- enter your site's pubid below --%> <ics:setvar name="primarypubid" value="1112198287026"/> <asset:save name="en_US"/> <%-- look up the id of the Dimension asset you just created --%> <asset:get name="en_US" field="id" output="en_US.id"/> <%-- get a list of all Content_C assets in the site, and assign a dimension to each of them --%> <asset:list type="Content_C" list="allContentAssets" pubid="1112198287026"/> <ics:listloop listname="allContentAssets"> <ics:listget listname="allContentAssets" fieldname="id" output="id"/> <asset:load type="Content_C" objectid='<%=ics.GetVar("id")%>' name="tempName" editable="true"/> <asset:adddimension name="tempName" dimensionid='<%=ics.GetVar("en_US.id")%>'/> <asset:save name="tempName"/> </ics:listloop> </cs:ftcs>