My Products
Help
zunnu
CONTRIBUTOR **

Ability to get the translated sales categories

by zunnu (Updated ‎31-05-2022 09:17 by zunnu )
Status: New

Hello,

Currently its possible to translate sales categories in Visma.net user interface but there is no way to get the translations of the sales category.
Even worse the user interface locale settings do not apply to the API.
The problem here is that if your UI's default language is FI or SV all the text's you or the customer creates will be on the default language. Now if the customer creates a english translation for sales category that is in FI the API will return the english version of the sales category description and an integration or a platform that expects the language to be in FI will transfer the text in english under the FI translation.

Let's say you have webshop that has Swedish and English translations the default language of the shop is Swedish and the default language of the Visma.net is also Swedish. You and the customer want to translate categories in Visma.net and transfer the translated text and the default text to the webshop. Now if you add English translation for the category the English translation will be returned and as the webshop and Visma.net are both in Swedish the English translation will go under the Swedish text.

The solution for this is to include the translated texts with the category detail.

 

{
    "categoryID": 1,
    "description": "Test",
    "parentID": 0,
    "sortOrder": 1,
    "subCategories": [],
    "translations":
    {
        "<iso>": "<translated text>"
    }
}

 


The best behaviour would be for the API to return texts in the default language that is set in the locale settings.