Customize labels to support multiple languages
When you create customizations in Common Data Service, you can support multiple languages by using labels.
|Label class||Label ComplexType|
|LocalizedLabel class||LocalizedLabel ComplexType|
Labels are localized strings displayed to users in the client applications. They are implemented by using
Label (Label ComplexType or Label class), which supports language packs. Strings that are displayed to users, such as entity display names or options in an option set, can be stored in multiple languages. Users can select which language they want displayed in forms and views in Common Data Service.
The following table lists all of the metadata that uses the
|AttributeMetadata.Description||Description for an attribute.|
|AttributeMetadata.DisplayName||Display name for an attribute.|
|EntityMetadata.Description||Description for an entity.|
|EntityMetadata.DisplayCollectionName||Plural display name for an entity.|
|EntityMetadata.DisplayName||Display name for an entity.|
|AssociatedMenuConfiguration.Label||Label used for an entity in an entity relationship.|
|OptionMetadata.Label||Label used for an option in a picklist, state, or status attribute.|
Label can store one string for each installed language. This array is the
LocalizedLabels property. There must always be a label stored for the base language. The labels for other languages can be null. If the user wants to display the user interface in a language and a label does not have a string for that language, the label for the base language is used.
You can use the
UserLocalizedLabel property to retrieve the label for the language chosen by the user.
Messages to use with labels
The following table lists the messages you can use to work with localized labels to support multiple languages. When you import translations you can generate a report based on the import Jjob in the same way you can when importing a solution. For more information, see Install or Upgrade a Solution.
|Message||Web API Operation||SDK Assembly|
Exports all translations for a specific solution to a compressed file.
Imports all translations from a compressed file.
Retrieves the results of an ImportJob as an XML document designed to be opened using Office Excel.
Retrieves the localized labels for the specified attribute.
Sets the localized labels for the specified attribute.
Customize labels in the base language
The customization tools provide ways to edit entity display names and you can customize these properties programmatically. You can also edit entity messages. But not every message is exposed. Another way to locate and customize text used in the application is to export the translations, edit the values for the base language and import the translations again. Although this is not the intended purpose of this feature it is a supported way to identify and customize text used in the application. For more information, see Modify Messages for an Entity.
Translate customized entity and attribute text
Because you can only perform customizations in the application by using the base language, when you want to provide localized labels for these customizations you must export the text of the labels so that they can be localized for any other languages enabled for the organization.
Export customized text for translation
Exported text is saved as a compressed file that contains a CrmTranslations.xml that you open by using Office Excel. You can send this file to a linguistic expert, translation agency, or localization firm.
For more information, see Office 2003 XML Reference Schemas.
Import translated text
After you have exported the customized entity or attribute text and had it translated, you can import the translated text strings in the Web application by using the
ImportTranslation message (ImportTranslation Action or ImportTranslationRequest class). The file that you import must be a compressed file that contains the CrmTranslations.xml and the [Content_Types].xml file just as they were exported.
After you import the completed translations, customized text appears for users who work in the languages that you had the text translated into.
Common Data Service cannot import translated text that is over 500 characters long. If any of the items in your translation file are longer than 500 characters, the import process will fail. If the import process fails, review the line in the file that caused the failure, reduce the number of characters, and try to import again.
Because customization is supported only in the base language, you may be working in Common Data Service with the base language set as your language preference. To verify that the translated text appears, you must change your language preference for the Common Data Service user interface. To perform additional customization work, you must change back to the base language.
Manage languages for your organization
Common Data Service enables you to install multiple language packs on a server and allows the user to select a language pack. For more information about how to install language packs, see Enable Languages. This section contains information about messages used to manage languages installed for your organization.
|Message||Web API Operation||SDK Assembly|
Contains the data needed to deprovision a language
Contains the data needed to provision a new language.
Retrieves the list of available languages.
Retrieves the list of language packs installed on the server that have been disabled.
Contains the data needed to retrieve the list of language packs installed on the server.
Contains the data needed to retrieve the version of an installed language pack.
Retrieves the list of language packs installed on the server that are enabled.
Retrieves the version of the language packs installed on the server.