From 5e10ae89dff522667e4308e22e785b6009dee01e Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Fri, 24 Nov 2023 08:16:48 -0800 Subject: [PATCH 1/2] fix: use correct month for statement header title --- src/pages/wallet/WalletStatementPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/wallet/WalletStatementPage.js b/src/pages/wallet/WalletStatementPage.js index 0d33be70f1b7..135f9541099f 100644 --- a/src/pages/wallet/WalletStatementPage.js +++ b/src/pages/wallet/WalletStatementPage.js @@ -87,7 +87,7 @@ function WalletStatementPage(props) { const year = yearMonth.substring(0, 4) || getYear(new Date()); const month = yearMonth.substring(4) || getMonth(new Date()); - const monthName = format(new Date(year, month), CONST.DATE.MONTH_FORMAT); + const monthName = format(new Date(year, month - 1), CONST.DATE.MONTH_FORMAT); const title = `${monthName} ${year} statement`; const url = `${CONFIG.EXPENSIFY.EXPENSIFY_URL}statement.php?period=${yearMonth}`; From 32f3265d2eabee9aded5ecdcd8e8724cbd2bf440 Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Fri, 24 Nov 2023 08:51:12 -0800 Subject: [PATCH 2/2] chore: translate statement title to Spanish --- src/languages/en.ts | 1 + src/languages/es.ts | 1 + src/pages/wallet/WalletStatementPage.js | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index 68af6ec2341d..5b6314116880 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -1671,6 +1671,7 @@ export default { genericCreateTaskFailureMessage: 'Unexpected error create task, please try again later.', }, statementPage: { + title: (year, monthName) => `${monthName} ${year} statement`, generatingPDF: "We're generating your PDF right now. Please come back later!", }, keyboardShortcutsPage: { diff --git a/src/languages/es.ts b/src/languages/es.ts index f298839b05b8..5fd7beaa5903 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -1695,6 +1695,7 @@ export default { genericCreateTaskFailureMessage: 'Error inesperado al crear el tarea, por favor, inténtalo más tarde.', }, statementPage: { + title: (year, monthName) => `Estado de cuenta de ${monthName} ${year}`, generatingPDF: 'Estamos generando tu PDF ahora mismo. ¡Por favor, vuelve más tarde!', }, keyboardShortcutsPage: { diff --git a/src/pages/wallet/WalletStatementPage.js b/src/pages/wallet/WalletStatementPage.js index 135f9541099f..e79a2add5213 100644 --- a/src/pages/wallet/WalletStatementPage.js +++ b/src/pages/wallet/WalletStatementPage.js @@ -88,7 +88,7 @@ function WalletStatementPage(props) { const year = yearMonth.substring(0, 4) || getYear(new Date()); const month = yearMonth.substring(4) || getMonth(new Date()); const monthName = format(new Date(year, month - 1), CONST.DATE.MONTH_FORMAT); - const title = `${monthName} ${year} statement`; + const title = props.translate('statementPage.title', year, monthName); const url = `${CONFIG.EXPENSIFY.EXPENSIFY_URL}statement.php?period=${yearMonth}`; return (