Versionen im Vergleich

Schlüssel

  • Diese Zeile wurde hinzugefügt.
  • Diese Zeile wurde entfernt.
  • Formatierung wurde geändert.
Auszug
hiddentrue

Nuclos localizing rules: BusinessException, InputRequiredException, MessageContext, localization key, locale, withArgs, DoNotTranslate.

globe with meridians Language: Deutsch · English

hammer and wrench Localizing rules

Make rule messages translatable – BusinessException, InputRequiredException and MessageContext with keys, locale and placeholders.

Status
colourPurple
titleHow-to
Status
colourBlue
titleApplication developer
Status
colourGreen
titleUpdated: Jul 2026
Status
colourGrey
titleapplies to Nuclos 4.2026.x

Panel
bgColor#F4F5F7

On this page

Inhalt
maxLevel2
minLevel2

Overview

Rule messages to the user can be localized since v4.2025.15. The classes BusinessException, InputRequiredException and MessageContext provide support. Pass a locale whenever possible – otherwise Nuclos tries to determine the nuclet from the package.

The quick way

For static texts: automatic key generation via the boolean flag true.

Codeblock
languagejava
hier
Codeblock
languagejava
throw new BusinessException(new DoNotTranslate(machineApi.getErrorMessage()));

The optimal way

Assign a fixed, unique localization key. This lets you change the source text later without rebuilding translations from scratch.

Codeblock
languagejava
throw new BusinessException(new DoNotTranslate(machineApi.getErrorMessage()));

Preventing translation

Pass the text as a DoNotTranslate object:

Codeblock
languagejava
throw new BusinessException(new DoNotTranslate(machineApi.getErrorMessage()));

Parametrizing messages

Dynamic parts via withArgs/withMessageArgs – only the template with {} placeholders is translated:

Codeblock
languagejava

Related pages

globe with meridians Localization


Overview.

Open →

gear Rule sets


Rules.

Open →

electric plug Supporting classes


Rule API.

Open →