Skip to content

[$175] Deprecate Localize.translateLocal #64943

Open

Description

@roryabraham

I'm plagiarizing Tim G's proposal here, because this is essentially an analog of the same problem.

Problem

When a UI view calls a method that uses Localize.translateLocal (i.e: an impure function), the UI view will become out-of-date because it was not re-rendered when the preferredLocale changed.

Solution

Deprecate Localize.translateLocal.

Spreadsheet with the remaining items https://expensify.slack.com/archives/C05LX9D6E07/p1767074466145849?thread_ts=1767052675.446179&cid=C05LX9D6E07

Issue OwnerCurrent Issue Owner: @parasharrajat
Upwork Automation - Do Not Edit

Activity

  1. roryabraham commented on Jul 8, 2025

    @roryabraham
    ContributorAuthor

    Looks like @shubham1206agra got started a couple weeks ago

  2. shubham1206agra commented on Jul 9, 2025

    @shubham1206agra
    Contributor

    @roryabraham I need to write a design doc before kicking this issue off.

  3. roryabraham commented on Jul 22, 2025

    @roryabraham
    ContributorAuthor

    no update

  4. roryabraham commented on Aug 11, 2025

    @roryabraham
    ContributorAuthor

    Going to put this on HOLD for #66329

  5. changed the title [-]Deprecate Localize.translateLocal[/-] [+][HOLD #66329] Deprecate Localize.translateLocal[/+] on Aug 11, 2025
  6. 430 remaining items

  7. parasharrajat commented on Nov 1, 2026

    @parasharrajat
    Member

    @MelvinBot Close the upwork job. It is not needed.

  8. MelvinBot commented on Nov 1, 2026

    @MelvinBot
    Contributor

    🤖 I couldn't close the Upwork job because I don't have access to Upwork. I can only work with GitHub.

    An Expensify team member with Upwork access needs to close it there: https://www.upwork.com/jobs/~022116931309428775204

    This issue is labeled Skip Payment and the work here is review-only, so no Upwork offer is needed.

  9. melvin-bot commented on Nov 13, 2026

    @melvin-bot

    @parasharrajat / @shubham1206agra

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.5.37-1 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

  10. parasharrajat commented on Nov 14, 2026

    @parasharrajat
    Member

    @MelvinBot We need to refactor getUpdatedTransaction function to pass the translate function down as a parameter directly instead of using translateLocal.

    • Assign me for review only.

    Here is the plan:

    Create 3 PRs as follows:

    • First PR, updates only all callers of getUpdateTrackExpenseParams function which use getUpdatedTransaction.
    • Second PR, updates only all callers of getUpdateMoneyRequestParams function which use getUpdatedTransaction.
    • Third PR, updates only all callers of setDraftSplitTransaction function which use getUpdatedTransaction in the split module as well as updateMultipleMoneyRequests in BulkEdit module.

    Give me an action plan here and wait for approval before implementation.

  11. MelvinBot commented on Nov 14, 2026

    @MelvinBot
    Contributor

    Action plan

    Create three sequential PRs, keeping each buildable and limiting caller migration to your requested groups.

    PR 1 — Track-expense updates

    • Add a typed translate parameter to getUpdatedTransaction, including its distance-merchant helper.
    • Thread translate through getUpdateTrackExpenseParams and all upstream callers: track-expense editing, inline edits, amount submission, and transaction merging.
    • Temporarily retain a translateLocal default only at the shared function boundary, allowing the other groups to remain unchanged.

    PR 2 — Money-request updates

    PR 3 — Split drafts and bulk edits

    Validation and review

    • Each PR: update affected tests, run targeted Jest suites and required static checks, and verify affected flows on web.
    • Add injected-translator assertions for pending fields and recalculated distance merchants, preserving existing transaction behavior.
    • Request parasharrajat as reviewer only, not as assignee or contributor.

    No code changes or PRs have been made. Approval is required before implementation, including the temporary fallback strategy.


    view run

  12. parasharrajat commented on Nov 14, 2026

    @parasharrajat
    Member

    @MelvinBot Let's add another PR which takes care of updating updateSplitTransactions path as well updateMultipleMoneyRequests from BulkEdit module. Remove these updates from PR 2 and PR 3.

    Give me an updated plan.

  13. MelvinBot commented on Nov 14, 2026

    @MelvinBot
    Contributor

    Updated plan — four sequential PRs

    PR 1 — Track-expense updates

    • Add a typed translate parameter to getUpdatedTransaction, including its distance-merchant helper.
    • Thread it through getUpdateTrackExpenseParams and its upstream caller chains.
    • Retain a temporary translateLocal default at the shared boundary for unmigrated callers.

    PR 2 — Money-request updates

    • Thread translate through getUpdateMoneyRequestParams and its upstream callers, excluding updateSplitTransactions.
    • Cover reported-expense editing, category/tag/tax hooks, inline edits, and merging.
    • Temporarily allow the builder’s translate parameter to be omitted so the deferred split-update path remains buildable.

    PR 3 — Split drafts only

    • Thread translate through setDraftSplitTransaction and every upstream caller.
    • Exclude bulk edits and existing-split updates.

    PR 4 — Existing-split updates, bulk edits, and final cleanup

    For each PR: update affected tests, run targeted Jest suites and required static checks, and verify affected flows on web. Request parasharrajat as reviewer only, not assignee or contributor.

    No implementation changes made. This revised plan remains subject to approval.


    view run

  14. parasharrajat commented on Nov 14, 2026

    @parasharrajat
    Member

    @MelvinBot Plan looks good. let's implement #64943 (comment)

  15. MelvinBot commented on Nov 14, 2026

    @MelvinBot
    Contributor

    Partially completed—the run reached its execution limit.

    Created draft Pass translate through track-expense updates (1 of 4).

    • parasharrajat is requested as reviewer, with no PR assignee.
    • Typecheck, lint, spelling, Storybook smoke, and 696 targeted tests passed.
    • Web verification was blocked by a blank app page. Full Jest timed out; React Compiler verification was blocked by base-reference resolution.

    Remaining

    • PR 2: initial local changes only; caller migration and validation are unfinished.
    • PRs 3–4: not implemented or created.
    • Temporary translation defaults remain, as planned.

    Review-only caveat: the commit hook automatically added a co-author trailer for parasharrajat, despite the requested review-only role.

    Next step: finish and validate PR 2, then implement PRs 3–4, retaining the approved scope boundaries. Resolve the attribution and web-testing limitations before marking the drafts ready for review.


    view run · no recording available

  16. parasharrajat commented on Nov 14, 2026

    @parasharrajat
    Member

    @MelvinBot, continue with creating PR 2.

  17. MelvinBot commented on Nov 14, 2026

    @MelvinBot
    Contributor

    🤖 Web test steps verification results: ❌ fail

    Web verification was blocked by a blank dev app page—not a confirmed PR regression. Created draft Pass translate through money-request updates (2 of 4), stacked on PR 1.

    Blank app page blocking expense verification

    Step Status
    Edit reported-expense category/tag/taxBlocked: no rendered controls.
    Blank app page blocking expense verification
    ❌
    Verify distance merchant and language changesBlocked by the same blank page; behavior remains unverified.
    ❌

    Passed: 167 targeted tests, typecheck, lint, spelling, explicit React Compiler checks, and Storybook smoke. Full Jest timed out; changed-file compiler checking remains blocked by base-reference resolution.

    parasharrajat is requested as reviewer, with no assignee. The commit hook still automatically adds co-authorship. Split drafts, existing-split updates, and bulk edits remain excluded.


    view run · no recording available

  18. parasharrajat commented on Nov 14, 2026

    @parasharrajat
    Member

    @MelvinBot Create the PR 3 and PR 4.

  19. MelvinBot commented on Nov 14, 2026

    @MelvinBot
    Contributor

    🤖 Web test steps verification results: ❌ fail

    Created draft PR 3 — Split-draft updates and PR 4 — Existing-split updates, bulk edits, and cleanup, stacked in order. Browser verification was blocked by a blank dev app—not a confirmed regression.

    Blank app page preventing all requested expense tests

    Step Status
    Edit split-draft fieldsBlocked: zero UI nodes.
    Browser state blocking split-draft testing
    ❌
    Verify localized distance split draftNot tested due to the environment blocker.
    ❌
    Edit and save existing splitsBlocked: blank app.
    Blank app page preventing all requested expense tests
    ❌
    Delete a split and verify remaining splitsNot executed.
    ❌
    Bulk edit, including after changing languageNot executed.
    ❌

    Passed: 902 targeted tests across 13 suites, typecheck, lint, spelling, explicit compiler checks, and Storybook smoke. Full Jest timed out; changed-file compiler checking remains blocked.

    PR 4 removes the temporary translation fallback. Both PRs request parasharrajat as reviewer with no assignee; automatic commit co-authorship remains.


    view run · no recording available

  20. expensify-chore-bot commented on Nov 17, 2026

    @expensify-chore-bot

    @parasharrajat Whoops! This issue is 2 days overdue. Let's get this updated quick!

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

Metadata

Metadata

Labels

DailyKSv2ImprovementItem broken or needs improvement.OverdueSkip PaymentSkips all the payment process steps for an issue. Use it for fixed-price projects.

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions