Skip to content

Commit e487761

Browse files
authored
feat(): sync cart translation synced (medusajs#14226)
ref: medusajs#14189 **Summary** This PR extends the translation module to support automatic translation syncing for cart line items based on the cart's locale. Key changes: - Added locale field to the Cart model to store the cart's locale preference - Created new workflow steps: - getTranslatedLineItemsStep - Translates line items when adding to cart or creating a cart - updateCartItemsTranslationsStep - Re-translates all cart items when the cart's locale changes - Integrated translation logic into cart workflows: - createCartWorkflow - Applies translations to initial line items - addToCartWorkflow - Applies translations when adding new items - updateCartWorkflow - Re-translates all items when locale_code is updated - refreshCartItemsWorkflow - Maintains translations during cart refresh - Added applyTranslationsToItems utility to map variant/product/type/collection translations to line item fields (title, subtitle, description, etc.)
1 parent 356283c commit e487761

File tree

31 files changed

+2641
-1480
lines changed

31 files changed

+2641
-1480
lines changed

.changeset/dull-trains-shave.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
"@medusajs/medusa": patch
3+
"@medusajs/test-utils": patch
4+
"@medusajs/cart": patch
5+
"@medusajs/core-flows": patch
6+
"@medusajs/types": patch
7+
---
8+
9+
feat(): sync cart translation synced

0 commit comments

Comments
 (0)