feat(): Introduce translation module and preliminary application of them (#14189)
* feat(): Translation first steps * feat(): locale middleware * feat(): readonly links * feat(): feature flag * feat(): modules sdk * feat(): translation module re export * start adding workflows * update typings * update typings * test(): Add integration tests * test(): centralize filters preparation * test(): centralize filters preparation * remove unnecessary importy * fix workflows * Define StoreLocale inside Store Module * Link definition to extend Store with supported_locales * store_locale migration * Add supported_locales handling in Store Module * Tests * Accept supported_locales in Store endpoints * Add locales to js-sdk * Include locale list and default locale in Store Detail section * Initialize local namespace in js-sdk * Add locales route * Make code primary key of locale table to facilitate upserts * Add locales routes * Show locale code as is * Add list translations api route * Batch endpoint * Types * New batchTranslationsWorkflow and various updates to existent ones * Edit default locale UI * WIP * Apply translation agnostically * middleware * Apply translation agnostically * fix Apply translation agnostically * apply translations to product list * Add feature flag * fetch translations by batches of 250 max * fix apply * improve and test util * apply to product list * dont manage translations if no locale * normalize locale * potential todo * Protect translations routes with feature flag * Extract normalize locale util to core/utils * Normalize locale on write * Normalize locale for read * Use feature flag to guard translations UI across the board * Avoid throwing incorrectly when locale_code not present in partial updates * move applyTranslations util * remove old tests * fix util tests * fix(): product end points * cleanup * update lock * remove unused var * cleanup * fix apply locale * missing new dep for test utils * Change entity_type, entity_id to reference, reference_id * Remove comment * Avoid registering translations route if ff not enabled * Prevent registering express handler for disabled route via defineFileConfig * Add tests * Add changeset * Update test * fix integration tests, module and internals * Add locale id plus fixed * Allow to pass array of reference_id * fix unit tests * fix link loading * fix store route * fix sales channel test * fix tests --------- Co-authored-by: Nicolas Gorga <nicogorga11@gmail.com> Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
fea3d4ec49
commit
6dc0b8bed8
83
.eslintrc.js
83
.eslintrc.js
@@ -93,56 +93,57 @@ module.exports = {
|
||||
"./packages/design-system/toolbox/tsconfig.json",
|
||||
|
||||
"./packages/cli/create-medusa-app/tsconfig.json",
|
||||
"./packages/cli/medusa-cli/tsconfig.spec.json",
|
||||
"./packages/cli/oas/medusa-oas-cli/tsconfig.spec.json",
|
||||
"./packages/cli/medusa-cli/tsconfig.json",
|
||||
"./packages/cli/oas/medusa-oas-cli/tsconfig.json",
|
||||
|
||||
"./packages/core/orchestration/tsconfig.json",
|
||||
"./packages/core/workflows-sdk/tsconfig.spec.json",
|
||||
"./packages/core/workflows-sdk/tsconfig.json",
|
||||
"./packages/core/modules-sdk/tsconfig.json",
|
||||
"./packages/core/js-sdk/tsconfig.json",
|
||||
"./packages/core/types/tsconfig.json",
|
||||
"./packages/core/utils/tsconfig.spec.json",
|
||||
"./packages/core/utils/tsconfig.json",
|
||||
"./packages/core/medusa-test-utils/tsconfig.json",
|
||||
|
||||
"./packages/modules/product/tsconfig.json",
|
||||
"./packages/modules/event-bus-local/tsconfig.spec.json",
|
||||
"./packages/modules/event-bus-redis/tsconfig.spec.json",
|
||||
"./packages/modules/cache-redis/tsconfig.spec.json",
|
||||
"./packages/modules/cache-inmemory/tsconfig.spec.json",
|
||||
"./packages/modules/caching/tsconfig.spec.json",
|
||||
"./packages/modules/workflow-engine-redis/tsconfig.spec.json",
|
||||
"./packages/modules/workflow-engine-inmemory/tsconfig.spec.json",
|
||||
"./packages/modules/fulfillment/tsconfig.spec.json",
|
||||
"./packages/modules/api-key/tsconfig.spec.json",
|
||||
"./packages/modules/auth/tsconfig.spec.json",
|
||||
"./packages/modules/cart/tsconfig.spec.json",
|
||||
"./packages/modules/currency/tsconfig.spec.json",
|
||||
"./packages/modules/index/tsconfig.spec.json",
|
||||
"./packages/modules/customer/tsconfig.spec.json",
|
||||
"./packages/modules/file/tsconfig.spec.json",
|
||||
"./packages/modules/inventory-next/tsconfig.spec.json",
|
||||
"./packages/modules/stock-location-next/tsconfig.spec.json",
|
||||
"./packages/modules/order/tsconfig.spec.json",
|
||||
"./packages/modules/payment/tsconfig.spec.json",
|
||||
"./packages/modules/pricing/tsconfig.spec.json",
|
||||
"./packages/modules/promotion/tsconfig.spec.json",
|
||||
"./packages/modules/region/tsconfig.spec.json",
|
||||
"./packages/modules/sales-channel/tsconfig.spec.json",
|
||||
"./packages/modules/store/tsconfig.spec.json",
|
||||
"./packages/modules/tax/tsconfig.spec.json",
|
||||
"./packages/modules/workflow-engine-inmemory/tsconfig.spec.json",
|
||||
"./packages/modules/workflow-engine-redis/tsconfig.spec.json",
|
||||
"./packages/modules/link-modules/tsconfig.spec.json",
|
||||
"./packages/modules/user/tsconfig.spec.json",
|
||||
"./packages/modules/locking/tsconfig.spec.json",
|
||||
"./packages/modules/event-bus-local/tsconfig.json",
|
||||
"./packages/modules/event-bus-redis/tsconfig.json",
|
||||
"./packages/modules/cache-redis/tsconfig.json",
|
||||
"./packages/modules/cache-inmemory/tsconfig.json",
|
||||
"./packages/modules/caching/tsconfig.json",
|
||||
"./packages/modules/workflow-engine-redis/tsconfig.json",
|
||||
"./packages/modules/workflow-engine-inmemory/tsconfig.json",
|
||||
"./packages/modules/fulfillment/tsconfig.json",
|
||||
"./packages/modules/api-key/tsconfig.json",
|
||||
"./packages/modules/auth/tsconfig.json",
|
||||
"./packages/modules/cart/tsconfig.json",
|
||||
"./packages/modules/currency/tsconfig.json",
|
||||
"./packages/modules/index/tsconfig.json",
|
||||
"./packages/modules/customer/tsconfig.json",
|
||||
"./packages/modules/file/tsconfig.json",
|
||||
"./packages/modules/inventory-next/tsconfig.json",
|
||||
"./packages/modules/stock-location-next/tsconfig.json",
|
||||
"./packages/modules/order/tsconfig.json",
|
||||
"./packages/modules/payment/tsconfig.json",
|
||||
"./packages/modules/pricing/tsconfig.json",
|
||||
"./packages/modules/promotion/tsconfig.json",
|
||||
"./packages/modules/region/tsconfig.json",
|
||||
"./packages/modules/sales-channel/tsconfig.json",
|
||||
"./packages/modules/store/tsconfig.json",
|
||||
"./packages/modules/tax/tsconfig.json",
|
||||
"./packages/modules/workflow-engine-inmemory/tsconfig.json",
|
||||
"./packages/modules/workflow-engine-redis/tsconfig.json",
|
||||
"./packages/modules/link-modules/tsconfig.json",
|
||||
"./packages/modules/user/tsconfig.json",
|
||||
"./packages/modules/locking/tsconfig.json",
|
||||
"./packages/modules/translation/tsconfig.json",
|
||||
|
||||
"./packages/modules/providers/file-local/tsconfig.spec.json",
|
||||
"./packages/modules/providers/file-s3/tsconfig.spec.json",
|
||||
"./packages/modules/providers/fulfillment-manual/tsconfig.spec.json",
|
||||
"./packages/modules/providers/payment-stripe/tsconfig.spec.json",
|
||||
"./packages/modules/providers/locking-postgres/tsconfig.spec.json",
|
||||
"./packages/modules/providers/locking-redis/tsconfig.spec.json",
|
||||
"./packages/modules/providers/caching-redis/tsconfig.spec.json",
|
||||
"./packages/modules/providers/file-local/tsconfig.json",
|
||||
"./packages/modules/providers/file-s3/tsconfig.json",
|
||||
"./packages/modules/providers/fulfillment-manual/tsconfig.json",
|
||||
"./packages/modules/providers/payment-stripe/tsconfig.json",
|
||||
"./packages/modules/providers/locking-postgres/tsconfig.json",
|
||||
"./packages/modules/providers/locking-redis/tsconfig.json",
|
||||
"./packages/modules/providers/caching-redis/tsconfig.json",
|
||||
|
||||
"./packages/framework/tsconfig.json",
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user