Working with multi-language content
Ektron enables authoring, organizing, publishing, and versioning of Web content—in multiple languages. Ektron has a fully-developed, Web content localization solution that combines Web content management with localization/translation management, and supports creating content in any language supported by the Unicode standard. Ektron provides multi-language support for the following areas:
Multi-language editions of the same content have the same ID number but are differentiated by a language attribute. As a result, a Web page template can link to a content item, but what appears is determined by the selected language. There are 2 ways that content’s language can be selected:
langType
) parameter. For example, mytemplate.aspx?LangType=1033
. For a list of the decimal values for each supported language, see Ektron Workarea > Settings > Localization > Languages and Regions.Developers can use the following server controlA server control uses API language to interact with the CMS and Framework UI to display the output. A server control can be dragged and dropped onto a Web form and then modified.s for multi-language content:
The following Ektron components are affected by multi-language support:
The following steps provide an overview for setting up a multi-lingual website.
web.config
. web.config
.Prerequisite
Only members of the Administrator Group or those assigned to the XLIFF-Admin role can view, add, or edit language settings. See also: Using the roles screens .
A locale consists of a language and a region. For example, English (United States) describes the variation of English used in the United States, as opposed to English (English U.K.) used in the United Kingdom.
Each locale's identifier consists of a language code and region code.
You can create a new locale, if needed.
To determine which locales are available for creating content:
NOTE: If you select , the box in the
column is checked automatically. This is because, if you let users view the language on the site, it must be enabled in the Workarea.
The default content language on a drop-down list is determined in the ek_DefaultContentLanguage
element of the web.config
file.
If you enable only one language on the Enable Languages and Regions screen, fields that prompt the user to select a language do not appear in Ektron. Instead, all content is created in that language.
To disable any language, uncheck its box in the column of the Enable Languages and Regions screen.
Before disabling the default language, you must assign a new one. If you disable a language for which content exists, that content remains in the database but no one can access it, either from within Ektron or when visiting your site, unless you later re-enable that language.
When you install Ektron, the default language is US-English (1033). The default language determines which edition of content is displayed if a site visitor does not select a language, or a visitor selects a language other than the default and goes to page for which content does not exist in the selected language. In that case, Ektron looks for the selected language's Fallback Locales. For more information, see Setting the fallback locale. If content is not available in any of its Fallback locales, Ektron displays that content in the default language (if available).
IMPORTANT: You must enable a language before setting it as the default. See also: Determining which languages are available
To change the default language for your multi-language website:
yourwebsite\web.config
.ek_DefaultContentLanguage
to the locale id of the default language. For example, 1031 for German. For a list of locale ids, see Ektron Workarea > Settings > Localization > Languages and Regions.web.config
.When a site visitor selects a language then goes to a page on your site, Ektron uses the following criteria to determine which language edition of content to display.
To let site visitors to view your site in any enabled language, your developer places a LanguageSelect server control on any template. See also: LanguageSelect
You can also indicate a language-edition by adding a language parameter to a quicklinkA special kind of hyperlink that jumps to another content item on your Web site. (A regular hyperlink jumps to a Web page on the internet.). For example, products.aspx?LangType=1033
displays the English (US) edition of the products.aspx
content. This syntax automatically sets the language cookie.
NOTE: For a list of the decimal value of each supported language, see Ektron Workarea > Settings > Localization > Languages and Regions.
Creating an external link to a page of foreign content
If another website links to a multi-lingual page on your site, the URL must include the language ID parameter. For example:
www.ektron.com/web-content-management-solutions.aspx?LangType=1036
Part of managing a multi-language website involves creating and deploying multi-language metadata. There are 2 scenarios for doing this.
This section explains how to set up the xliff export/import process so that text-based metadata is translated along with text in the content, summaryA short description that supplements a content item's title on a Web page. Content authors compose a summary when creating or editing content. Server controls and widgets can display a content title and summary to attract readers to the full story. Summaries can include images and text formatting., and so on. It is easiest to set this up while creating a metadata definition. However, if you already have metadata definitions in a source language and now want them translated along with content, procedures for that type of setup are also provided.
Prerequisites
To create multi-language metadata to be translated:
NOTE: You can assign metadata to a parent folder, and let its child folders inherit the definitions.
To do that:
There are 2 ways to add support for multi-language metadata after a metadata definition is created.
To create a new metadata definition in the target language:
In this procedure, you use an .xml file to map metadata definitions in different languages. It assumes that, for a metadata definition that exists in a source language, you want to create a corresponding one in a target language. For example, consider these metadata definitions.
IDs 102 and 106 contain the same information in different languages.
An XML file contains the mapping, which informs the XLIFF export/import process that metadata ID 102 in English corresponds to 106 in Spanish.
Prerequisite
Locale codes for the source and target languages. See Workarea > Settings > Localization > Languages and Regions.
workarea/xslt/metadataDefinitions.xml
.<dd>
element within the <dl>
element. The <dd>
element has the following form.<dd title="Name of the metadata definition"> <dfn id="ID" xml:lang="language-country code"/> <dfn id="ID" xml:lang="language-country code"/> : </dd>
For example:
<dl> <dd title="Paper form number"> <dfn id="102" xml:lang="en-US"/> <dfn id="106" xml:lang="es-ES"/> </dd> </dl>
metadataDefinitions.xml
file to determine which definitions in the source language correspond to target language definitions. From now on, if you export content for translation from that folder then import the translated files, the metadata is translated along with the content, summaryA short description that supplements a content item's title on a Web page. Content authors compose a summary when creating or editing content. Server controls and widgets can display a content title and summary to attract readers to the full story. Summaries can include images and text formatting., and so on. See Exporting content to XLIFF, Importing translation files.Use this procedure if your authors create content in separate languages. There is no interaction between the content in the different languages
Use this procedure to create new content in a language other than the default language.
If you already have content in any language and want to create a new content item that contains a translated version of that content, see Translating content.
Prerequisite
- You have permission to add content to the folder.
- The desired language is available. See also: Determining which languages are available.
You can also view all content in a folder, regardless of language. This menu option makes it easy to find content in a selected language.
The View Contents of Folder screen displays the language of each content item.
You can set up a separate workflowA core element of Ektron, workflow lets you set up a sequence of approvers who control the publication of content to your website. for each edition of a content, and can create collectionA list of Ektron content links for display on a Web page.s, menus, taxonomy categories, and tasks in any supported language.
NOTE: Alternatively, you can designate certain sections of text within a content item to be included or excluded from certain languages. See also: Creating one or more localized paragraphs
If a template’s text should change according to a user’s language selection, use a case statement to provide the language-specific content. Assume you want to create editions of the menu that runs under the header in 3 languages: English, French, and German.
Dim t_search, t_products, t_support, t_news, t_careers, t_calendar, t_home, t_login, t_site_lang, t_contact, t_copyright, calendar_id
Select Case ContentLanguage Case "1031" t_search = "Suche" Case "1036" t_search = “Recherche" Case else t_search = "Search" End Select
When a user visits a page controlled by this template and selects French or German as the site language, the page is refreshed and the translated values appear on the template.
Many Web page templates include images that require translation. To set up templates to invoke images in the user-selected language:
Include the language in the title of the image. For example, tagline_English, tagline_French.
Ektron provides locales for every language and region supported by your Windows server.
You can create a new locale on the Edit Language Details screen by picking a combination of language and region, as defined by the Unicode Common Locale Data Repository. On Windows Vista and later versions, you can use the Microsoft Locale Builder to create custom, supplemental ASP.NET cultures. Custom cultures are helpful if no ASP.NET culture matches either the language or the region; for example, eo-150 (Esperanto in Europe). You also can create custom cultures for new combinations, for example, fr-US (French in U.S.). After you create a locale, Ektron authors can create content, menus, collectionA list of Ektron content links for display on a Web page.s, and so on, in that locale, and site visitors can view content based on it.
For example, your website's default language is US English. You have some content in Swiss German (de-CH). The fallback language for that is Austrian German (de-AT), and the fallback language for Austrian German is German (de-DE). If the content on a page is not available in Swiss German, Ektron tries to find an Austrian German edition. If it cannot find that, it looks for a German edition. If that is not available, it tries to display an English edition. See also Setting the fallback locale.
In certain situations, you may want no fallback locale. That is, you want to display nothing if content is not available in the selected language. To accommodate this, None is an option in the Fallback Locale drop-down list.
NOTE: If you set None as the Fallback Locale for any language, and content is not available in the selected language, nothing appears on the page and no other languages are checked.
IMPORTANT: Unlike the Locale field, the Language Tag field must conform to the IETF BCP 47(Best Current Practice).
Using a MachineTranslation Strategy
When you export content for translation and apply the MachineTranslation strategy, Ektron translates the content using machine translation then immediately imports it. See also: Using machine translation
The following is an example of how to implement the strategy. See also: CMS Strategies.
<objectFactory> <objectStrategies> <add name="MachineTranslation"> <strategies> <add name="MachineTranslationStrategyTemplate" type="Cms.Extensions.Templates .MachineTranslationStrategyTemplate, Cms.Extensions.Templates"/> </strategies> </add> </objectStrategies> <objectImplementations> </objectImplementations> </objectFactory>
Using a pseudoLocalization strategy
NOTE: For background information, see Pseudolocalization (Wikipedia).
When you export content for translation and apply the PseudoLocalization strategy, Ektron converts the content to pseudo-language text and the immediately imports it..
The following is an example of how to implement the strategy.
See also: CMS Strategies.
<objectFactory> <objectStrategies> <add name="MachineTranslation"> <strategies> <add name="MachineTranslationStrategyTemplate" type="Cms.Extensions.Templates .MachineTranslationStrategyTemplate, Cms.Extensions.Templates"/> </strategies> </add> </objectStrategies> <objectImplementations> </objectImplementations> </objectFactory>
<objectFactory> <objectStrategies> <add name="PseudoLocalization"> <strategies> <add name="PseudoLocalizationStrategyTemplate" type="Cms.Extensions.Templates .PseudoLocalizationStrategyTemplate, Cms.Extensions.Templates"/> </strategies> </add> </objectStrategies> <objectImplementations> </objectImplementations> </objectFactory>
Here is an example of how to override the PseudoLocalize
method.
public override void PseudoLocalize(ref string content, PseudoLocalizationEventArgs eventArgs)
Here are the PseudoLocalizationEventArgs
properties.
LocaleData Locale LocalizableCmsObjectType ObjectType long ObjectId
Developers use the PseudoLocalize
property to write custom code that programmatically starts the export process. Here is an example: Ektron.Cms.Localization.LocalizationExportJob.PseudoLocalize = true;
Ektron applies the PseudoLocalization strategy if either of the following conditions is met:
x-pseudo.
PseudoLocalize
property is true
.You can apply PseudoLocalization Strategy to a locale's language tag in the Workarea. Use the Settings > Localization > Languages and Regions screen's Custom EXT field, as illustrated in the following figure. Programmatically, LocaleData.XmlLang
contains x-pseudo
.
Here is an example of overriding the Translate method.
public override void Translate(ref string content, MachineTranslationEventArgs eventArgs)
The MachineTranslationEventArgs
have intellisense, but the following is a list of its properties.
LocaleData SourceLocale LocaleData TargetLocale LocalizableCmsObjectType ObjectType long ObjectId
Ektron applies the Machine Translation strategy if either of the following conditions is met.
x-mt
MachineTranslate
property is true
Developers use the MachineTranslate
property to write custom code that programmatically starts the export process. Here is an example: Ektron.Cms.Localization.LocalizationExportJob.MachineTranslate = true;
You can apply Machine Translation Strategy to a locale's language tag in the Workarea. Use the Settings > Localization > Languages and Regions screen's Custom EXTfield. Programmatically, LocaleData.XmlLang
contains x-mt
.
Culture
property. See also: How to: Set the Culture and UI Culture for ASP.NET Web Page Globalization.UICulture
property. See also: How to: Set the Culture and UI Culture for ASP.NET Web Page Globalization/siteroot/WorkArea/images/application/flags/
folder. Any flags with elements in common with the locale's language and region appear as choices. If there is no flag next to the locale you are creating (for example fr-017, French in Africa), you can create an image, assign that name to it, and place it in the designated folder. Then return to this screen, select the locale, and select the image.NOTE: If you set a language's Fallback Locale to None and the language is part of a fallback chain, if content is not available in that language, the chain terminates there.
You have the following options for translating content.
IMPORTANT: Before using machine translation services, you must first register with Google Translation services and then add your Google key value into the following code in the web.config
file:
<machineTranslation> <add key="GoogleTranslator" value="[your Google key value], https://www.googleapis.com/language/translate/v2?key=" /> </machineTranslation>
Use this procedure to initialize new foreign language content with content from a source language, then translate the content manually. The copying should facilitate the translation. For example, an editor translates content from French to German. The editor copies the French edition to new content whose language is German. As the editor translates the French edition into German, the French content is deleted. Any images in the content usually would remain, and all formatting (tables, bullets, and so on) is retained.
NOTE: You cannot translate XML Smart Forms using the Translate Content () button.
Ektron includes a machine translation feature, which is powered by the Google Translation Service. To see a list of supported languages, go to http://translate.google.com/.
NOTE: Machine translation is not supported for all languages in the Language Settings screen. Also, you cannot translate XML Smart Forms using this method.
Like most software-based translation, someone fluent in the new language should verify that the translation is appropriate within the context of the page.
The machine translation feature lets you choose a glossary (that is, a field, industry, or subject area). This helps the software find the best translation for a term or phrase in that field.
Follow these steps to use the machine translation feature.
Prerequisite
Your Ektron administrator has enabled the feature. See also: Enabling machine translation
NOTE: If you do not see the language on the drop-down, you need to enable the language. See also: Determining which languages are available
NOTE: When the View Contents of Folders screen reappears, it is probably set to the source language. In this case, you do not see the new content in the target language. To see it, click View > Language and select All or the target language.
Follow these steps to enable Ektron's machine translation feature.
NOTE: The Google Translate API is only available as a paid service.
web.config
file.<machineTranslation> <!-- ex. value="[API_KEY_FROM_GOOGLE], https://www.googleapis.com/language/translate/v2?key="--> <add key="GoogleTranslator" value="" /> </machineTranslation>
value
attribute.You can copy content into XLIFFXML Localization Interchange File Format; for exchanging localization data. files that you can submit to a translation agency, or translate the content "in house." When the translation is complete, you import translated content to Ektron.
You can translate these kinds of Ektron information.
Ektron supports versions 1.0, 1.1, and 1.2 of the XLIFF standard. You specify the version you are exporting in the web.config
file, using the ek_XliffVersion
element. Any listed version can be imported.
IMPORTANT: This button is only available in the eWebEdit400 editor.
The Localize Section button () lets you designate paragraphs to localize for the XLIFF translation process. For example, an author creates content in English, and does not want a specific paragraph to be translated into French. So, the author uses the Localize Section feature to exclude that paragraph from the French version of content. When the content is exported, the selected paragraph does not appear in the French XLIFF file.
On the following sample screen, Dutch and U.S. English are excluded. This means that French, German and Italian are included even though the Include box is not checked.
On the following sample screen, German and Italian are included. This means that Dutch, U.S. English, and French are excluded even though the Exclude box is not checked.
On the following sample screen, Dutch is included and U.S. English is excluded. In this case, because one language is included and another is excluded, German, Italian, and French are excluded even though the Exclude box is not checked.
<Localize>.
The following is an overview of importing translation files.
Alternatively, select a Translation Package. See also: Creating a multi-language translation package.
Prerequisite
Only members of the Administrator User Group and those defined in the Manage Members for Role: XLIFF-Admin screen can create or import XLIFF files. See also: Using the roles screens
IMPORTANT: Make sure the files have been translated before you import them.
For each new edition:
Prerequisite
Member of Administrators group, or assigned to the Translation State Admin or XLIFF Admin role See also: Defining roles
Each Ektron content item has a translation status. Only content marked "ready for translation" is included when you create an .xlf file. Use Mark Translation Status on the View Content screen to mark translation status. See also: Content statuses
A content item's Mark Translation Status button may have any of 3 icons, which indicate the content's status.
NOTE: You may apply this status to unapproved content if it needs translation before the site goes live.
If you click Mark Translation Status (), a menu appears that lets you change its status. Note that Export for Translation (
) appears on the toolbar only if the content's translation status is Ready for Translation.
If you create an .xlf file for a folder, only content whose translation status is ready is included in the file.
NOTE: The Localization Dashboardprovides an overview of translation activity within Ektron.
If you follow the guidelines in Creating multi-language metadata, key metadata fields are recognized in the XLIFF process and will be imported/exported.
After you import the translation files, Ektron removes them from the file system.
NOTE: If an error exists in any of the files, the erroneous files are moved into a subdirectory. The directory is created using a timestamp. For example: uploadedFiles\localization\merged\xlf20060208T141841_u1\error\.
The following metadata field names may be used for translation using the XLIFF export and import process.
Prerequisite
Only members of the Administrator User Group or those assigned to the XLIFF-Admin role can create, export, or import XLIFF files. See also: Using the roles screens .
To create one or more .zip files for translation:
NOTE: The Include Subfolders field appears only if you click Export for Translation from the View Contents of Folder screen.
To translate the content into some languages, uncheck the languages that you do not want. You can uncheck the box in the header row to uncheck all, then only check the ones you want.
The History section of the Export for Translation screen displays the translated files.
The history lists the .zip file created for each language. The top of the history window displays the most recently exported/imported files. ZIP files are indicated by the WinZip icon (). To the right of the icon are:
NOTE: When the translation agency returns XLIFF files, their extension must be .xlf or .xml. Other than that, the file name is not important.
XLIFF
ZIP
The user ID indicates which user performed the export or import.
Use the Multi-language Translation Package to create and control groups of content that require translation. Translation packages contain any type of content managed by Ektron including
For ease of use, you may add content and folders to one or more Translation Packages.
After creating a Translation Package, you use the Export for Translation screen's Select Packages field to export the content for translation. See also: Exporting content to XLIFF.
Only content that’s selected for that package and marked “Ready for Translation” is exported. See also: Marking translation statuses.
Prerequisite
You must be a member of the Administrators group or be assigned to the XLIFF Admin role. See also: Defining roles.
NOTE: You can add more languages to the package after creating it.
\Content\Company\Careers
folder. If you select a folder, only content in that folder that matches the Translation Package's source language is included. For example, you create a Translation Package in English. In that package, you select a folder which has 1 content item in English, 2 in Spanish, and 1 in German. When the package is exported for translation, it includes English content only.
MainSite\Content\Company\Careers
folder.NOTE: To check subfolders, open the folder tree to show the subfolders then check the top folder. To exclude subfolders, do not open the folder tree or uncheck the specific subfolders.
Complex images often contain text that you wish to translate. Because the image is a "flat" non-layered file, it is difficult to make text changes. However, the text may be on a layer within a Photoshop (.psd) file.
XliffReferenceSource
of the type Content Selector
. NOTE: The key name XliffReferenceSource
is a reserved and recognized by the XLIFF import/export process.Adding a metadata definition
By default, the Workarea is in English. Ektron provides US English strings in a text file. Workarea text (that is, screen titles, Workarea menus, messages, alt text for buttons, and so on) is stored in a resource file. Resource files are installed to the siteroot\Workarea\resources
directory. Workarea images that include text are stored in the workarea/images/language
folder. For example, Workarea\images\french_standard
.
Ektron provides a resource files for the following languages. The English resource file is complete, so translate the English file into the desired language. The others are partially complete.
A resource file is not human-readable. To make it so, use Microsoft’s resgen
utility, then translate the human-readable, .txt version of the file. The following example shows a portion of it.
add menu title=Add Menu lbl ad serverip=Domain Controller IP alt: remove collection items text=Click here to remove items from this collection
Each string has the following components:
btn
text appears on a button. For each string, translate the text to the right of the equal sign. Then, run the resgen
utility on the .txt file again, indicating the translate-to language. This converts the file back to a machine-readable format. Finally, move that file to the appropriate language folder under workarea/images
, and enable the new language in the Workarea.
Prerequisites
- The alphabetical, 4-character identifier of the country/language into which you are translating. See CultureInfo Classfrom the MSDN website.
- The server that hosts Ektron must have Visual Studio.NET.
resgen.exe
utility from C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\Bin\NETFX 4.0 Tools
to the your-web-site\Workarea\resources
folder.In Visual Studio, the resgen.exe
utility is typically located in the <SDK dir>\bin
directory, located via HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows
.
NOTE: If your computer does not have a resgen.exe file, see the following article: http://msdn.microsoft.com/en-us/library/vstudio/ccec7sz1%28v=vs.110%29.aspx
Note that it says "This tool is automatically installed with Visual Studio."
If you're using Windows 8 or 2012, go to C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Visual Studio 2010\Visual Studio Tools\Visual Studio Command Prompt.
siteroot\Workarea\resources
folder. For example, cd C:\Inetpub\wwwroot\CMS400Min\Workarea\resources
.resgen EKResource.en-US.resources anyfilename.txt
resources
directory. \\n\\
).resgen anyfilename.txt EKResource.two-character country
code-two-character language code.resources
.
Replace anyfilename.txt
with the file you named in Step 4. In this example, the .txt file is named span_translation.txt
. For example, to indicate that the Workarea is being translated into the Spanish/Spain, enter resgen.exe span_translation.txt EKResource.es-ES.resources
.
When the conversion is complete, Writing Resource File ...Done appears in the command window.
Workarea\resources
folder includes several resource files. If one exists for the translate-to language, it is overwritten. If one does not exist, it is created. To follow our example, the EkResource.es-ES.resources
file was updated with your changes.Workarea\images
folder contains text images that need translation. If the country/language into which you are translating has subfolder within Workarea\images
, inspect its images to see if they need translation. If the country/language into which you are translating does not have a subfolder within Workarea\images:
Workarea\images\en
folder.NOTE: If you use the default editor, your browser manages the spell checking.
Ektron’s spell checker for eWebEdit400 refers to a standard dictionary of the content’s language. So, for example, if the content is U.S. English, the U.S. English dictionary is referenced.
The spell checker also references a language-specific custom dictionary. Words are added to this list when a user stops at a misspelled word and chooses the Add to Dictionary option.
Both dictionaries reside on the server that hosts Ektron.
The spell checker compares each word against both sources. If a word is in either one, the spell checker moves to the next word. If a word is missing from both sources, the spell check options appear, and the user decides what to do.
Ektron provides the following standard dictionaries.
If Ektron does not have a dictionary that matches the content language, it proceeds through these steps in the following order:
If it begins with zh, use zh-CHS.
Prerequisite
You must be a member of the Administrators group or assigned to the XLIFFXML Localization Interchange File Format; for exchanging localization data. Admin role. See also: Defining roles
The Localization Dashboard provides an overview of translation activity occurring in Ektron. To access the Localization Dashboard from the Workarea, go to Settings > Localization > Dashboard. The top of the screen lets you choose criteria. The lower section then displays content that meets the criteria. For example, you can find all US English content whose translation status is Ready for Translation, and resides in the /Clients
folder. The lower section of the screen also lets you perform tasks on its content, such as print a list or change its Translation Status. See also: Marking translation statuses
The following list explains the fields at the top of the screen. After you enter the selection criteria, click Filter Results to apply the new selections.
IMPORTANT: These criteria have an AND relationship. This means that, if you select several criteria, only content that satisfies all appears in the lower section of the screen.
When you open the Localization Dashboard, the lower section displays all content in the Default Application Language.
NOTE: The pagination of the content list is controlled by the <add key="ek_PageSize">
element in your siteroot/web.config
file.
On the lower section, you can:
As described in Creating the .zip file, when exporting content for translation, you select one or more target languages. You can add, edit, or remove target languages for content in the lower section of the Localization Dashboard using Action menu options.
The actions associated with the menu options are performed the next time the Create XLIFF Files for Translation button is clicked:
To change the target language assigned to content in the lower section of the Localization Dashboard:
To learn about Translation Status, see Marking translation statuses.