XWIKI-9988: Newly created pages with attachments are shown as orphaned and have the language "default"
* Add an API to safely get a locale even when the format is invalid.
XWIKI-9988: Newly created pages with attachments are shown as orphaned and have the language "default"
* Set the document language properly when uploading an attachment to a new document.