github medusajs/medusa v2.12.4
v2.12.4: Improved Translations

latest releases: v2.12.5, @medusajs/workflows-sdk@2.12.5, @medusajs/workflow-engine-redis@2.12.5...
4 days ago

Highlights

New Translations features

This release expands the capabilities of Translations. Note that Translations is still an experimental feature. Refer to our documentation on how to get started.

New translatable core data models

We have extended the set of core translatable data models to include:

  • Shipping Option
  • Region
  • Customer Group
  • Shipping Option Type

If you need additional core data models to be translatable, please feel free to open an issue and we will address it as soon as possible.

Support for custom data models

We have added support for translating data models from custom modules. These can be specified in the module options of the @medusajs/translation module, as shown below:

module.exports = defineConfig({
  projectConfig: { ... },
  modules: [
    {
      resolve: "@medusajs/translation",
      options: {
        entities: [{ type: "post", fields: ["title"] }],
      },
    },
  ],
  featureFlags: {
    translation: true,
  },
})

The API is still under development and may change in a future release.

When custom data models are specified in the module options, they are automatically detected and will allow merchants to add translations from the admin dashboard without any additional setup.

Fetching the localized version of your data is easily done with query.graph:

const { data } = query.graph(
  {
    entity: "post",
    fields: ["title"]
  },
  {
    locale: "de-DE"
  }
)

Simply pass the locale option and Medusa will take care of the rest under the hood.

Generate types during build

This release improves our build-tooling to generate types in .medusa/types/ during the build. This ensures that types used during development will not cause the production build to fail.

Resolved risk of critical data loss

This release solves an issue with order-deletion, that could lead to critical data loss. See PR here. The issue was reported by @mo6zes and solved shortly after. We will publish an advisory describing the details soon.

Although, the data loss could only happen under rare circumstances, we advise upgrading to the latest version as soon as possible.

Features

  • feat(): Auto generated types generation upon build by @adrien2p in #14337
  • feat(): Translation settings + user configuration + admin hook and js sdk + dashboard by @adrien2p in #14355
  • feat(dashboard): Add first and last name inputs to update order shipping and billing address forms by @NicolasGorga in #14394
  • feat(translation,core-flows): translate remaining core entities and sync shipping option <> method translations by @NicolasGorga in #14358
  • feat(core-flows,utils): Shipping options workflow events emission by @NicolasGorga in #14388
  • feat(dashboard,draft-order): Remove hardcoded strings and replace with translations in draft orders list page by @NicolasGorga in #14400
  • feat(medusa,utils,core-flows): add reset password metdata by @riqwan in #14417
  • feat(translation): Update wording in translation list for translation… by @adrien2p in #14453
  • feat(translation): Order translastable entities ordered alphabetically by @adrien2p in #14451
  • feat(translation): Add support for locale to the graph query by @adrien2p in #14454
  • feat(translation): Improve translation alert in empty languages state by @adrien2p in #14464

Bugs

Documentation

Chores

  • chore(docs): Updated UI Reference (automated) by @github-actions[bot] in #14336
  • chore(docs): Update version in documentation (automated) by @github-actions[bot] in #14334
  • chore(docs): Generated DML JSON files (automated) by @github-actions[bot] in #14335
  • chore: fix TSDocs of total fields to be accurate by @shahednasser in #14367
  • chore: Ensure isolated order deletion by @olivermrbl in #14405
  • chore: Create publishable API key as part of the defaults by @olivermrbl in #14356
  • chore: Add Claude Code commands by @olivermrbl in #14438
  • chore: fix eslint config in root by @shahednasser in #14444
  • chore(medusa): add missing fields and filters to product variants endpoint by @NicolasGorga in #14448
  • chore: Require manual trigger of Claude review by @olivermrbl in #14455
  • chore: update TSDocs + export getTranslatedShippingOptionsStep from core-flows by @shahednasser in #14460

Other Changes

New Contributors

Full Changelog: v2.12.3...v2.12.4

Don't miss a new medusa release

NewReleases is sending notifications on new releases.