From 6af21a465d6b30db66ad56be320d1a46bda5b5d0 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Sun, 12 Nov 2023 15:50:18 +0100 Subject: [PATCH 1/2] fix(NcTextField): Align default label for trailing button with used icon Signed-off-by: Ferdinand Thiessen --- src/components/NcTextField/NcTextField.vue | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/components/NcTextField/NcTextField.vue b/src/components/NcTextField/NcTextField.vue index c4ad39dc5a..505f65f8c0 100644 --- a/src/components/NcTextField/NcTextField.vue +++ b/src/components/NcTextField/NcTextField.vue @@ -182,14 +182,14 @@ export default { // Reuse all the props from NcInputField for better typing and documentation ...NcInputField.props, - // Redefined props - /** - * Label of the trailing button + * The `aria-label` to set on the trailing button + * If no explicit value is set it will default to the one matching the `trailingButtonIcon`: + * @default 'Clear text'|'Save changes'|'Undo changes' */ trailingButtonLabel: { type: String, - default: t('Clear text'), + default: '', }, // Custom props @@ -216,6 +216,12 @@ export default { computed: { propsAndAttrsToForward() { + const predefinedLabels = { + undo: t('Undo changes'), + close: t('Clear text'), + arrowRight: t('Save changes'), + } + return { // Proxy all the HTML attributes ...this.$attrs, @@ -223,6 +229,8 @@ export default { ...Object.fromEntries( Object.entries(this.$props).filter(([key]) => NcInputFieldProps.has(key)), ), + // Adjust aria-label for predefined trailing buttons + trailingButtonLabel: this.trailingButtonLabel || predefinedLabels[this.trailingButtonIcon], } }, }, From 118d82c133550140f728d60a74ba893d5bb137df Mon Sep 17 00:00:00 2001 From: nextcloud-command Date: Sun, 12 Nov 2023 15:40:17 +0000 Subject: [PATCH 2/2] Updating l10n asset Signed-off-by: nextcloud-command --- l10n/messages.pot | 3 +++ 1 file changed, 3 insertions(+) diff --git a/l10n/messages.pot b/l10n/messages.pot index 4939d762ed..fc8fecbd4c 100644 --- a/l10n/messages.pot +++ b/l10n/messages.pot @@ -215,6 +215,9 @@ msgstr "" msgid "Related resources" msgstr "" +msgid "Save changes" +msgstr "" + msgid "Search" msgstr ""