diff --git a/src/pretix/plugins/wallet/static/pretixplugins/wallet/components/input/select.vue b/src/pretix/plugins/wallet/static/pretixplugins/wallet/components/input/select.vue index 17705c6db6..485697e523 100644 --- a/src/pretix/plugins/wallet/static/pretixplugins/wallet/components/input/select.vue +++ b/src/pretix/plugins/wallet/static/pretixplugins/wallet/components/input/select.vue @@ -9,7 +9,8 @@ const props = defineProps<{ label?: string choices: Array<[string, string]> errors?: string[], - class?: string + class?: string, + help_text?: string }>() const modelValue = defineModel(); const id = useId() @@ -28,5 +29,6 @@ watchEffect(() => { label.control-label(v-if="props.label" :for="id") {{ props.label }} select.form-control(:id="id" v-model="modelValue" v-bind="$attrs" required) option(v-for="choice in props.choices" :key="choice[0]" :value="choice[0]") {{ choice[1] }} + .help-block(v-if="props.help_text") {{ help_text }} .help-block(v-if="props.errors" v-for="error in props.errors") {{ error }} diff --git a/src/pretix/plugins/wallet/static/pretixplugins/wallet/components/placeholder-field-settings.vue b/src/pretix/plugins/wallet/static/pretixplugins/wallet/components/placeholder-field-settings.vue index fa88f59132..1729116b19 100644 --- a/src/pretix/plugins/wallet/static/pretixplugins/wallet/components/placeholder-field-settings.vue +++ b/src/pretix/plugins/wallet/static/pretixplugins/wallet/components/placeholder-field-settings.vue @@ -9,6 +9,8 @@ import { StoreKey } from "../walletStore"; const store = inject(StoreKey)!; const gettext = (window as any).gettext; +const ngettext = (window as any).ngettext; +const interpolate = (window as any).interpolate; const props = defineProps<{ fieldgroup: PlaceholderFieldGroupDefinition; @@ -60,6 +62,18 @@ const placeholderChoices = computed(() => { choices.push(["other", gettext("Other…")]); return choices; }); + +const overflowText = computed(() => { + if (!props.fieldgroup.max_entries) { + return "" + } + const formats = ngettext( + 'Maximum one field in this fieldgroup can be shown on the pass. The remaining fields will be shown in the selected fieldgroup.', + 'Maximum %s fields in this fieldgroup can be shown on the pass. The remaining fields will be shown in the selected fieldgroup.', + props.fieldgroup.max_entries + ); + return interpolate(formats, [props.fieldgroup.max_entries]) +}) diff --git a/src/pretix/static/pretixbase/js/gettextstub.js b/src/pretix/static/pretixbase/js/gettextstub.js index 069d5f40ea..be5071a19e 100644 --- a/src/pretix/static/pretixbase/js/gettextstub.js +++ b/src/pretix/static/pretixbase/js/gettextstub.js @@ -22,8 +22,8 @@ function pgettext (context, msgid) { function interpolate (fmt, object, named) { if (named) { - return fmt.replace(/%\(\w+\)s/g, function (match) { return String(obj[match.slice(2, -2)]) }) + return fmt.replace(/%\(\w+\)s/g, function (match) { return String(object[match.slice(2, -2)]) }) } else { - return fmt.replace(/%s/g, function (match) { return String(obj.shift()) }) + return fmt.replace(/%s/g, function (match) { return String(object.shift()) }) } }