Sie zeigen eine alte Version dieser Seite an. Zeigen Sie die aktuelle Version an.

Unterschiede anzeigen Seitenhistorie anzeigen

Version 1 Nächste Version anzeigen »

globe with meridians Language: Deutsch · English

hammer and wrench Localizing rules

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

HOW-TO APPLICATION DEVELOPER STAND: JUL 2026 GILT FUER NUCLOS 4.2026.X

Auf dieser Seite

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.

hier
throw new InputRequiredException(
				new InputSpecification(InputSpecification.CONFIRM_YES_NO, "my.nuclet.input.key.1",
"Soll eine Bestätigung gesendet werden?", "Rückfrage")); // vor v4.2025.15
throw new InputRequiredException(
				new InputSpecification(InputSpecification.CONFIRM_YES_NO, "my.nuclet.input.key.1",
true, "Soll eine Bestätigung gesendet werden?", "Rückfrage", Locale.GERMAN)); // ab v4.2025.15

The optimal way

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

MessageContext.sendMessage("Das Formular wurde erzeugt und im Laufwerk abgelegt."); // vor v4.2025.15
MessageContext.sendMessage(true, "Das Formular wurde erzeugt und im Laufwerk abgelegt."); // ab v4.2025.15

Preventing translation

Pass the text as a DoNotTranslate object:

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

Parametrizing messages

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

MessageContext.sendMessage("Das Formular wurde erzeugt und im Laufwerk abgelegt."); // vor v4.2025.15
MessageContext.sendMessage("org.nuclet.handel.pdf-created-and-stored", "Das Formular wurde erzeugt und im Laufwerk abgelegt.", /*no-title*/null, Locale.GERMAN); // ab v4.2025.15

Related pages

globe with meridians Localization


Overview.

Öffnen →

gear Rule sets


Rules.

Öffnen →

electric plug Supporting classes


Rule API.

Öffnen →

  • Keine Stichwörter