This endpoint allows you to create a new language in your Venddor store. Languages are essential for providing multilingual experiences to your customers.
Send a POST request with the following parameters in the HTTP request body. The format should follow your specified Content-Type
.
Parameter | Type | Required | Description |
---|---|---|---|
lang_code* | string | Yes | Two-letter language code. Must be unique among all installed languages. |
name* | string | Yes | The display name of the language. |
status | string | No | Language status: A (active), H (hidden), or D (disabled). |
country_code | string | No | ISO code of the country (in capital letters). Determines the flag icon shown in the administration panel and storefront. |
from_lang_code | string | No | The language code to copy language variables from. If not specified, variables will be taken from CART_LANGUAGE . |
lang_code
of any languages that come with Venddor, or that language will disappear from the list until you delete the language you created.
country_code
in capital letters (e.g., "US" for United States). You can find a list of ISO country codes at countrycode.org.
/api/languages/?sl=en
will have the same effect as specifying "from_lang_code": "en"
in the JSON body.
{ "lang_code": "ts", "name": "Test", "status": "A", "country_code": "US", "from_lang_code": "en" }
{ "lang_id": 3 }
Returned when the language couldn't be created due to invalid parameters or other issues.
When creating a new language, consider the following best practices:
from_lang_code
parameter to copy existing translations, saving time during setup.