diff --git a/Customizations/TagRendering.ts b/Customizations/TagRendering.ts
index 67b2b2864..6c8eb3965 100644
--- a/Customizations/TagRendering.ts
+++ b/Customizations/TagRendering.ts
@@ -463,7 +463,7 @@ class TagRendering extends UIElement implements TagDependantUIElement {
return "
" +
"
" + question + "" +
- (question !== "" ? "
" : "") +
+ (this._question.IsEmpty() ? "" : "
") +
"
" + this._questionElement.Render() + "
" +
this._skipButton.Render() +
this._saveButton.Render() +
@@ -471,10 +471,11 @@ class TagRendering extends UIElement implements TagDependantUIElement {
}
if (this.IsKnown()) {
- const html = this.RenderAnwser().Render();
- if (html == "") {
+ const answer = this.RenderAnwser()
+ if (answer.IsEmpty()) {
return "";
}
+ const html = answer.Render();
let editButton = "";
if (this._userDetails.data.loggedIn && this._question !== undefined) {
editButton = this._editButton.Render();
diff --git a/UI/ImageUploadFlow.ts b/UI/ImageUploadFlow.ts
index 1a628ad7b..8cf558b46 100644
--- a/UI/ImageUploadFlow.ts
+++ b/UI/ImageUploadFlow.ts
@@ -31,11 +31,12 @@ export class ImageUploadFlow extends UIElement {
this._uploadOptions = uploadOptions;
this.ListenTo(this._isUploading);
- const licensePicker = new DropDown("The picture is published ",
+ const licensePicker = new DropDown(
+ Translations.general.picture.licenseIntro,
[
- {value: "CC0", shown: "in the public domain"},
- {value: "CC-BY-SA 4.0", shown: "with a CC-BY-SA license"},
- {value: "CC-BY 4.0", shown: "with a CC-BY license"}
+ {value: "CC0", shown: Translations.general.picture.publicDomain},
+ {value: "CC-BY-SA 4.0", shown:Translations.general.picture.ccbysa},
+ {value: "CC-BY 4.0", shown:Translations.general.picture.ccby}
],
preferedLicense
);
@@ -67,7 +68,7 @@ export class ImageUploadFlow extends UIElement {
"
" +
diff --git a/UI/Input/DropDown.ts b/UI/Input/DropDown.ts
index dfbcafd9f..fc7012abc 100644
--- a/UI/Input/DropDown.ts
+++ b/UI/Input/DropDown.ts
@@ -3,27 +3,31 @@ import {UIElement} from "../UIElement";
import {InputElement} from "./InputElement";
import instantiate = WebAssembly.instantiate;
import {FixedUiElement} from "../Base/FixedUiElement";
+import Translations from "../i18n/Translations";
export class DropDown
extends InputElement {
- private readonly _label: string;
+ private readonly _label: UIElement;
private readonly _values: { value: T; shown: UIElement }[];
private readonly _value;
- constructor(label: string,
+ constructor(label: string | UIElement,
values: { value: T, shown: string | UIElement }[],
value: UIEventSource = undefined) {
super(undefined);
this._value = value ?? new UIEventSource(undefined);
- this._label = label;
+ this._label = Translations.W(label);
this._values = values.map(v => {
return {
value: v.value,
- shown: v.shown instanceof UIElement ? v.shown : new FixedUiElement(v.shown)
+ shown: Translations.W(v.shown)
}
}
);
+ for (const v of this._values) {
+ this.ListenTo(v.shown._source);
+ }
this.ListenTo(this._value)
}
@@ -60,7 +64,7 @@ export class DropDown extends InputElement {
}
return "