Multilingual Support of Site + Assets in 19.1.5 Oracle Content and Experience (OCE): Part II

OCE blogger
Oracle Developers
Published in
8 min readMar 6, 2019

In an earlier blog we talked about Multilingual Site Support. Now we will talk about Multilingual Support of Site + Assets in 19.1.5 Oracle Content and Experience (OCE).

Both sites and assets use the same concept and user interface for Multilingual Support. The only difference is the objects being translated; site artifacts (siteinfo.json, structure.json, and pages json) and content items are used, respectively. In 19.1.5 Oracle Content and Experience (OCE), you can translate both a site and assets together at the same time!

In the earlier blog on Multilingual Site Support, we created an enterprise site, named access, from the out-of-the-box template Access. The site was translated from English (United States) to Portuguese (Brazil). The site’s header, footer, description, and keywords were translated in siteinfo.json. The page names was translated in structure.json. Then the components’ strings were translated in the pages’ json. The translation was zipped and imported back into OCE.

For this blog, we will continue with site created in the earlier blog. The goal is to create a site that use assets and translate it with the OCE 19.1.5 Multilingual Support. We will first create a content type and register it with the repository. Based on the content type, we will create two content items. Then we will modify a page and insert a content list to fetch the content items. We will then translate the site and the content items. Finally, we will test the translation.

Let’s start by creating a content type for the assets. We will create a content type called access-type1 and define a text field.

Provide a display name for this field called headline. The rest of the properties are the default ones. Save and close the content type editor.

Now edit the already created repository, access-repos1, and specify the newly created content type, access-type1. Save in the repository editor.

If you’re starting the exercise from scratch as opposed to using what was created in the earlier blog, create a localization policy called access-local1 that has the required language, English (United States) (en-US), and an optional language, Portuguese (Brazil) (pt-BR). Then create a repository called access-repos1 and specify the newly created content type. Create an enterprise site called access, based on the out-of-the-box template Access, using access-repos1 as repository, and using access-local1 as the localization policy.

With the content type created, we can create the content items. Under Assets, select access-repos1 as the repository. As a filter, select access for Channel and English (United States) (en-US) for Language.

Click Create > Create a New Content Item. Select access-type1, enter headline1 for Name, and access as Targeted Channels.

In the content item editor for headline1, type “Service department named a winner for Best Web Support Sites.” in the headline field. Save and Close the content item editor.

Create another content item with access-type1 for Content Type, headline2 for Name, and access for Targeted Channel.

In the content item editor for headline2, type “Support coverage includes 24/7 fault monitoring and accelerated response.” in the headline field. Save and Close the content item editor.

The content items have been created. Let’s modify the access site’s Home page and add a content list to pull in the content items. First, let’s delete the Paragraph component on the left. In place of that, put in a Content List component.

Open Content List Settings and select access-type1 for Content Type.

Close the Content List Settings and Save the site update. The content items will be pulled in.

If you try the language selector in the editor and switch to pt-BR, the content list does not render anything because the content items were not translated for Portuguese (Brazil). However, if you followed the earlier blog, the Title and Button components around it already have been translated.

Now that the site is functionally ready. Let’s work on the translation. The basic idea is to create a translation job at the site level that will translate both the site as well as assets. Select the access site, then create a translation job using More > Translate.

In the Create Translation Job dialog, enter access-translate2 for Name and Portuguese (Brazil) (pt-BR) for Target Languages. For the Translation Job Contents field, if only the site will be translated (no assets), you can choose the Only site content option. Since we have the site as well as the assets to translate, choose the Complete site option. Then click Create to create the translation job.

After the translation job has been created, click Translation Jobs to see the list of jobs.

From the list of jobs, click access-translate2 job to see the details.

On the Translation Job screen, you will see both the Target Language (Site) and Target Language (Assets) status. Click Download to download the zip file of the translation bundle. Extract the downloaded zip file, and you will see the following content:

In the zip file, there will be two top-level folders, site and assets. The site folder has a root folder that contains all the site artifacts to be duplicated and translated for each language. For example, the structure.json file contains all the page names to be translated. The assets folder has another root folder that contains all the asset artifacts to be duplicated and translated for each language. For example, there are two json files that represent the two content items used by the site.

We will duplicate the root folders and their content and rename the folders to pt-BR for Portuguese. This is what we end up with:

To translate the site artifacts, you can use the already translated pt-BR.zip file. You can download pt-BR.zip and unzip it under the site folder at the same level as the site root folder.

To translate the first of two assets artifacts, open the assets/pt-BR/CORE*-headline1.json file, make the following update, and save the file.

Change

{“headline”:”Service department named a winner for Best Web Support Sites.”}

to

{“headline”:”Departamento de serviços nomeado vencedor dos Melhores Sites de Suporte da Web.”}

To translate the second of two assets artifacts, open the assets/pt-BR/CORE*-headline2.json file, make the following update, and save the file.

Change

{“headline”:”Support coverage includes 24/7 fault monitoring and accelerated response.”}

to

{“headline”:”A cobertura de suporte inclui monitoramento de falhas 24/7 e resposta acelerada.”}

With the translation of the artifacts completed, zip up the two top-level folder, assets and site, into one zip file. The zip file should contain the following folder hierarchy. The name of the zip file can be arbitrary.

With the translation bundle zip file generated, import it back to OCE. On the Translation Jobs screen, click Import.

In the Pick a File dialog, Upload the zip file generated (for example, Archive.zip). Click OK to select the zip file.

An Import confirmation dialog appears. You can expand the assets and pages sections for more information. Click Import.

After the import is complete, go back to the Site Builder and edit the site update. Use the language selector to pick en-US and verify that the content list shows English for content items.

Use the language selector to choose pt-BR and verify that the content list shows Portuguese for content items.

What happens when either the site or assets is not as part of the translation bundle? For example, you might already have translated the site in the earlier blog, and for this exercise you simply want to translate only the assets. In OCE, we allow either site or assets translation to be imported. When the import confirmation appears, you will get a warning about the missing translation. You will be able to import partially (site or assets). However, you will not be able to import only some of the pages or some of the content items — either all pages or all content items have to be imported.

That is a quick walkthrough of Multilingual Support of Site + Assets in 19.1.5 Oracle Content and Experience (OCE).

Lastly, language service providers play an important role in the translation process. They make it easy for translators to find out the translation status, keep track of translation artifacts and version dependencies, and provide other translation assistance. To best use Multilingual Site Support, Oracle recommends that you use a language service provider in the translation process.

--

--