how to detect osx language

Hi,

How can I detect what language (English/French/Spanish) the o/s is running in and display a message box with a string in that language in AppleScript?

Any help really appreciated, thank you kindly,
Ben

I don’t even know if regular applescript can do a “do shell script” but I’ve used this myself in bash:

defaults read .GlobalPreferences “AppleLanguages” | tr -d ‘\012’ | sed ‘s/(//’ | sed ‘s/ *//’ | awk -F “,” ‘{ print $1 }’

it gets that value from System Preferences. You have to correlate “en” with English, “en_GB” with British English, “pt-BR” with Brazilian Portuguese…

Hey, this works v. nicely! Thanks anaxamander, I’ve tested on 10.3.9 & 10.4 and it works like a charm.

Thank you kindly,
Ben