From fd9bbcb7158d8db0188f8df8fa067bafd420f118 Mon Sep 17 00:00:00 2001 From: Jack Nam <30609178+thienlnam@users.noreply.github.com> Date: Wed, 9 Oct 2024 12:32:24 -0700 Subject: [PATCH] Merge pull request #50384 from nkdengineer/fix/50381 [Cp Stag] fix Spanish translation (cherry picked from commit 342d5a1c145b18bea3709feb7c04c1342ab837be) (CP triggered by thienlnam) --- src/components/ReportWelcomeText.tsx | 4 ++-- src/languages/es.ts | 2 +- src/libs/SidebarUtils.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/ReportWelcomeText.tsx b/src/components/ReportWelcomeText.tsx index 12708a7acbfa..0b314ac8b2a3 100644 --- a/src/components/ReportWelcomeText.tsx +++ b/src/components/ReportWelcomeText.tsx @@ -50,7 +50,7 @@ function ReportWelcomeText({report, policy}: ReportWelcomeTextProps) { item !== CONST.IOU.TYPE.INVOICE, ); const additionalText = filteredOptions - .map((item, index) => `${index === filteredOptions.length - 1 ? `${translate('common.or')} ` : ''}${translate(`reportActionsView.iouTypes.${item}`)}`) + .map((item, index) => `${index === filteredOptions.length - 1 && index > 0 ? `${translate('common.or')} ` : ''}${translate(`reportActionsView.iouTypes.${item}`)}`) .join(', '); const canEditPolicyDescription = ReportUtils.canEditPolicyDescription(policy); const reportName = ReportUtils.getReportName(report); @@ -190,7 +190,7 @@ function ReportWelcomeText({report, policy}: ReportWelcomeTextProps) { {welcomeMessage.phrase1} )} - {isDefault && ( + {isDefault && displayNamesWithTooltips.length > 0 && ( {welcomeMessage.phrase1} {displayNamesWithTooltips.map(({displayName, accountID}, index) => ( diff --git a/src/languages/es.ts b/src/languages/es.ts index 771285c97c2e..51460e381072 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -662,7 +662,7 @@ const translations = { beginningOfChatHistoryUserRoomPartTwo: ' Fue creado por.', beginningOfChatHistoryInvoiceRoomPartOne: `Este chat es para facturas entre `, beginningOfChatHistoryInvoiceRoomPartTwo: `. Usa el botón + para enviar una factura.`, - beginningOfChatHistory: 'Este chat es con', + beginningOfChatHistory: 'Este chat es con ', beginningOfChatHistoryPolicyExpenseChatPartOne: 'Aquí es donde ', beginningOfChatHistoryPolicyExpenseChatPartTwo: ' enviará los gastos al espacio de trabajo ', beginningOfChatHistoryPolicyExpenseChatPartThree: '. Solo usa el botón +.', diff --git a/src/libs/SidebarUtils.ts b/src/libs/SidebarUtils.ts index 99811645a6ea..eb5b3c58cdef 100644 --- a/src/libs/SidebarUtils.ts +++ b/src/libs/SidebarUtils.ts @@ -573,7 +573,7 @@ function getWelcomeMessage(report: OnyxEntry, policy: OnyxEntry) }) .join(' '); - welcomeMessage.messageText = `${welcomeMessage.phrase1} ${displayNamesWithTooltipsText}`; + welcomeMessage.messageText = displayNamesWithTooltips.length ? `${welcomeMessage.phrase1} ${displayNamesWithTooltipsText}` : ''; return welcomeMessage; }