get https://apiv4.ordering.co////translations
This API endpoint is used to get all translations lang_keys depending on the language path param request, these translations are variable texts that load on the website, emails and push notifications.
mode:dictionary
This param returns an object with only the keys and text values, instead of an array of objects with all attributes as the compared example shows below:
Without mode dictionary
{
"error": false,
"result": [
{
"id": 1,
"key": "MAIN_PAGE_SEARCH_VALIDATION_MSG",
"text": "Please fill all the fields"
},
{
"id": 2,
"key": "MAIN_PAGE_SEARCH_ZIPCODE_VALIDATION_MSG",
"text": "Enter valid zipcode"
},
{
"id": 3,
"key": "MAIN_PAGE_CHECK_ORDER",
"text": "Check order status:"
},
...
]
}
{
"error": false,
"result": {
"MAIN_PAGE_SEARCH_VALIDATION_MSG": "Please fill all the fields",
"MAIN_PAGE_SEARCH_ZIPCODE_VALIDATION_MSG": "Enter valid zipcode",
"MAIN_PAGE_CHECK_ORDER": "Check order status:",
"BODY_WHERE_ARE_YOU": "Where are you?",
"FRONT_VISUALS_MOST_POPULAR": "Most Popular",
"BODY_FOLLOW_US": "Like Us!",
"BODY_ORDER_FOOD_TITLE": "Order online from the best delivery businesses in your area!",
"LOGIN_INPUT_EMAIL": "e-mail",
...
}
}
With mode dictionary
{
"error": false,
"result": {
"MAIN_PAGE_SEARCH_VALIDATION_MSG": "Please fill all the fields",
"LOGIN_INPUT_EMAIL": "e-mail",
"LOGIN_INPUT_PASSWORD": "password",
...
]
}
Using Ordering SDK
//Normal
const response = await ordering.translations().get();
//Dictionary
const response = await ordering.translations().asDictionary.get();