Skip to main content
GET
/
admin
/
translations
/
statistics
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.statistics({
  entity_type: "product"
})
.then(({ statistics }) => {
  console.log(statistics)
})
{
  "statistics": {
    "product": {
      "expected": 150,
      "translated": 120,
      "missing": 30,
      "by_locale": {
        "fr-FR": {
          "expected": 150,
          "translated": 120,
          "missing": 30
        }
      }
    }
  }
}

Authorizations

Authorization
string
header
required

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

Query Parameters

locales
string[]
required

The locale codes to retrieve translation statistics for.

A locale code in BCP 47 format.

entity_types
string[]
required

The table names of entities to retrieve translation statistics for.

The table name of an entity.

Response

OK

The translation statistics details.

statistics
object
required

The translation statistics for different entity types. The key is the entity type, and the value is an object containing the statistics for that entity type.

Example:
{
"product": {
"expected": 150,
"translated": 120,
"missing": 30,
"by_locale": {
"fr-FR": {
"expected": 150,
"translated": 120,
"missing": 30
}
}
}
}