Looking at the Cocoa/Objective C "NSLocale
" documentation, I see there are actually two user level locale variables.
One is currentLocale
and the other is autoupdatingCurrentLocale
.
Unfortunately for you, it looks like the API Apple has decided to export via AppleScript is the one that only updates at the user's login time. I suspect your Applescript result will only change each time the user is rebooted or re-logged in.
You will need to come up with an Objective C tool that allows you to do "autoupdatingCurrentLocale
" and put that into an Applescript variable.
Now I see you've edited your question, so I'll edit mine as well: It sounds like what you want to do is what has been suggested in the answers of this related question, which I'm pretty certain you've seen while doing your own research. Use that "get_language()
" applescript bit to return item 1 of your "r
" array.