Skip to content

remove unneccesary custom types from translations batch15 - #96605

Merged
iwiznia merged 11 commits into
Expensify:mainfrom
software-mansion-labs:jakubstec/remove-unneccesary-custom-types-from-translations-batch15_at2
Aug 6, 2026
Merged

iwiznia merged 11 commits into
Expensify:mainfrom
software-mansion-labs:jakubstec/remove-unneccesary-custom-types-from-translations-batch15_at2

Conversation

@jakubstec

@jakubstec jakubstec commented Jul 21, 2026 •

Copy link
Copy Markdown
Member

Explanation of Change

Continue the work of removing unnecessary custom types from translations. Last PR:
#84399.
This is the last batch.

Fixed Issues

$ #76429

PROPOSAL: #76429 (comment)

Tests

Testing every modified component is not necessary since the changes are all related to types only, and TypeScript already checks types and enforces correct parameter usage.

Below is an example place where the changes can be observed in the UI.

1.

  1. Open Account -> Profile
  2. Click on Edit photo icon
    3.1 Upload small resolution photo (below 80x80) and verify that error message is visible correctly.
    3.2 Upload wrong format image (e.g webp) and verify that error message is visible correctly.

2.

  1. Open a workspace where you are admin.
  2. Go to Members
  3. Click on a member who has Member role.
  4. Change their role to Admin.
  5. Go to an admin workspace chat and verify, that the message is visible correctly (to "workspace admin (previously member)", not “to member (previously workspace admin)”)
  • Verify that no errors appear in the JS console

Offline tests

N/A

QA Steps

Same as tests.

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
      • If any non-english text was added/modified, I used JaimeGPT to get English > Spanish translation. I then posted it in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

MacOS: Chrome / Safari
Screen.Recording.2026-07-21.at.12.46.11.mov
Screen.Recording.2026-07-21.at.12.54.30.mov

@jakubstec
jakubstec requested review from a team as code owners July 21, 2026 09:04
@melvin-bot

melvin-bot Bot commented Jul 21, 2026

Copy link
Copy Markdown

Hey, I noticed you changed src/languages/en.ts in a PR from a fork. For security reasons, translations are not generated automatically for PRs from forks.

If you want to automatically generate translations for other locales, an Expensify employee will have to:

  1. Look at the code and make sure there are no malicious changes.
  2. Run the Generate static translations GitHub workflow. If you have write access and the K2 extension, you can simply click: [this button]

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 ts-node ./scripts/generateTranslations.ts --help

Typically, you'd want to translate only what you changed by running npx ts-node ./scripts/generateTranslations.ts --compare-ref main

@melvin-bot
melvin-bot Bot requested review from trjExpensify and removed request for a team July 21, 2026 09:04
@jakubstec
jakubstec marked this pull request as draft July 21, 2026 09:04
@melvin-bot
melvin-bot Bot requested review from mjasikowski and removed request for a team July 21, 2026 09:04
@melvin-bot

melvin-bot Bot commented Jul 21, 2026

Copy link
Copy Markdown

@mjasikowski Please 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]

@jakubstec

jakubstec commented Jul 21, 2026 •

Copy link
Copy Markdown
Member Author

please don't review yet, pr was created automatically being open and it has triggered the review, sorry!

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 78e7d53c9f

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/languages/en.ts Outdated
Comment thread src/libs/OptionsListUtils/index.ts
Comment thread src/pages/settings/Agents/Fields/EditAgentAvatarPage.tsx Outdated
Comment thread src/pages/settings/Profile/Avatar/AvatarPreview.tsx Outdated
@codecov

codecov Bot commented Jul 21, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ Changes either increased or maintained existing code coverage, great job!

Files with missing lines Coverage Δ
src/components/AccountSwitcher.tsx 80.39% <ø> (ø)
src/components/AvatarPageFooter.tsx 0.00% <ø> (ø)
src/components/HeaderWithBackButton/index.tsx 89.32% <100.00%> (+0.10%) ⬆️
src/components/InteractiveStepSubHeader.tsx 6.66% <ø> (ø)
src/components/InteractiveStepSubPageHeader.tsx 88.00% <ø> (ø)
src/components/ParentNavigationSubtitle.tsx 66.30% <ø> (ø)
src/hooks/useExportActions.ts 59.52% <ø> (ø)
src/hooks/useExportAgainModal.ts 0.00% <ø> (ø)
src/hooks/useLifecycleActions.tsx 57.35% <100.00%> (ø)
src/hooks/useSearchBulkActions.ts 55.75% <ø> (ø)
... and 60 more
... and 18 files with indirect coverage changes

