Finding Declare for "Document Input Source"

When I first started using XOJO (2006?), if one wanted to change the input source language (part of Locale?), one just changed it. A few years ago, the OS people added in a feature so the document had a language type attached to it.

I would like to be able to set certain textfields to certain languages.

I think from the little I know of Declares, I can do this but I have no idea how to find it except it is likely under locale. I don’t know where the declares are located in the various OS’s.
I know one detect it but I want to change it.
Has anyone been able to use this feature?

What about the User ?
How did (s)he knows this Field is Chineese, that one French and the last one Ukrainian ?

Well. The end goal is to enable the user to set it via a preferences window

On macOS, it is already user settable in the System Preferences.

On Windows and Linux, I do not know. What these zealots say 'bout that ?

Yup. That’s the declare I want.

You want to replace the user interface form the OS ?

Since the OS can do it, why not my application.

I would call that bad practice. Also it will be rejected for macOS Appstore for sure. Messing with the macOS system settings from within an app is a no go.

Sorry. You are probably very correct.
I’m changing the topic from “changing keyboard language”.
The Apple system preferences uses the following wording under Keyboard Preferences, “Automatically switch to a Document’s Input Source”
If I look in Apple Developer, there are a lot of possible declares.
Suggestions?