Nuclos localizing rules: BusinessException, InputRequiredException, MessageContext, localization key, locale, withArgs, DoNotTranslate. |
Language: Deutsch · English
Make rule messages translatable – BusinessException, InputRequiredException and MessageContext with keys, locale and placeholders.
Auf dieser Seite |
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.
For static texts: automatic key generation via the boolean flag true.
hier |
throw new BusinessException(new DoNotTranslate(machineApi.getErrorMessage())); |
Assign a fixed, unique localization key. This lets you change the source text later without rebuilding translations from scratch.
throw new BusinessException(new DoNotTranslate(machineApi.getErrorMessage())); |
Pass the text as a DoNotTranslate object:
throw new BusinessException(new DoNotTranslate(machineApi.getErrorMessage())); |
Dynamic parts via withArgs/withMessageArgs – only the template with {} placeholders is translated: