Always write log messages in English - #7202
Conversation
Some log messages were hardcoded in German, or resolved through the message resource bundle in the user's UI language. This led to a mix of languages in the log file, which complicates monitoring. As discussed in kitodo#6846, all log messages are now written in English. - Replace five German log messages in LdapServerService with English - Replace Helper.getTranslation(ERROR_EXPORT, ...) log calls in ExportDms with a static English message - Replace non-ASCII characters in log messages (FilterService, ImageManagement) Assisted-by: OpenCode / qwen3.8-27b-thinking (Alibaba Cloud) Signed-off-by: Stefan Weil <sw@weilnetz.de>
Up to standards ✅🟢 Issues
|
|
AI generated summary: A. Exception messages built from translated text (47 sites)The exception message is resolved through the message resource bundle in the user's UI language (de/en/es). Whenever such an exception is logged — stack trace,
B. Log statements logging
|
| if (Objects.nonNull(exportDmsTask)) { | ||
| exportDmsTask.setException(e); | ||
| logger.error(Helper.getTranslation(ERROR_EXPORT, process.getTitle()), e); | ||
| logger.error("Export canceled for process: '{}'", process.getTitle(), e); |
There was a problem hiding this comment.
Please use the message key as before and statically translate it to English instead of hardcoding the translation into the Java code.
| if (Objects.nonNull(exportDmsTask)) { | ||
| exportDmsTask.setException(e); | ||
| logger.error(Helper.getTranslation(ERROR_EXPORT, process.getTitle()), e); | ||
| logger.error("Export canceled for process: '{}'", process.getTitle(), e); |
Per review: instead of hardcoding the English translation into the Java code, keep the message key (errorExport) and resolve it through the message resource bundle, but pinned to English so the log file stays in English regardless of the user's UI language. Add a Helper.getTranslation(Locale, ...) overload that resolves the key in a given language; the existing overload now delegates to it using the user's UI language. Assisted-by: OpenCode / qwen3.8-27b-thinking (Alibaba Cloud) Signed-off-by: Stefan Weil <sw@weilnetz.de>
|
The CI is still flaky and fails often until PR #7185 was merged. |
Some log messages were hardcoded in German, or resolved through the message resource bundle in the user's UI language. This led to a mix of languages in the log file, which complicates monitoring. As discussed in #6846, all log messages are now written in English.
Assisted-by: OpenCode / qwen3.8-27b-thinking (Alibaba Cloud)