How-to add an attribute and translate it

Introduction

Whenever you are extending the CoreOne Suite Meta Directory with new attributes, you might wanna think about localization. In a non multi language enviroment it’s enough to simply provide a Name and a Description for an attribute. But in many cases, this is not enough. This how-to shows you how to account for multi language support.

How-To add an attribute and translate it

Step 1 - Set a translation key

When creating the attribute, you are provided with the option to enter a Translation name key and a Placeholder name key.

The Translation name key will be used to translate the label html tag, and the Placeholder name key will be set as the placeholder attribute of the input html tag on all UI masks.

So if we were to create a new cost center attribute, we would set the Translation name key to something like CustomerName.Attribute.CostCenter and the Translation name key to CustomerName.Attribute.CostCenterPlaceholder

Step 2 - Add the translation key to the translation file

As documented in Languages & Localization | Localization files you can add or change any of the translation keys. So for our use case we would add the following lines to C:\ProgramData\itsense\LanguageData\itsense.moving.en.overrides.xml:

{ ... "CustomerName.Attribute.CostCenter": "Cost center", "CustomerName.Attribute.CostCenterPlaceholder": "Please enter the cost center number here" ... }

To do the same for German, add the following lines to C:\ProgramData\itsense\LanguageData\itsense.moving.d.overrides.xml

{ ... "CustomerName.Attribute.CostCenter": "Kostenstelle", "CustomerName.Attribute.CostCenterPlaceholder": "Bitte geben Sie hier die Kostenstelle ein" ... }

Step 3 - Recycle app pools and services

The translation files are only read by the application parts on startup. In order to make them available in all parts you need to recycle the appropriate app pool and restart the service.

© ITSENSE AG. Alle Rechte vorbehalten. ITSENSE und CoreOne sind eingetragene Marken der ITSENSE AG.