Trigger key press only on specific keyboard language

Hi, can i setup trigger depends on very keyboard language input?
e.g.
i want to trigger swap "1" to "2" ONLY if French language currently selected

im watching now on applescript but seems it is too confusing to achieve...

I don't know how to do this properly. But I can think of a workaround.

If "French" is activated, then also display a small floating menu in a corner of the screen.

Then you can set: If this floating menu is visible, then 1 = 2.

hmmmm....
and how to get current language on applescript?
seems it is such a messy - reading plist filles...

do you know a better way?