Langvars

Managing Language Variables via Venddor IO API

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.

Fetching Language Variables

For the Default Language:

For a Specific Language:

Pagination

To 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.

Sample Response for a Test Request

Executing a GET request to /api/languages/1/langvars may yield:

{
  "langvars": [
    ...
  ],
  ...
}

Retrieving Specific Language Variable

Successful retrieval returns details of the language variable, such as its code, name, and value.

Language Variable Attributes

Each variable has specific attributes:

Adding Language Variables

To introduce a new variable:

Always provide essential attributes in your request, such as the internal name and its value.

Modifying Language Variables

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.

Removing Language Variables

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.

Conclusion

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.