In Venddor IO, language variables play a crucial role in ensuring the adaptability and localization of the platform. They help in reflecting the right context to the user in various languages. Here's a concise guide on managing these language variables using the Venddor IO API.
/api/langvars//api/languages/<lang_id>/langvars//api/langvars/?sl=enTo streamline data, Venddor IO's API offers pagination:
For instance, a GET request to /api/langvars/?page=2&items_per_page=2 fetches information about two language variables from the second page.
Executing a GET request to /api/languages/1/langvars may yield:
{
"langvars": [
...
],
...
}
/api/langvars/<name>./api/languages/<lang_id>/langvars/<name> or /api/langvars/<name>/?sl=en.Successful retrieval returns details of the language variable, such as its code, name, and value.
Each variable has specific attributes:
To introduce a new variable:
/api/langvars/ (POST)./api/languages/<lang_id>/langvars/ or /api/langvars/?sl=en (POST).Always provide essential attributes in your request, such as the internal name and its value.
To update an existing variable's value, use the PUT method:
Endpoint: /api/languages/<lang_id>/langvars/<name> or /api/langvars/<name>/?sl=en.
Remember to provide the updated value in your request.
You can delete a language variable across all languages using the DELETE method:
Endpoint: /api/langvars/<name>.
After the successful deletion, the variable with name=<name> will no longer exist.
Venddor IO provides a modular platform to seamlessly manage language variables. This ensures that administrators can create a personalized language experience tailored to the needs of their user base.