Automatic Number Format Conversion (decimal/group separators)

Automatic Number Format Conversion (decimal/group separators)

 

 

Introduction

XTM Cloud offers a feature which converts numerical formats automatically, specifically those containing group and decimal separators, e.g., changing 1,234.56 (en_GB) to 1 234,56 (pl_PL), when translating between languages with different conventions.

Inconsistent or incorrect number formatting in translated documents frequently requires manual correction by linguists. This can lead to errors and increased post-processing time.


Configuration

This configuration change requires intervention from the XTM Support team. You do not have direct access to modify this setting. Furthermore, this is a global setting that XTM Support can configure on the client’s XTM Cloud instance. It will apply to all projects.

Example Configuration: To convert numbers for Polish (pl_PL):

<auto-conversion text='{ "autoNumbersConversionOptions":{ "useAutoConvertionForNumeric":true, "charSettings":{ "charSettingsPerLanguage":{ "pl_PL":{"groupingSeparator":"g","decimalSeparator":"d"} } }, "runInAnalysis":true, "runInEditor":true, "useAutoConvertionForAllSegments":true }, "autoCharactersConversionOptions":{ "runInAnalysis":true, "runInEditor":true, "useAutoConvertionForAllSegments":true } }' />
  • Ensure language codes like pl_PL and separators are correct for the customer's specific needs. Other languages can also be added to charSettingsPerLanguage.

    • In the example above:

      • pl_PL → This is the target language for which the conversion will change: g – this is a separator character for groups (ie. 1 000 000 will be changed into 1g000g000); d – this is a separator character for decimals (ie. 1,12 will be changed into 1d12).

The conversion will depend not only on the configuration but also on the source language. 

  • You can further specify if the conversion should run during project analysis (runInAnalysis) and/or in XTM Workbench (runInEditor). Set useAutoConvertionForAllSegments to “true” if you want it to apply to all segments, or to “false” if you only want to apply it to non-translatable ones.


How does the feature work?

Once the configuration is in place, a new project should be created or an existing project reanalyzed in XTM Cloud. Upon entering XTM Workbench, the conversion of all the numerals should take place automatically, according to the configuration specifics. Unless you modify the useAutoConvertionForAllSegments parameter, the conversion applies to all segments, regardless of their type and status.

Take a look at the following comparison:

  • Configuration applied:

<auto-conversion text='{"autoNumbersConversionOptions":{"useAutoConvertionForNumeric":true,"charSettings":{"charSettingsPerLanguage":{"en_US":{"groupingSeparator":",","decimalSeparator":"."},"pl_PL":{"groupingSeparator":".","decimalSeparator":","}}},"runInAnalysis":true,"runInEditor":true,"useAutoConvertionForAllSegments":true},"autoCharactersConversionOptions":{"runInAnalysis":true,"runInEditor":true,"useAutoConvertionForAllSegments":true}}' />

Display of Numerals for English as a target language

Display of Numerals for Polish as a target language

2025-11-05 09_00_35-Settings.png

 

In according with the configuration above:

  • The separator set for groups in English is , and for decimals is .. Therefore, only numbers with such separators will be converted for the Polish language to . and , accordingly.

  • In Polish, the set separator for groups is . and for decimals is ,. For this reason, the English number 1.12 will be converted to a number with the changed separator: 1,12 for the Polish language. As another example, the number 1 000 000 will not be converted at all from Polish to English (USA), which stems from the fact that the whitespace here is an undefined separator.


IMPORTANT ISSUES!

Active configuration affects all the languages

Keep in mind that even though you specify only certain languages in this configuration, it will affect all the languages in XTM Cloud that have some specific notation of numerals.

For example, if you specify de_DE and fr_FR in the configuration, the project created with the en_USApl_PL language combination will apply default separators for those languages.

MT population takes precedence over the configuration in alphanumeric segments

If you happen to create a project that is using both the configuration as well as any MT which is supposed to populate target segments right after project analysis, mind the fact that the MT will always populate alphanumeric segments, which will prevent the configuration from being applied to the said segments.