Localized properties for multiple languages

InsuranceSuite apps can be configured to store localized values for multiple languages. ClaimCenter stores localized values in separate database tables.

You can work with localized values through Cloud API by marking the corresponding schema properties as localized. You can retrieve all or some language values for localized properties, and you can set localized values in POSTs and PATCHes.

For example, consider that an instance of ClaimCenter is configured to use both US English (en_US) and France French (fr_FR). The name property of a role is localized for both languages. You can make requests and responses that contain localized values for name:

{
  "data": {
    "attributes": {
        ...
        "name": "Privileged Administrator",
        "name_Localizations": {
            "en_US": "Privileged Administrator"
            "fr_FR": "Administrateur privilégié"            
        ...
        }
    }
  }
}

Enabling localized properties

The schema property x-gw-enableLocalizedProperties must be true to work with localized properties.

This is a top-level schema property that is set to true by default in the configuration/config/integration/schemas/gw/core/pl/framework/v1/framework_pl-1.0.schema.json file. All Cloud API schemas in ClaimCenter inherit this schema directly or through another schema, so the feature is enabled by default for all Cloud APIs.

Note: Guidewire recommends that you not set x-gw-enableLocalizedProperties to false in Cloud API schema extension files. However, it can be set to false if you write an entirely new schema.

Configuring localized properties

To work with localized values in Cloud API:
  • In the entity file, the column for the localizable value must have the <localization/> attribute
  • The property in the schema must have x-gw-localized set to true
  • The property in the schema must have x-gw-localized set to true
  • The property in the schema must be a string and cannot have the $ref attribute
For example, the name of the assessment summary entity is localizable. The localized values are kept in the assessmentsum_name_l10n database table. Therefore, the entity’s .eti file has a column that looks like this:
<entity
  ...
  <column
    desc="Name of the specific assessment service, model, or solution that generated this assessment summary"
    name="Name"
    nullok="true"
    type="shorttext">
    <localization
      tableName="assessmentsum_name_l10n"/>
  </column>
  ...
</entity>
The name property must also be marked as localized in the schema:
...
"AssessmentSummary: {  
  "properties": {
    "name": {
      "title": "Name",
      "type": "string",
      "x-gw-localized": true,
      "x-gw-extensions": {
        "securityLevel": "public"
      }
...

Note that for this feature to work as expected, mappers and updaters must be properly configured. Specifically, the path attribute for the mapper and updater files for the property must be set to the entity property that corresponds to the database column (for example, AssessmentSummary.Name).

As a result of these configurations, you can now send GET, POST, and PATCH requests with the localized fields. Use the includeLocalizations query parameter to view localized values in responses. See the Cloud API Consumer Guide for more.

How localized properties are processed

ClaimCenter automatically generates the appropriate schemas, mappers, and updaters at runtime to handle localized properties. The following occurs automatically:
  • Schemas - When JSON schemas are loaded, properties marked with x-gw-localized generate schema properties for localized values with _Localizations appended to the original property name. securityLevel and defaultViews attributes are copied over from the original property. A new LocalizedValues schema is generated to hold all localized values. For nullable values, the generated schema is LocalizedValuesNullable.
  • Mappers - For each localized property, a corresponding mapping property is generated to map localized values into the JSON response. The localized properties inherit the predicate attribute from the original property.
  • Updaters - Updater properties for localized values are generated to update localized values. These properties use the LocalizedValues schema and follow the same path as the original property. The following updater attributes are copied from the original updater’s localized property to all updater localization properties:
    • allowed
    • ignore
    • deferUpdate
    • afterGraphProperty
    • handlerName
    • preUpdateValidators
    • postUpdateValidators
    • handlerConfig

Permissions to access localized values are the same as permissions to access original values. These permissions are configured in <role name>_role.yaml files. Localized properties do not have to be explicitly listed in these files, because localized values are automatically treated the same as values in the original language.