As a multilingual user, I often encountered the problem of correctly entering the password when the xflock4 program is active (e.g. when waking up my laptop), since the layout indicator is nowhere to be found.
A quick search shows that there are many people suffering from the same problem. While it is surely possible to modify
xflock4 to display the current layout, my solution is much more simple.
Download and install
xkb-switch from https://github.com/ierton/xkb-switch.
Save the following script as
xkb-switch -s us
Set the executable privileges (
chmod a+x /usr/local/bin/xflock4).
You're done! Note that I assume that your password is typed in the us keyboard layout; if not, change the layout specified in the second line of the script.