Skip to content

Translation bundles

The DatAscend application handles translation by using i18n bundles. The main way to manage these translation bundles is through the DatAscend Studio. By using the resource configuration endpoints (available on Swagger UI), users can interact with these bundles.

Managing translation bundles for entities via the DatAscend Studio

Section titled “Managing translation bundles for entities via the DatAscend Studio”

The following steps describe how an operator manages entity translation bundles in DatAscend Studio:

If the entity does not have a bundle created, when it is created, a new generic bundle will be generated automatically. The operator should open the Translations tab to view and manage the translation bundles in the entity drawer. image

At the top of the Translations tab, the Language dropdown menu is available. The operator should click on it and choose the language to translate the entity into. image

The Label field is for the entity’s main name (e.g., “Worksheet”). The operator should change the text in this field to the correct translation for the chosen language. image

In the Attributes section, for each attribute listed in the left column (such as id or owner), a corresponding text field is found in the Label column on the right. The operator should enter the translation for each attribute’s name here. image

The Relations section works the same way as the attributes. For each listed relation, the operator should type its translation into the text field in the Label column. image

Once all translations are complete, the operator should click the Save button at the bottom of the drawer to apply them.

The API provides endpoints to retrieve translation bundles. The base URL for all endpoints is /api/v1/config/resources/.

Retrieve a list of available namespaces for translation bundles.

Endpoint:

GET /api/v1/config/resources/namespaces?version=:version

Parameters:

NameTypeFromDescription
versionstringqueryThe name of the version to query

Example response:

{
"error": false,
"status": 200,
"message": "string",
"errors": [
{}
],
"data": [
"application",
"entities"
],
"pagination": {
"hasPreviousPage": true,
"hasNextPage": true,
"previousPage": 0,
"nextPage": 0,
"recordsTotal": 0,
"currentPage": 0,
"startIndex": 0,
"numPages": 0,
"limit": 0
}
}

Retrieve specific translation bundles by language, namespace, and bundle names.

Endpoint:

GET /api/v1/config/resources/:language/:namespace?version=:version&bundle[]=:bundleName1&bundle[]=:bundleName2

Parameters:

NameTypeFromDescription
languagestringpathLanguage code (e.g., “en”, “es”)
namespacestringpathNamespace (e.g., “application”, “entities”)
versionstringqueryThe name of the version the bundles belong to
bundle[]stringqueryArray of bundle names to retrieve (value after namespace of $meta.name)

Example response:

{
"error": false,
"status": 200,
"message": "string",
"errors": [
{}
],
"data": {
"id": "22b9f18a-493a-430d-9657-1261a3f9a4e9",
"$meta": {
"engine": "string",
"format": "string",
"fallback": "string",
"language": "string",
"version": "string",
"name": "string",
"created": "string",
"modified": "string"
},
"en": {
"additionalProp1": "string",
"additionalProp2": "string",
"additionalProp3": "string"
},
"es": {
"additionalProp1": "string",
"additionalProp2": "string",
"additionalProp3": "string"
}
},
"pagination": {
"hasPreviousPage": true,
"hasNextPage": true,
"previousPage": 0,
"nextPage": 0,
"recordsTotal": 0,
"currentPage": 0,
"startIndex": 0,
"numPages": 0,
"limit": 0
}
}

Update the translations for a specific bundle.

Endpoint:

PATCH /api/v1/config/resources/:language/:namespace?version=:version&bundle=:bundle

Parameters:

NameTypeFromDescription
languagestringpathLanguage code (e.g., “en”, “es”)
namespacestringpathNamespace (e.g., “application”, “entities”)
versionstringqueryThe name of the version the bundle belongs to
bundlestringqueryThe name of the bundle being updated (value after $meta.name)

Request body:

{
"id": "00000000-0000-0000-0000-1234567890AB",
"en": {
"additionalProp1": "string",
"additionalProp2": "string",
"additionalProp3": "string"
},
"es": {
"additionalProp1": "string",
"additionalProp2": "string",
"additionalProp3": "string"
}
}

Example response:

{
"error": false,
"status": 200,
"message": "string",
"errors": [
{}
],
"data": {
"id": "22b9f18a-493a-430d-9657-1261a3f9a4e9",
"$meta": {
"engine": "string",
"format": "string",
"fallback": "string",
"language": "string",
"version": "string",
"name": "string",
"created": "string",
"modified": "string"
},
"en": {
"additionalProp1": "string",
"additionalProp2": "string",
"additionalProp3": "string"
},
"es": {
"additionalProp1": "string",
"additionalProp2": "string",
"additionalProp3": "string"
}
},
"pagination": {
"hasPreviousPage": true,
"hasNextPage": true,
"previousPage": 0,
"nextPage": 0,
"recordsTotal": 0,
"currentPage": 0,
"startIndex": 0,
"numPages": 0,
"limit": 0
}
}