Language Alternative Support - adobe-dmeservices/custom-metadata GitHub Wiki

Language Alternatives

For many metadata scenarios, it is common for certain properties to represent text that may have localized values. For Text fields, you can optionally enable Language Alternatives to display additional fields to users that align with specific localizations.

Once enabled, you can select one or more locale codes to display as alternative entry fields, although it is not required to have a specific language defined. You can select and deselect locale code in the dropdown to enable and disable alternative language fields. As you select each value, you will see the locale code populate in the Language Alternative field. Note: The list of country codes is prepopulated.

Selecting Language Alternatives

The first locale code you select will be automatically set as the default Language Alternative. You can change this choice if necessary.

When you view a Language Alternative field in a View, you will see the Default value indicated next to the name of the field. In addition, a drop down will appear under the text field.

Panel View of Alternative Language Field

Expanding the dropdown menu will reveal the Alternate Language fields. You can insert strings of text in these fields for alternative languages.

Expanded Panel View of Alternative Language Fields

Language Alternative fields will also display values that exist on the asset but which have not been defined in the View. Consider the following:

  • The View has Spanish, French, and German defined as locales and French as the default locale
  • The selected asset has Italian, English and Japanese values in the alt array

The View will display French as the default, with Spanish, German, Italian, English and Japanese in the accordion below. Italian, English and Japanese values will appear in italics to indicate that they are on the asset but not defined in the form. Users can edit values for all of these locales while the locales have values. If the user deletes the Italian value, then the form will no longer render Italian as a choice when the user selects the asset in the future.

Alternative Language fields show all values, when possible

Some additional considerations for Language Alternatives:

  • The default value cannot be empty when other locales have values.
  • Alternative locales appear in the accordion beneath the default value.
  • Alternative locales can have empty values.
  • If the selected asset has locales that do not appear in the View definition, those locales and their values will be added to the bottom of the accordion.
  • The form's defined default locale will always be shown above the accordion. If the asset does not have a defined value for this locale, then the asset's x-default value will be used. If this is not defined, then the first defined locale from the asset will be shown. For more details on how default values are selected, see XMP Specification Part 1, section 8.2.2.4 Language Alternative.

In the example below, French is defined as the default language, but there is no French value defined, so the English value is shown as the default value. Per the XMP specification, the first defined value will become the default value when a system queries the asset for a specific language and that language is not defined on the asset. The panel indicates that the French value is inherited from the English value. If the user changes the Example showing what happens when there is no value for the specified default language but other language values are defined

⚠️ **GitHub.com Fallback** ⚠️