Culture-awareness in DocFusion refers to the ability to define format standards for input-data from any data source. It applies to dates and numbers, and makes DocFusion aware of what format patterns to use when parsing input data. This validates the integrity of the input data, eliminating inaccuracies or error. Thereafter, Adornments, expressions, or other DocFusion tools can be used to create a desired output in generated documents.
Culture definitions are useful to standardize data formats, and can be applied on global or template-specific levels. Globally, the settings will be applied to all templates in a business unit. This can, however, be overridden with settings on specific DocFusion templates, or using request parameters in API calls. There is an order of precedence that applies to the processing of culture settings that is described later in this article.
You can access culture and locale settings in either DocFusion Workbench or Template Designer, depending on whether you are applying awareness on global or template levels. Both allow you to customize an array of culture settings related to date-time and numbers, and the standard ISO-defined characters are used to pattern your formats.
ISO standards are used as the basis for culture and locale settings in DocFusion. By selecting a culture, the default date-time and number formats will be inherited from the related ISO standard. You can, of course, customize any of the default format patterns in DocFusion to meet the requirements of your data. When you haven't customized any settings nor selected a culture, DocFusion will default to your server locale.
Amongst the additional enhancements that accompany culture and locale functionality in DocFusion is the saving of its state during data serialization and a number of new workflow activities have been added to Workflow Designer.
Locale Standards
The ability to specify the locale of input data allows date and number formats to inherit from regional conventions. DocFusion uses the ISO standard for that region to read data in their native formats, and caters also for locale variants.
English dates, for instance, are patterned as month-day-year in the EN-US standard but as day-month-year in South African variant (EN-ZA, or ISO8601).
DocFusion also provides the facility to customize date and number format-patterns if you choose not to use an existing standard. Customization then can be used to enforce your own standards for data.
Order of Precedence
DocFusion lets you apply culture and locale settings on multiple levels, so an order of precedence applies:
- Firstly, to ensure that fallback settings are available when configurations with higher specificity are not available, or encounter an error. This affords culture settings a degree of tolerance.
- Secondly, the ability to override settings so that the handling of data can be tailored. This makes culture-settings flexible.
When resolving culture settings, overrides take place in the following order:
- Default: The active culture and locale setting of the server will be used when no other settings are available. This is usually the locale settings of the server operating system.
- Business Unit: Set in DocFusion Workbench, and specifies global culture settings that will be applied to all templates in a business unit.
- Custom BU Formatting: Overrides global settings with any custom format patterns being applied across all templates in a business unit.
- Template: Template-specific culture settings are configured in DocFusion Template Designer. Note that DocFusion culture settings are independent of any locale settings in Microsoft Word (the .docx file locale), which are not honoured during culture processing.
- Preserved Custom Formatting: Custom business unit formatting (3 above) will be applied before applying any template overrides, including custom formatting on the template level.
- Generation Request Parameter: Culture and locale settings that are passed as parameters to API generation requests have the highest order of precedence and override settings on the template, business unit and default levels.
Adornment Updates
Adornments are a common way to transform data that has been read-in using culture and locale patterns. Adornments that have been enhanced are:
- Format Date: Allows you to override the default culture so that the text string that is used follows the culture-related formatting options.
- Format Number: Allows you to override number formats for decimal, percentage and other number data types.
- Number to Ordinal Words: Output will be defined by the culture settings.
Note that, ordinarily, adornments automatically convert input data strings based on the current operating system locale. The addition of culture enhancements now allows this default behaviour to be overridden with a specific locale. The culture setting will be used to verify the input data for the field and then format accordingly.
Serialization
Should you wish to use a custom format for serialized dates and numbers, choose the appropriate culture, and then specify the data model fields as text. All conversions will attempt to translate them to text values based on the culture-defined formats; i.e. Date formatting Adornments, script ToString() functions, etc.
Workflow Activities
View a list of workflow activities related to culture and locale here...