Language Variables - Venddor API

Language Variables (Langvars)

Most of the texts in Venddor are stored in language variables (or langvars for short). This approach allows different languages to display different texts for the same content elements, providing a consistent multilingual experience.

Base URL: https://your-store-url.com/api

Working with Language Variables

Language variables are key-value pairs where the key is the variable name (e.g., "product_added_to_cart") and the value is the text to display in the specific language (e.g., "Product has been added to your cart").

Available Endpoints

GET /langvars/

Returns language variables for the default language in your store.

Response Example

[
  {
    "lang_code": "en",
    "name": "shopping_cart",
    "value": "Shopping Cart"
  },
  {
    "lang_code": "en",
    "name": "add_to_cart",
    "value": "Add to Cart"
  },
  {
    "lang_code": "en",
    "name": "checkout",
    "value": "Checkout"
  }
]
GET /languages/{lang_id}/langvars/

Returns language variables for a specific language.

Path Parameters

Parameter Type Description
lang_id* integer The unique identifier of the language

Alternatively, you can use the language code:

GET /api/langvars/?sl=es

The above example will return language variables for Spanish (es).

Tip: When localizing your store, it's important to translate all language variables for a consistent user experience. Use the API to export variables from one language and import them to another after translation.

Common Use Cases