From 695c25e0e036d6b41ee0fa3150517c26d054bc23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Genevi=C3=A8ve=20Bastien?= Date: Wed, 10 Apr 2024 18:14:28 -0400 Subject: [PATCH] widgets: Let Button confirm and cancel texts be `t` functions Use the `translateString` function to parse the confirm and cancel texts. --- packages/evolution-legacy/src/components/survey/Button.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/evolution-legacy/src/components/survey/Button.js b/packages/evolution-legacy/src/components/survey/Button.js index 946f7174..85c8181b 100644 --- a/packages/evolution-legacy/src/components/survey/Button.js +++ b/packages/evolution-legacy/src/components/survey/Button.js @@ -114,8 +114,8 @@ export class Button extends React.Component { cancelAction = {widgetConfig.confirmPopup.cancelAction} showCancelButton = {widgetConfig.confirmPopup.showCancelButton !== false} showConfirmButton = {widgetConfig.confirmPopup.showConfirmButton !== false} - cancelButtonLabel = {widgetConfig.confirmPopup.cancelButtonLabel} - confirmButtonLabel = {widgetConfig.confirmPopup.confirmButtonLabel} + cancelButtonLabel = {widgetConfig.confirmPopup.cancelButtonLabel ? surveyHelper.translateString(widgetConfig.confirmPopup.cancelButtonLabel, this.props.i18n, this.props.interview, this.props.path) : undefined} + confirmButtonLabel = {widgetConfig.confirmPopup.confirmButtonLabel ? surveyHelper.translateString(widgetConfig.confirmPopup.confirmButtonLabel, this.props.i18n, this.props.interview, this.props.path) : undefined} cancelButtonColor = {widgetConfig.confirmPopup.cancelButtonColor} confirmButtonColor = {widgetConfig.confirmPopup.confirmButtonColor} containsHtml = {widgetConfig.containsHtml}