REST API + Multi language

Hello,

we have a multilingual sub wiki with German as Default Language and English/German as supported languges:

Now I try to created a small page in two languages via the REST API as JSON with the following Endpoints:
PUT /translations/de
PUT /translations/en

But the Information tab of the page shows the following info:

I tried to add “language”:”” and “translations”:{ “default”: “de” } to the JSON data. But this don’t change the data in the Information tab.

What do I have to do, that the page displayed correctly?

Thanks for you help and best regards

Tobias

I don’t know, that I have to use placeholder with other chars than “greater/less then”.

I want to write:
… following Endpoints:
PUT [REST URL]/translations/de
PUT [REST URL]/translations/en

and

I tried to add “language”:”[LANG CODE]” and…

Hi,

I don’t know where you found that syntax, you should actually check the data contained in an actual translation file, e.g. in xwiki-platform/xwiki-platform-core/xwiki-platform-tour/xwiki-platform-tour-ui/src/main/resources/TourCode/TourTranslations.de.xml at master · xwiki/xwiki-platform · GitHub

So you need to specify language and defaultLanguage.

Thank you for your answer. But this won’t work:

When I add “defaultLanguage” to the [REST URL]/translations/de body, the request failed with code “400” and message “Unrecognized field “defaultLanguage” (class org.xwiki.rest.model.jaxb.Page), not marked as ignorable”.

As I said, I use JSON to upload the data. Not XML.

And in a “GET [REST URL]/trainslation/de” response there is also no “defaultLanguage” in the data. Only “language” and “translations”: {“default”: “”}.