Skip to content

[B2B-3799] Fix inconsistent translations across buyer portal#883

Draft
bc-gary wants to merge 8 commits into
mainfrom
b2b-3799-fix-translation-inconsistencies
Draft

[B2B-3799] Fix inconsistent translations across buyer portal#883
bc-gary wants to merge 8 commits into
mainfrom
b2b-3799-fix-translation-inconsistencies

Conversation

@bc-gary

@bc-gary bc-gary commented May 18, 2026

Copy link
Copy Markdown
Contributor

Jira: B2B-3799

What/Why?

Merchant custom translations uploaded via CSV were not being applied consistently
across the Buyer Portal. Several root causes were identified:

1. Kebab-case URL routes don't match camelCase translation key prefixes

The translation system extracts the page name from the URL path (location.pathname.split('/')).
Routes like /purchased-products and /user-management produce kebab-case names, but
the translation API and en.json keys use camelCase (purchasedProducts, userManagement).
Custom translations for these pages were silently ignored.

Adds REPEATED_PAGES mappings for purchased-products → purchasedProducts and
user-management → userManagement.

2. Cross-page shared components miss translations from other pages

Components on the Shopping List Detail page use purchasedProducts.quickAdd.* keys
(SKU, Qty labels). The Quote Draft and Quote Detail pages use
purchasedProducts.quickOrderPad.* keys (min/max quantity messages).

Extends TRANSLATION_DEPENDENCIES so these pages also fetch purchasedProducts
translations when visited.

3. Bulk upload cancel button was hardcoded

B3Upload.tsx passed leftSizeBtn="cancel" to B3Dialog, which rendered the literal
string "cancel" instead of calling b3Lang('global.dialog.cancel'). Removes the prop
so the dialog falls back to the translated value.

4. Bulk upload modal had 13 hardcoded English strings

Strings like "Upload file", "Download sample", "Drag & drop file here", column headers
("SKU", "Qty", "Row", "Error"), tab labels ("Errors", "Valid"), "Remove", "Products per
page:", and "No product" were never wired through the translation system.

Adds global.B3Upload.* and global.bulkUpload.* keys to en.json and wires all
strings through b3Lang().

Rollout/Rollback

  • Rollout: Standard merge to main. No feature flags — all changes are additive
    (fetch translations that were missing, wire strings that were hardcoded). Only affects
    stores with custom translations configured in the B2B Dashboard.
  • Rollback: Revert the commit. No data migrations or side effects.

Testing

  • TypeScript compiles cleanly (tsc --noEmit)
  • No new lint errors
  • Screenshots/videos to be attached.

bc-gary added 5 commits May 14, 2026 15:26
…ed components

Shared quote components (QuoteInfo, ContactInfo, QuoteAddress, etc.)
use quoteDraft.* translation keys but are also rendered on the
quoteDetail page. Since translations are fetched per page, merchant
custom translations for these keys were never loaded on quoteDetail.

Add PAGE_DEPENDENCIES map so visiting a page also fetches translations
for pages whose components are shared on that page.
… portal

Multiple translation issues causing merchant custom translations to not
display or display inconsistently:

1. Kebab-case URL routes (purchased-products, user-management) did not
   match camelCase translation key prefixes. Add REPEATED_PAGES mappings.

2. Cross-page shared components use translation keys from other pages.
   Add TRANSLATION_DEPENDENCIES so shoppingList, quoteDraft and
   quoteDetail pages also fetch purchasedProducts translations.

3. Bulk upload cancel button had a hardcoded "cancel" string bypassing
   the translation system. Remove the prop so B3Dialog uses b3Lang().

4. Bulk upload modal had 13 hardcoded English strings never wired to
   the translation system. Add global.B3Upload.* and global.bulkUpload.*
   keys to en.json and wire all strings through b3Lang().
@bc-gary bc-gary self-assigned this May 18, 2026
bc-gary added 3 commits May 19, 2026 07:05
…k add

- Add global.B3Upload.title key and wire default dialog title through
  b3Lang() so 'Bulk upload' is translatable.

- Add shoppingList as a dependency of quoteDraft and quoteDetail so
  the QuickAdd component's shoppingList.quickAdd.* keys (Quick add,
  Show more rows) load on quote pages.
… translations

- Wire hardcoded 'No products found' in both ProductListDialog files
  through b3Lang() with new global.searchProduct.noProductsFound key.

- Add shoppingLists (plural) as a translation dependency for pages
  that render ProductListDialog with its shoppingLists.close key:
  purchasedProducts, quoteDraft, quoteDetail.
Base automatically changed from b2b-3766-fix-page-translation-deps to main May 18, 2026 23:56
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.

1 participant