REST page content upload with multi language support - language is set to None

We are writing a migration tool from FOSWiki to XWiki. In our old FOSWiki, we have pages in multiple languages: German and English, with German being the main language. We therefore have configured XWiki to use German and English language with German as the default language.

Our migration tool uses the XWiki REST API to upload the created pages.

There seems to be something off:
The language specified when uploading is ignored sometimes.

In order to create a page, we send following the following XML to the URL

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>                                                        
<page xmlns="">                                                                            
 <modifierName>Foswiki Migration Bot</modifierName>
 <comment>Imported from foswiki</comment>
 <content><![CDATA[my awesome page full of content about Accountverlängering lol]]</content>

After this succeeds, we send the same XML request to the same URL but with the <language> tag set to en and the content in English language.

When we now take a look at the resulting page we have a page translation in English but the original locale of the page is set to None and contains the German translation. It does not matter which translation we send first, it is always the German one that gets “stripped” of its locale (i.e. locale is None).

This is a problem because when a wiki user changes their preferred language in global language preference (the top-right menu), you can only select English there, but not German.

Am I doing something wrong here?
What is the correct way to upload and create localized pages via the XWiki REST API?