Convert

The main use-case for MT Companion Languages is to convert code from one eco-system to another. For such conversions, an API endpoint is prepared to automate this feature, but users can also make conversions in the UI, using the Convert section of Languages.

Code sets

All conversion parameters are located at the top of the section, including:

  • Code to convert. A plain text string which will be searched in the database of language codes. This field is mandatory.

  • To (Code set) is the target code set. In this selection, the code set to which the user wants to convert the Code is selected. This field is mandatory.

  • From (Code set) is selected in case the user wants to search ONLY in the defined code set. This field is optional - in case the ‘From’ code set is not defined, all code sets are searched.

Convert Results

In case the searched code was found, language conversion returns a list of code sets where the code was found as well as a list of corresponding target codes in the selected ‘To’ code set.

Both lists can contain more than one record, as the same codes might be defined for one or more code sets. In the search results, the matched codes are highlighted in yellow, while the converted code(s) are highlighted in green.

The page also displays alternative target codes when there is more than one occurrence of the target code meeting conditions of the search. Relevance of the target code is indicated by the order of returned codes in the list: first item in the code list is most relevant.

Example: We want to convert ‘de’ to MS_Code code set. Note that searched string (‘de’) is a language, but MS_Codes are defined as variants (like ‘de-AT’ or ‘de-DE’), so multiple results are found containing all ‘de’ variants defined in MS_Code set:

Code sets

The most relevant result is returned as a first item of the converted code list (‘de-DE’) based on the rules explained below.

Relevance of converted codes

Relevance of converted codes is based on following rules (sorted from most important):

  1. Searched code is the same as code found in ‘To’ code set

  2. Searched code is the generic code (Moravia Tag)

  3. Searched code was not found in the Tag Bag (there is at least one code not in the Tag Bag)

  4. An ‘Exact match’ found - searched code is on the same level as the matched code (language vs. variant). In our example, none of the matches are exact as ‘de’ is a language while ‘de-DE’ (and other found codes) are variants.

  5. Searched code was found as a variant

  6. Searched code was found in a Tag Bag

  7. In the case where more variants are returned, the variant containing the default country for a given language is moved to the first place (like in our example, ‘de-DE’ is a variant defined with Germany which is the default country for ‘de’ language)