From 0011aa795b333bf53328fcaeb5d918b70fed158d Mon Sep 17 00:00:00 2001 From: Nikki Wines Date: Wed, 20 Aug 2025 17:29:53 +0100 Subject: [PATCH 1/3] add support for translating default export template names in report action --- src/languages/en.ts | 10 +++++++++- src/languages/es.ts | 11 ++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index 53ee0ec45d93..7f6cdee8bfc1 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -6172,7 +6172,15 @@ const translations = { changeType: ({oldType, newType}: ChangeTypeParams) => `changed type from ${oldType} to ${newType}`, exportedToCSV: `exported to CSV`, exportedToIntegration: { - automatic: ({label}: ExportedToIntegrationParams) => `exported to ${label}`, + automatic: ({label}: ExportedToIntegrationParams) => { + const labelTranslations: Record = { + 'All Data - Expense Level Export': translations.export.expenseLevelExport, + 'All Data - Report Level Export': translations.export.reportLevelExport, + 'Basic Export': translations.export.basicExport, + }; + const translatedLabel = labelTranslations[label] || label; + return `exported to ${translatedLabel}`; + }, automaticActionOne: ({label}: ExportedToIntegrationParams) => `exported to ${label} via`, automaticActionTwo: 'accounting settings', manual: ({label}: ExportedToIntegrationParams) => `marked this report as manually exported to ${label}.`, diff --git a/src/languages/es.ts b/src/languages/es.ts index 748af2fb4c09..4651ab32e3d1 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -6192,7 +6192,16 @@ const translations = { changeType: ({oldType, newType}: ChangeTypeParams) => `cambió type de ${oldType} a ${newType}`, exportedToCSV: `exportado a CSV`, exportedToIntegration: { - automatic: ({label}: ExportedToIntegrationParams) => `exportado a ${label}`, + automatic: ({label}: ExportedToIntegrationParams) => { + // The label will always be in English, so we need to translate it + const labelTranslations: Record = { + 'All Data - Expense Level Export': translations.export.expenseLevelExport, + 'All Data - Report Level Export': translations.export.reportLevelExport, + 'Basic Export': translations.export.basicExport, + }; + const translatedLabel = labelTranslations[label] || label; + return `exportado a ${translatedLabel}`; + }, automaticActionOne: ({label}: ExportedToIntegrationParams) => `exportado a ${label} mediante`, automaticActionTwo: 'configuración contable', manual: ({label}: ExportedToIntegrationParams) => `marcó este informe como exportado manualmente a ${label}.`, From 8fbfc0cd0583e5e3b9695952dd28053f17b06856 Mon Sep 17 00:00:00 2001 From: Nikki Wines Date: Wed, 20 Aug 2025 17:30:14 +0100 Subject: [PATCH 2/3] add support for other languages --- src/languages/de.ts | 11 ++++++++++- src/languages/fr.ts | 11 ++++++++++- src/languages/it.ts | 11 ++++++++++- src/languages/ja.ts | 11 ++++++++++- src/languages/nl.ts | 11 ++++++++++- src/languages/pl.ts | 11 ++++++++++- src/languages/pt-BR.ts | 11 ++++++++++- src/languages/zh-hans.ts | 11 ++++++++++- 8 files changed, 80 insertions(+), 8 deletions(-) diff --git a/src/languages/de.ts b/src/languages/de.ts index ebda7505ac79..ea5becde2beb 100644 --- a/src/languages/de.ts +++ b/src/languages/de.ts @@ -6198,7 +6198,16 @@ const translations = { changeType: ({oldType, newType}: ChangeTypeParams) => `Typ von ${oldType} zu ${newType} geändert`, exportedToCSV: `in CSV exportiert`, exportedToIntegration: { - automatic: ({label}: ExportedToIntegrationParams) => `exportiert nach ${label}`, + automatic: ({label}: ExportedToIntegrationParams) => { + // The label will always be in English, so we need to translate it + const labelTranslations: Record = { + 'All Data - Expense Level Export': translations.export.expenseLevelExport, + 'All Data - Report Level Export': translations.export.reportLevelExport, + 'Basic Export': translations.export.basicExport, + }; + const translatedLabel = labelTranslations[label] || label; + return `exportiert nach ${translatedLabel}`; + }, automaticActionOne: ({label}: ExportedToIntegrationParams) => `exportiert nach ${label} über`, automaticActionTwo: 'Buchhaltungseinstellungen', manual: ({label}: ExportedToIntegrationParams) => `hat diesen Bericht als manuell exportiert nach ${label} markiert.`, diff --git a/src/languages/fr.ts b/src/languages/fr.ts index b3e58a9c21b1..7da03a6b4834 100644 --- a/src/languages/fr.ts +++ b/src/languages/fr.ts @@ -6209,7 +6209,16 @@ const translations = { changeType: ({oldType, newType}: ChangeTypeParams) => `changé le type de ${oldType} à ${newType}`, exportedToCSV: `exporté en CSV`, exportedToIntegration: { - automatic: ({label}: ExportedToIntegrationParams) => `exporté vers ${label}`, + automatic: ({label}: ExportedToIntegrationParams) => { + // The label will always be in English, so we need to translate it + const labelTranslations: Record = { + 'All Data - Expense Level Export': translations.export.expenseLevelExport, + 'All Data - Report Level Export': translations.export.reportLevelExport, + 'Basic Export': translations.export.basicExport, + }; + const translatedLabel = labelTranslations[label] || label; + return `exporté vers ${translatedLabel}`; + }, automaticActionOne: ({label}: ExportedToIntegrationParams) => `exporté vers ${label} via`, automaticActionTwo: 'paramètres de comptabilité', manual: ({label}: ExportedToIntegrationParams) => `a marqué ce rapport comme exporté manuellement vers ${label}.`, diff --git a/src/languages/it.ts b/src/languages/it.ts index f4e0c9921ab1..fbb9c66673b3 100644 --- a/src/languages/it.ts +++ b/src/languages/it.ts @@ -6212,7 +6212,16 @@ const translations = { changeType: ({oldType, newType}: ChangeTypeParams) => `cambiato tipo da ${oldType} a ${newType}`, exportedToCSV: `esportato in CSV`, exportedToIntegration: { - automatic: ({label}: ExportedToIntegrationParams) => `esportato in ${label}`, + automatic: ({label}: ExportedToIntegrationParams) => { + // The label will always be in English, so we need to translate it + const labelTranslations: Record = { + 'All Data - Expense Level Export': translations.export.expenseLevelExport, + 'All Data - Report Level Export': translations.export.reportLevelExport, + 'Basic Export': translations.export.basicExport, + }; + const translatedLabel = labelTranslations[label] || label; + return `esportato in ${translatedLabel}`; + }, automaticActionOne: ({label}: ExportedToIntegrationParams) => `esportato su ${label} tramite`, automaticActionTwo: 'impostazioni contabili', manual: ({label}: ExportedToIntegrationParams) => `ha contrassegnato questo report come esportato manualmente su ${label}.`, diff --git a/src/languages/ja.ts b/src/languages/ja.ts index fb88cd275a8f..23cafaa0bf4f 100644 --- a/src/languages/ja.ts +++ b/src/languages/ja.ts @@ -6171,7 +6171,16 @@ const translations = { changeType: ({oldType, newType}: ChangeTypeParams) => `${oldType} から ${newType} にタイプを変更しました`, exportedToCSV: `CSVにエクスポートされました`, exportedToIntegration: { - automatic: ({label}: ExportedToIntegrationParams) => `${label}にエクスポートされました`, + automatic: ({label}: ExportedToIntegrationParams) => { + // The label will always be in English, so we need to translate it + const labelTranslations: Record = { + 'All Data - Expense Level Export': translations.export.expenseLevelExport, + 'All Data - Report Level Export': translations.export.reportLevelExport, + 'Basic Export': translations.export.basicExport, + }; + const translatedLabel = labelTranslations[label] || label; + return `${translatedLabel}にエクスポートされました`; + }, automaticActionOne: ({label}: ExportedToIntegrationParams) => `${label} 経由でエクスポートされました`, automaticActionTwo: '会計設定', manual: ({label}: ExportedToIntegrationParams) => `このレポートを手動で${label}にエクスポート済みとしてマークしました。`, diff --git a/src/languages/nl.ts b/src/languages/nl.ts index c72491392315..4ca994fa4599 100644 --- a/src/languages/nl.ts +++ b/src/languages/nl.ts @@ -6205,7 +6205,16 @@ const translations = { changeType: ({oldType, newType}: ChangeTypeParams) => `veranderde type van ${oldType} naar ${newType}`, exportedToCSV: `geëxporteerd naar CSV`, exportedToIntegration: { - automatic: ({label}: ExportedToIntegrationParams) => `geëxporteerd naar ${label}`, + automatic: ({label}: ExportedToIntegrationParams) => { + // The label will always be in English, so we need to translate it + const labelTranslations: Record = { + 'All Data - Expense Level Export': translations.export.expenseLevelExport, + 'All Data - Report Level Export': translations.export.reportLevelExport, + 'Basic Export': translations.export.basicExport, + }; + const translatedLabel = labelTranslations[label] || label; + return `geëxporteerd naar ${translatedLabel}`; + }, automaticActionOne: ({label}: ExportedToIntegrationParams) => `geëxporteerd naar ${label} via`, automaticActionTwo: 'boekhoudingsinstellingen', manual: ({label}: ExportedToIntegrationParams) => `heeft dit rapport gemarkeerd als handmatig geëxporteerd naar ${label}.`, diff --git a/src/languages/pl.ts b/src/languages/pl.ts index 9317c6856407..afb3bcd7476f 100644 --- a/src/languages/pl.ts +++ b/src/languages/pl.ts @@ -6190,7 +6190,16 @@ const translations = { changeType: ({oldType, newType}: ChangeTypeParams) => `zmieniono typ z ${oldType} na ${newType}`, exportedToCSV: `wyeksportowano do CSV`, exportedToIntegration: { - automatic: ({label}: ExportedToIntegrationParams) => `wyeksportowano do ${label}`, + automatic: ({label}: ExportedToIntegrationParams) => { + // The label will always be in English, so we need to translate it + const labelTranslations: Record = { + 'All Data - Expense Level Export': translations.export.expenseLevelExport, + 'All Data - Report Level Export': translations.export.reportLevelExport, + 'Basic Export': translations.export.basicExport, + }; + const translatedLabel = labelTranslations[label] || label; + return `wyeksportowano do ${translatedLabel}`; + }, automaticActionOne: ({label}: ExportedToIntegrationParams) => `wyeksportowano do ${label} przez`, automaticActionTwo: 'ustawienia księgowe', manual: ({label}: ExportedToIntegrationParams) => `oznaczył ten raport jako ręcznie wyeksportowany do ${label}.`, diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts index c67680318bb0..637aab532cef 100644 --- a/src/languages/pt-BR.ts +++ b/src/languages/pt-BR.ts @@ -6204,7 +6204,16 @@ const translations = { changeType: ({oldType, newType}: ChangeTypeParams) => `alterado o tipo de ${oldType} para ${newType}`, exportedToCSV: `exportado para CSV`, exportedToIntegration: { - automatic: ({label}: ExportedToIntegrationParams) => `exportado para ${label}`, + automatic: ({label}: ExportedToIntegrationParams) => { + // The label will always be in English, so we need to translate it + const labelTranslations: Record = { + 'All Data - Expense Level Export': translations.export.expenseLevelExport, + 'All Data - Report Level Export': translations.export.reportLevelExport, + 'Basic Export': translations.export.basicExport, + }; + const translatedLabel = labelTranslations[label] || label; + return `exportado para ${translatedLabel}`; + }, automaticActionOne: ({label}: ExportedToIntegrationParams) => `exportado para ${label} via`, automaticActionTwo: 'configurações de contabilidade', manual: ({label}: ExportedToIntegrationParams) => `marcou este relatório como exportado manualmente para ${label}.`, diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts index 72cf43dc6000..e8094c855059 100644 --- a/src/languages/zh-hans.ts +++ b/src/languages/zh-hans.ts @@ -6090,7 +6090,16 @@ const translations = { changeType: ({oldType, newType}: ChangeTypeParams) => `类型从${oldType}更改为${newType}`, exportedToCSV: `导出为CSV`, exportedToIntegration: { - automatic: ({label}: ExportedToIntegrationParams) => `导出到${label}`, + automatic: ({label}: ExportedToIntegrationParams) => { + // The label will always be in English, so we need to translate it + const labelTranslations: Record = { + 'All Data - Expense Level Export': translations.export.expenseLevelExport, + 'All Data - Report Level Export': translations.export.reportLevelExport, + 'Basic Export': translations.export.basicExport, + }; + const translatedLabel = labelTranslations[label] || label; + return `导出到${translatedLabel}`; + }, automaticActionOne: ({label}: ExportedToIntegrationParams) => `通过 ${label} 导出到`, automaticActionTwo: '会计设置', manual: ({label}: ExportedToIntegrationParams) => `将此报告标记为手动导出到${label}。`, From 1b65daf8442dab7d6279b3f86a5c6bf9356dc303 Mon Sep 17 00:00:00 2001 From: Nikki Wines Date: Wed, 20 Aug 2025 23:12:20 +0100 Subject: [PATCH 3/3] use const keys --- src/CONST/index.ts | 4 ++++ src/languages/de.ts | 5 ++--- src/languages/en.ts | 5 ++--- src/languages/es.ts | 5 ++--- src/languages/fr.ts | 5 ++--- src/languages/it.ts | 5 ++--- src/languages/ja.ts | 5 ++--- src/languages/nl.ts | 5 ++--- src/languages/pl.ts | 5 ++--- src/languages/pt-BR.ts | 5 ++--- src/languages/zh-hans.ts | 5 ++--- 11 files changed, 24 insertions(+), 30 deletions(-) diff --git a/src/CONST/index.ts b/src/CONST/index.ts index 1106943058e2..1a183e3e1c02 100755 --- a/src/CONST/index.ts +++ b/src/CONST/index.ts @@ -1436,6 +1436,10 @@ const CONST = { REPORT_LEVEL_EXPORT: 'report_level_export', EXPENSE_LEVEL_EXPORT: 'detailed_export', }, + EXPORT_OPTION_LABELS: { + REPORT_LEVEL_EXPORT: 'All Data - Report Level Export', + EXPENSE_LEVEL_EXPORT: 'All Data - Expense Level Export', + }, ROOM_MEMBERS_BULK_ACTION_TYPES: { REMOVE: 'remove', }, diff --git a/src/languages/de.ts b/src/languages/de.ts index ea5becde2beb..88ee86304b59 100644 --- a/src/languages/de.ts +++ b/src/languages/de.ts @@ -6201,9 +6201,8 @@ const translations = { automatic: ({label}: ExportedToIntegrationParams) => { // The label will always be in English, so we need to translate it const labelTranslations: Record = { - 'All Data - Expense Level Export': translations.export.expenseLevelExport, - 'All Data - Report Level Export': translations.export.reportLevelExport, - 'Basic Export': translations.export.basicExport, + [CONST.REPORT.EXPORT_OPTION_LABELS.EXPENSE_LEVEL_EXPORT]: translations.export.expenseLevelExport, + [CONST.REPORT.EXPORT_OPTION_LABELS.REPORT_LEVEL_EXPORT]: translations.export.reportLevelExport, }; const translatedLabel = labelTranslations[label] || label; return `exportiert nach ${translatedLabel}`; diff --git a/src/languages/en.ts b/src/languages/en.ts index 7f6cdee8bfc1..3735917fdbe0 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -6174,9 +6174,8 @@ const translations = { exportedToIntegration: { automatic: ({label}: ExportedToIntegrationParams) => { const labelTranslations: Record = { - 'All Data - Expense Level Export': translations.export.expenseLevelExport, - 'All Data - Report Level Export': translations.export.reportLevelExport, - 'Basic Export': translations.export.basicExport, + [CONST.REPORT.EXPORT_OPTION_LABELS.EXPENSE_LEVEL_EXPORT]: translations.export.expenseLevelExport, + [CONST.REPORT.EXPORT_OPTION_LABELS.REPORT_LEVEL_EXPORT]: translations.export.reportLevelExport, }; const translatedLabel = labelTranslations[label] || label; return `exported to ${translatedLabel}`; diff --git a/src/languages/es.ts b/src/languages/es.ts index 4651ab32e3d1..059fce02ea26 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -6195,9 +6195,8 @@ const translations = { automatic: ({label}: ExportedToIntegrationParams) => { // The label will always be in English, so we need to translate it const labelTranslations: Record = { - 'All Data - Expense Level Export': translations.export.expenseLevelExport, - 'All Data - Report Level Export': translations.export.reportLevelExport, - 'Basic Export': translations.export.basicExport, + [CONST.REPORT.EXPORT_OPTION_LABELS.EXPENSE_LEVEL_EXPORT]: translations.export.expenseLevelExport, + [CONST.REPORT.EXPORT_OPTION_LABELS.REPORT_LEVEL_EXPORT]: translations.export.reportLevelExport, }; const translatedLabel = labelTranslations[label] || label; return `exportado a ${translatedLabel}`; diff --git a/src/languages/fr.ts b/src/languages/fr.ts index 7da03a6b4834..18d984439fc9 100644 --- a/src/languages/fr.ts +++ b/src/languages/fr.ts @@ -6212,9 +6212,8 @@ const translations = { automatic: ({label}: ExportedToIntegrationParams) => { // The label will always be in English, so we need to translate it const labelTranslations: Record = { - 'All Data - Expense Level Export': translations.export.expenseLevelExport, - 'All Data - Report Level Export': translations.export.reportLevelExport, - 'Basic Export': translations.export.basicExport, + [CONST.REPORT.EXPORT_OPTION_LABELS.EXPENSE_LEVEL_EXPORT]: translations.export.expenseLevelExport, + [CONST.REPORT.EXPORT_OPTION_LABELS.REPORT_LEVEL_EXPORT]: translations.export.reportLevelExport, }; const translatedLabel = labelTranslations[label] || label; return `exporté vers ${translatedLabel}`; diff --git a/src/languages/it.ts b/src/languages/it.ts index fbb9c66673b3..ddd774c7f7cf 100644 --- a/src/languages/it.ts +++ b/src/languages/it.ts @@ -6215,9 +6215,8 @@ const translations = { automatic: ({label}: ExportedToIntegrationParams) => { // The label will always be in English, so we need to translate it const labelTranslations: Record = { - 'All Data - Expense Level Export': translations.export.expenseLevelExport, - 'All Data - Report Level Export': translations.export.reportLevelExport, - 'Basic Export': translations.export.basicExport, + [CONST.REPORT.EXPORT_OPTION_LABELS.EXPENSE_LEVEL_EXPORT]: translations.export.expenseLevelExport, + [CONST.REPORT.EXPORT_OPTION_LABELS.REPORT_LEVEL_EXPORT]: translations.export.reportLevelExport, }; const translatedLabel = labelTranslations[label] || label; return `esportato in ${translatedLabel}`; diff --git a/src/languages/ja.ts b/src/languages/ja.ts index 23cafaa0bf4f..310c78992f7d 100644 --- a/src/languages/ja.ts +++ b/src/languages/ja.ts @@ -6174,9 +6174,8 @@ const translations = { automatic: ({label}: ExportedToIntegrationParams) => { // The label will always be in English, so we need to translate it const labelTranslations: Record = { - 'All Data - Expense Level Export': translations.export.expenseLevelExport, - 'All Data - Report Level Export': translations.export.reportLevelExport, - 'Basic Export': translations.export.basicExport, + [CONST.REPORT.EXPORT_OPTION_LABELS.EXPENSE_LEVEL_EXPORT]: translations.export.expenseLevelExport, + [CONST.REPORT.EXPORT_OPTION_LABELS.REPORT_LEVEL_EXPORT]: translations.export.reportLevelExport, }; const translatedLabel = labelTranslations[label] || label; return `${translatedLabel}にエクスポートされました`; diff --git a/src/languages/nl.ts b/src/languages/nl.ts index 4ca994fa4599..43835c161cc9 100644 --- a/src/languages/nl.ts +++ b/src/languages/nl.ts @@ -6208,9 +6208,8 @@ const translations = { automatic: ({label}: ExportedToIntegrationParams) => { // The label will always be in English, so we need to translate it const labelTranslations: Record = { - 'All Data - Expense Level Export': translations.export.expenseLevelExport, - 'All Data - Report Level Export': translations.export.reportLevelExport, - 'Basic Export': translations.export.basicExport, + [CONST.REPORT.EXPORT_OPTION_LABELS.EXPENSE_LEVEL_EXPORT]: translations.export.expenseLevelExport, + [CONST.REPORT.EXPORT_OPTION_LABELS.REPORT_LEVEL_EXPORT]: translations.export.reportLevelExport, }; const translatedLabel = labelTranslations[label] || label; return `geëxporteerd naar ${translatedLabel}`; diff --git a/src/languages/pl.ts b/src/languages/pl.ts index afb3bcd7476f..a1e22c61f97b 100644 --- a/src/languages/pl.ts +++ b/src/languages/pl.ts @@ -6193,9 +6193,8 @@ const translations = { automatic: ({label}: ExportedToIntegrationParams) => { // The label will always be in English, so we need to translate it const labelTranslations: Record = { - 'All Data - Expense Level Export': translations.export.expenseLevelExport, - 'All Data - Report Level Export': translations.export.reportLevelExport, - 'Basic Export': translations.export.basicExport, + [CONST.REPORT.EXPORT_OPTION_LABELS.EXPENSE_LEVEL_EXPORT]: translations.export.expenseLevelExport, + [CONST.REPORT.EXPORT_OPTION_LABELS.REPORT_LEVEL_EXPORT]: translations.export.reportLevelExport, }; const translatedLabel = labelTranslations[label] || label; return `wyeksportowano do ${translatedLabel}`; diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts index 637aab532cef..06f6dcc16167 100644 --- a/src/languages/pt-BR.ts +++ b/src/languages/pt-BR.ts @@ -6207,9 +6207,8 @@ const translations = { automatic: ({label}: ExportedToIntegrationParams) => { // The label will always be in English, so we need to translate it const labelTranslations: Record = { - 'All Data - Expense Level Export': translations.export.expenseLevelExport, - 'All Data - Report Level Export': translations.export.reportLevelExport, - 'Basic Export': translations.export.basicExport, + [CONST.REPORT.EXPORT_OPTION_LABELS.EXPENSE_LEVEL_EXPORT]: translations.export.expenseLevelExport, + [CONST.REPORT.EXPORT_OPTION_LABELS.REPORT_LEVEL_EXPORT]: translations.export.reportLevelExport, }; const translatedLabel = labelTranslations[label] || label; return `exportado para ${translatedLabel}`; diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts index e8094c855059..771c6aa124b1 100644 --- a/src/languages/zh-hans.ts +++ b/src/languages/zh-hans.ts @@ -6093,9 +6093,8 @@ const translations = { automatic: ({label}: ExportedToIntegrationParams) => { // The label will always be in English, so we need to translate it const labelTranslations: Record = { - 'All Data - Expense Level Export': translations.export.expenseLevelExport, - 'All Data - Report Level Export': translations.export.reportLevelExport, - 'Basic Export': translations.export.basicExport, + [CONST.REPORT.EXPORT_OPTION_LABELS.EXPENSE_LEVEL_EXPORT]: translations.export.expenseLevelExport, + [CONST.REPORT.EXPORT_OPTION_LABELS.REPORT_LEVEL_EXPORT]: translations.export.reportLevelExport, }; const translatedLabel = labelTranslations[label] || label; return `导出到${translatedLabel}`;