From d50e818d6e79b72492483db2bad493893cf1ac7b Mon Sep 17 00:00:00 2001 From: anhefti Date: Thu, 11 May 2023 11:05:23 +0200 Subject: [PATCH] SEBSERV-444 fixed --- .../gui/service/i18n/impl/PolyglotPageServiceImpl.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/service/i18n/impl/PolyglotPageServiceImpl.java b/src/main/java/ch/ethz/seb/sebserver/gui/service/i18n/impl/PolyglotPageServiceImpl.java index 1ddf4989..c642653e 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/service/i18n/impl/PolyglotPageServiceImpl.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/service/i18n/impl/PolyglotPageServiceImpl.java @@ -11,7 +11,9 @@ package ch.ethz.seb.sebserver.gui.service.i18n.impl; import java.util.Locale; import java.util.function.Consumer; +import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.StringUtils; +import org.apache.commons.text.StringEscapeUtils; import org.eclipse.rap.rwt.RWT; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Button; @@ -269,8 +271,14 @@ public final class PolyglotPageServiceImpl implements PolyglotPageService { final I18nSupport i18nSupport) { return label -> { + if (locTextKey != null) { - label.setText(i18nSupport.getText(locTextKey)); + final String text = i18nSupport.getText(locTextKey); + if (BooleanUtils.toBoolean((Boolean) label.getData(RWT.MARKUP_ENABLED))) { + label.setText(StringEscapeUtils.escapeHtml4(text)); + } else { + label.setText(text); + } } if (i18nSupport.hasText(locToolTipKey)) { label.setToolTipText(Utils.formatLineBreaks(i18nSupport.getText(locToolTipKey)));