docs: docs for next release (#14456)

This commit is contained in:
Shahed Nasser
2026-01-06 17:40:26 +02:00
committed by GitHub
parent a960fb75c9
commit a2210ea5e7
19 changed files with 1434 additions and 64 deletions
@@ -840,3 +840,36 @@ export const retrieveBrandsWorkflow = createWorkflow(
```
This will retrieve all brands that are linked to at least one product.
### Retrieve Localized Data
<Prerequisites
items={[
{
text: "Medusa v2.12.4 or later",
link: "https://github.com/medusajs/medusa/releases/tag/v2.12.4"
},
{
text: "Translation Module Configured",
link: "!resources!/commerce-modules/translation#configure-translation-module",
},
]}
/>
To retrieve localized data for data models that have translations, pass an `options.locale` property to the first parameter of the `query.index` method:
```ts highlights={[["5", "locale", "Pass the locale to retrieve localized data."]]}
const { data: products } = await query.index({
entity: "product",
fields: ["id", "title", "description"],
options: {
locale: "fr-FR",
},
})
```
The `options.locale` property is a string representing the locale code following the [IETF BCP 47 standard](https://gist.github.com/typpo/b2b828a35e683b9bf8db91b5404f1bd1).
The returned products will have their `title` and `description` properties in French (`fr-FR`), if translations are available.
Learn more in the [Translation Module](!resources!/commerce-modules/translation) documentation.