Nuclos internationalization rules: NuclosLocale, DataLocaleProvider, getDataLocales, setter, primary language, API. |
Language: Deutsch · English
Set and read multilingual field content from rules – NuclosLocale and DataLocaleProvider.
On this page |
For programmatic access to internationalized content (e.g. for interfaces), the Nuclos API extends the affected methods with NuclosLocale signatures. For backward compatibility the existing (non-extended) signatures always refer to the primary language.
Multilingual fields can be set, copied and read per locale:
public void update(UpdateContext context) throws BusinessException {
Auftrag a = context.getBusinessObject(Auftrag.class);
// set value for primary language
a.setBeschreibung("Allgmeiner Wert");
// set value for german
a.setBeschreibung(NuclosLocale.DE_DE, "Deutscher Wert");
// set value for american english
a.setBeschreibung(NuclosLocale.EN_US, "Deutscher Wert");
// get a list of all locales that are assigned to the current nuclos
List<NuclosLocale> lstLocales = DataLocaleProvider.getDataLocales();
a.setBeschreibung(lstLocales, "Wert fuer alle");
} |
DataLocaleProvider.getDataLocales() returns all languages assigned to the instance – handy to set a value for all languages.