Localization Services
All services related to Localization are listed in this page.
GET Translations List
This method is used to get list of translations for given content type.
Path: /api/v1/oms/localization/translations_list/
Query Paremeters
content_type
string
query
The content type of the translation
Example Request
To get list of translations, a GET request should be sent to /api/v1/oms/localization/translations_list/ endpoint.
import requests
url = "https://{oms_base_url}/api/v1/oms/localization/get_translations/?content_type=2"
api_token = "f532eXXXXXXXXXXXXXXXXX201XXXXX9332d"
headers = {
'Accept': 'application/json',
'Authorization': 'Token {}'.format(api_token)
}
response = requests.request("GET", url, headers=headers)
print(response.json())Example Response (200 OK)
In a successful response with a status code of 200 OK, the API returns list of translations information.
pk
integer
The primary key of the translation
translations
object
Translations of the given content_type object
content_type
object
Content type info of the translations.
This example response serves as a reference to understand the structure and data format of translations list.
GET Localization Detail
This method is used to retrieve details of the translations for given content_type and object_id parameter.
Path: /api/v1/oms/localization/get_translations/
Query Paremeters
content_type
string
query
The content type of the translation
object_id
string
query
The object id of the translation
Example Request
To retrieve localization detail, a GET request should be sent to /api/v1/oms/localization/get_translations/ endpoint.
Example Response (200 OK)
In a successful response with a status code of 200 OK, the API returns translation detail information.
{language_code}
str
The language code, for example, tr_tr or en_us.
This example response serves as a reference to understand the structure and data format of translations detail.
POST Translate
This method is used to create a translation for given content_type and object_id parameter.
Path: /api/v1/oms/localization/translate/
Body Paremeters
content_type
string
query
The content type of the translation
object_id
string
query
The object id of the translation
translation
object
body
The translation object
Example Request
To create translation a POST request should send to /api/v1/oms/localization/translate/ endpoint.
Example Response (200 OK)
In a successful response with a status code of 200 OK, the API returns translation detail information.
{language_code}
str
The language code, for example, tr_tr or en_us.
This example response serves as a reference to understand the structure and data format of translations detail.
GET Translatable Models
This method is used to get a list of translatable models.
Path: /api/v1/oms/localization/translatable_models/
Example Request
To get translatable models list, a GET request should be sent to /api/v1/oms/localization/translatable_models/ endpoint. No query parameter or body required.
Example Response (200 OK)
In a successful response with a status code of 200 OK, the API returns list of translatable models.
content_type_id
integer
The primary key of the translatable model content type id
model
string
Translatable model name
translatable_fields
array
Translatable fields of the model
This example response serves as a reference to understand the structure and data format of translatable models list.
Was this helpful?

