Repository navigation
Rename "Download as PDF" to "Download report" with singular/plural support - #101181
twisterdotcom merged 3 commits into
Conversation
|
Hey, I noticed you changed If you want to automatically generate translations for other locales, an Expensify employee will have to:
Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running: npx bun ./scripts/generateTranslations.ts --helpTypically, you'd want to translate only what you changed by running |
Concierge reviewer checklist:
For more detailed instructions on completing this checklist, see How do I review a HelpDot PR as a Concierge Team member? |
|
@abdulrahuman5196 @mollfpr @twisterdotcom One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
🦜 Polyglot Parrot! 🦜Squawk! Looks like you added some shiny new English strings. Allow me to parrot them back to you in other tongues: View the translation diffdiff --git a/src/languages/fr.ts b/src/languages/fr.ts
index 61d320d1..cd69676e 100644
--- a/src/languages/fr.ts
+++ b/src/languages/fr.ts
@@ -418,7 +418,7 @@ const translations: TranslationDeepObject<typeof en> = {
validate: 'Valider',
downloadReport: () => ({
one: 'Télécharger la note de frais',
- other: 'Télécharger les notes de frais',
+ other: 'Télécharger des notes de frais',
}),
downloadReceipt: () => ({
one: 'Télécharger le reçu',
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index b20e5712..3a2ac909 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -420,7 +420,7 @@ const translations: TranslationDeepObject<typeof en> = {
other: 'レポートをダウンロード',
}),
downloadReceipt: () => ({
- one: '領収書をダウンロード',
+ one: 'レシートをダウンロード',
other: '領収書をダウンロード',
}),
downloadAsCSV: 'CSVとしてダウンロード',
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index 97f58697..5ae9030a 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -420,8 +420,8 @@ const translations: TranslationDeepObject<typeof en> = {
other: 'Rapporten downloaden',
}),
downloadReceipt: () => ({
- one: 'Bonnetje downloaden',
- other: 'Bonnetjes downloaden',
+ one: 'Bon downloaden',
+ other: 'Bonnen downloaden',
}),
downloadAsCSV: 'Downloaden als CSV',
submitViaPDF: 'Indienen via pdf',
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index 2c838895..d4652501 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -421,14 +421,10 @@ const translations: TranslationDeepObject<typeof en> = {
validate: 'Zatwierdź',
downloadReport: () => ({
one: 'Pobierz raport',
- few: 'Pobierz raporty',
- many: 'Pobierz raporty',
other: 'Pobierz raporty',
}),
downloadReceipt: () => ({
one: 'Pobierz paragon',
- few: 'Pobierz paragony',
- many: 'Pobierz paragony',
other: 'Pobierz paragony',
}),
downloadAsCSV: 'Pobierz jako CSV',
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index d048e877..fa4cc245 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -417,7 +417,7 @@ const translations: TranslationDeepObject<typeof en> = {
validate: '验证',
downloadReport: () => ({
one: '下载报表',
- other: '下载报表',
+ other: '下载报告',
}),
downloadReceipt: () => ({
one: '下载收据',
Note You can apply these changes to your branch by copying the patch to your clipboard, then running |
HelpDot Documentation ReviewOverall AssessmentThis PR updates three help articles to align documentation with a product UI change: the button label formerly shown as Download as PDF is now Download report (singular) or Download reports (plural), matching the new pluralized translation keys added in the code. All documentation edits are targeted UI-label replacements. No structural, heading, metadata, or workflow changes were introduced. The changes correctly follow the Core UI Referencing Rule of using the exact text shown in the product UI. Scores Summary
Key Findings
Recommendations
Files Reviewed
Note: Detailed line-by-line feedback has been provided as inline comments. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
|
🚧 twisterdotcom has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/twisterdotcom in version: 9.4.81-0 🚀
|
|
Yes — help site changes are required. Draft PR: Docs updates for E/A#101181 name singular Download receipt label This PR renamed two labels, but only documented one. Already handled here — Missed — The singular really does surface, at all three call sites:
The docs PR names both forms wherever the action appears and states the rule that picks one, across 12 spots in two articles:
Verification and one thing I could not finishLabels. Checked against Guidelines applied. Both new Not done: GitHub refused to assign you to the docs PR — @ahmdshrif, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR |
|
🚀 Deployed to production by https://github.com/luacmartins in version: 9.4.81-1 🚀
|
1 similar comment
|
🚀 Deployed to production by https://github.com/luacmartins in version: 9.4.81-1 🚀
|
Explanation of Change
The PDF download action read "Download as PDF" everywhere. Per the naming spec it must read "Download report" on the individual report page (always one report) and, on the Reports page bulk-action menu, "Download report" for one selected report and "Download reports" for more than one.
Both call sites used
common.downloadAsPDF, a plain string leaf, so there was nowhere for a count to enter. A label can only vary by count when the English entry is a function returning aPluralForm, whichtranslate(key, {count})resolves.This PR:
common.downloadAsPDFwith a single plural keycommon.downloadReport(one: 'Download report',other: 'Download reports'), in the same shape as the existingsearch.bulkActions.duplicateReport. A single plural key (rather than two flat keys picked with a ternary) lets each locale supply the plural categories it needs, e.g.pl.tsgetsone/few/many/otherexactly likeduplicateReportalready does.src/hooks/useExportActions.ts: theDOWNLOAD_PDFsecondary action now usestranslate('common.downloadReport', {count: 1}), since the report page only ever acts on one report.src/hooks/useSearchBulkActions.ts: theDOWNLOAD_PDFbulk option now usestranslate('common.downloadReport', {count: selectedReportIDs.length}), the same valueonSelectedalready branches on to pick the single- vs multi-report export, so the label and the behaviour cannot drift.TranslationDeepObject<typeof en>requires every English key in every locale, and thegenerateTranslationsworkflow does not run for fork PRs, so the translations are provided here (each mirrors the locale's owndownloadReceiptsverb andduplicateReportnoun). This is the one departure from the proposal, which assumeden.tsalone would be enough. The generated translations from the Polyglot Parrot run have since been applied on top.common.downloadReceiptsbecomes the plural keycommon.downloadReceipt(one: 'Download receipt',other: 'Download receipts'). The count is the number of receipts the action will export: on the report page the number of report expenses that carry a receipt (the same set that gates the action), on the Reports page the number of receipt-bearing expenses across the selected reports, and on the Expenses page the number of selected expenses with a receipt.common.downloadAsPDFandcommon.downloadReceiptshave no other consumers, so they are removed. TheDOWNLOAD_PDF/DOWNLOAD_RECEIPTSconstants, visibility gates and everyonSelectedpath are untouched. The Expensify Card statement action keeps its ownsearch.expensifyCardStatementPDF.title.tests/unit/hooks/useExportActionsTest.tsasserts the report page asks for the singular "Download report" and that "Download receipt(s)" follows the number of receipts on the report;tests/unit/hooks/useSearchBulkActionsDownloadPDFTest.tsasserts the singular form for one selected report and the plural form for two;tests/unit/hooks/useSearchBulkActionsDownloadReceiptsTest.tsasserts the receipts label counts receipts (not reports) on the Reports page and expenses with receipts on the Expenses page. All of them fail against the previous call sites.How-to-Export-Reports.md,Search-and-Download-Expenses.mdandExpense-and-Report-Actions.mdare updated so the steps and FAQ name Download report / Download reports instead of the removed "Download as PDF".Fixed Issues
$ #101055
PROPOSAL: #101055 (comment)
Tests
Offline tests
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Notes on the checklist above:
.nativevariant, andSearchBulkActionsButtonpasses the same options array to the narrow and wide renderers.Screenshots/Videos
Android: Native
android-native-101055.mp4
Android: mWeb Chrome
android-mweb-101055.mp4
iOS: Native
ios-native-101055.mp4
iOS: mWeb Safari
ios-mweb-101055.mp4
MacOS: Chrome / Safari
web-101055.mp4