From df218d8be873e5b56315c85ce923c19618e2bafe Mon Sep 17 00:00:00 2001 From: Arne Keller Date: Fri, 9 Jul 2021 12:18:26 +0200 Subject: [PATCH] Set content in LocaleChangeEvent listener --- .../kit/typicalc/view/content/infocontent/ImageSlide.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/edu/kit/typicalc/view/content/infocontent/ImageSlide.java b/src/main/java/edu/kit/typicalc/view/content/infocontent/ImageSlide.java index d329b8b..f5944c4 100644 --- a/src/main/java/edu/kit/typicalc/view/content/infocontent/ImageSlide.java +++ b/src/main/java/edu/kit/typicalc/view/content/infocontent/ImageSlide.java @@ -36,18 +36,18 @@ public class ImageSlide extends Slide implements LocaleChangeObserver { slideLayout = new VerticalLayout(); imageKey = imgKey; explanationKey = textKey; - explanation = new Span(getTranslation(explanationKey)); + explanation = new Span(); explanation.setId(EXPLANATION_ID); - slideLayout.add(new Image(getTranslation(imgKey), StringUtils.EMPTY), explanation); slideLayout.setId(SLIDE_LAYOUT_ID); add(slideLayout); + // actual content added in localeChange } @Override public void localeChange(LocaleChangeEvent event) { slideLayout.removeAll(); explanation.setText(getTranslation(explanationKey)); - slideLayout.add(new Image(getTranslation(imageKey), StringUtils.EMPTY), explanation); + slideLayout.add(new Image(getTranslation(imageKey), ""), explanation); } }