appliedLanguage property of text-related objects returns language from application, not document
When I do configuration for a language in a document, such as setting doubleQuotes, this language can be found in the document object's list of languages and has a different id than the language with the same name in the application object's list.
But when I access text inside the document – regardless what I inspect, paragraph, words, character, textStyleRange – I expect to get the language properties as set in the document, but instead I get those as set in the app.
I believe this to be a software bug.
More information as well as a workaround can be found in https://community.adobe.com/t5/indesign-discussions/paragraph-appliedlanguage-seems-to-differ-from-the-actual-applied-language/m-p/12997100#U12991700