@jakubstec

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 060e66f8c4

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/languages/en.ts Outdated
description: "Choose a plan that's right for you.",
subscriptionLink: 'Learn more',
lockedPlanDescription: ({count, annualSubscriptionEndDate}: WorkspaceLockedPlanTypeParams) => ({
lockedPlanDescription: ({count}: {count: number}, annualSubscriptionEndDate: string) => ({

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

object type left here on purpose, lockedPlanDescription returns PluralForm which requires an object with count as first param.

Comment thread src/libs/ReportActionsUtils.ts Outdated
Comment thread src/components/AvatarWithImagePicker.tsx Outdated
Comment thread src/components/HeaderWithBackButton/index.tsx Outdated
@sumo-slonik

Copy link
Copy Markdown
Contributor

I left a few NAB, but overall it looks good to me. LGTM 🚀

@jakubstec
jakubstec marked this pull request as ready for review July 22, 2026 10:24
@jakubstec

Copy link
Copy Markdown
Member Author

opened for review. previous batches were reviewed by @QichenZhu, so I think we could reassign him here! 😁

@trjExpensify

Copy link
Copy Markdown
Contributor

PR doesn’t need product input as a refactor PR. Unassigning and unsubscribing myself.

@jakubstec

Copy link
Copy Markdown
Member Author

done! @QichenZhu

@melvin-bot
melvin-bot Bot requested a review from iwiznia August 3, 2026 13:45
Comment thread src/components/ArchivedReportFooter.tsx Outdated
const oldDisplayNameHtml = `<strong>${oldDisplayName}</strong>`;
const policyNameHtml = `<strong>${policyName}</strong>`;
const shouldUseYou = actorPersonalDetails?.accountID === currentUserAccountID;
switch (archiveReason) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see this one and another above that we are replacing the single line version with a switch, which is more verbose and less flexible (as we need to add a case for every new version).
Could we keep the non switch version if we made the params be an object (that does not require a type, but instead we document each type separately using string, number, etc)?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, we can make an exception for that, look's much simpler. Then I'll refactor other cases of translations like this (probably just a few)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, @QichenZhu could you take a look at 45e285b? Thanks!

Comment thread src/languages/es.ts Outdated
Comment thread src/components/AvatarPageFooter.tsx
@melvin-bot
melvin-bot Bot requested a review from iwiznia August 5, 2026 13:43
@QichenZhu

Copy link
Copy Markdown
Contributor

@jakubstec there is a new Greek translation now, so we need to merge our changes or regenerate it.

iwiznia
iwiznia previously approved these changes Aug 5, 2026
@iwiznia

iwiznia commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

CI failed @jakubstec

…neccesary-custom-types-from-translations-batch15_at2
…main)

The previous merge from upstream/main kept the stale Mobile-Expensify
pointer (3d7ad2f66b) instead of upstream's newer commit (bf3a9782bd).
@jakubstec

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: cd3209635c

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@jakubstec

Copy link
Copy Markdown
Member Author

ready! cc @iwiznia

@iwiznia iwiznia closed this Aug 6, 2026
@iwiznia iwiznia reopened this Aug 6, 2026
@iwiznia
iwiznia merged commit 5581744 into Expensify:main Aug 6, 2026
40 of 44 checks passed
@iwiznia

iwiznia commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

GH actions are stuck and I manually checked that the reviewer checklist is done and that I reviewed the code and did not push to this branch (not an emergency in case the bot asks)

@melvin-bot melvin-bot Bot added the Emergency label Aug 6, 2026
@melvin-bot

melvin-bot Bot commented Aug 6, 2026

Copy link
Copy Markdown

@iwiznia looks like this was merged without a test passing. Please add a note explaining why this was done and remove the Emergency label if this is not an emergency.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/iwiznia in version: 9.4.52-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 cancelled 🔪

@MelvinBot

Copy link
Copy Markdown
Contributor

Help site review — no changes required 🟢

I reviewed the changes in this PR against Expensify's help site content under docs/articles, and no help site updates are required.

Why: This PR is a purely internal TypeScript refactor — the last batch of "remove unnecessary custom types from translations." It changes how translation helpers receive their arguments (from object params like {step, total} to positional params like step, total) and drops the now-unused custom *Params types. The rendered copy in every src/languages/*.ts file is byte-for-byte the same; only the function signatures and type annotations changed.

Scope check:

  • All changed files are .ts/.tsx (components, hooks, pages, src/languages/*, and tests). No files under docs/articles are touched.
  • No new or renamed user-facing feature, tab, settings label, or button.
  • No product copy, flow, or behavior change that a help article would document.

Since the help site documents user-facing product behavior — not internal translation types — there's nothing to add or update, so I have not created a draft docs PR.

@jakubstec, since this refactor introduces no user-facing behavior change, there's no linked help site PR to review — no documentation update is warranted here. If you believe a specific article is affected, reply with the article and what changed and I'll take another look.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/roryabraham in version: 9.4.52-11 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants