Skip to main content
GET
/
admin
/
translations
JS SDK
import Medusa from "@medusajs/js-sdk"

export const sdk = new Medusa({
  baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
  debug: import.meta.env.DEV,
  auth: {
    type: "session",
  },
})

sdk.admin.translation.list()
.then(({ translations, count, limit, offset }) => {
  console.log(translations)
})
{
  "limit": 123,
  "offset": 123,
  "count": 123,
  "translations": [
    {
      "id": "<string>",
      "reference_id": "prod_123",
      "reference": "product",
      "locale_code": "fr-FR",
      "translations": {
        "title": "Chaussures",
        "description": "Des chaussures élégantes."
      },
      "created_at": "2023-11-07T05:31:56Z",
      "updated_at": "2023-11-07T05:31:56Z",
      "deleted_at": "2023-11-07T05:31:56Z"
    }
  ],
  "estimate_count": 123
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

q
string

Search query to filter translations by their fields.

reference_id

Filter translations by a reference ID. For example, the ID of a product.

Example:

"prod_123"

reference
string

Filter translations by the resource they belong to. For example, product or product_variant.

locale_code

Filter translations by a locale code in BCP 47 format.

Example:

"fr-FR"

limit
number

Limit the number of items returned in the list.

offset
number

The number of items to skip when retrieving a list.

order
string

The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with -.

with_deleted
boolean

The translation's with deleted.

fields
string

Comma-separated fields that should be included in the returned data. If a field is prefixed with + it will be added to the default fields, using - will remove it from the default fields. Without prefix it will replace the entire default fields.

$and
$and · object[]

Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters.

$or
$or · object[]

Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters.

Response

OK

SUMMARY

limit
number
required

The maximum number of translations returned.

offset
number
required

The number of translations skipped before retrieving the returned translations.

count
number
required

The total number of translations matching the query.

translations
object[]
required

The list of translations.

estimate_count
number

The estimated count retrieved from the PostgreSQL query planner, which may be inaccurate.