This script gets the user’s language preferences from System Preferences > International > Languages
and stored in ~/Library/Preferences/.GlobalPreferences.plist .
This script uses the Terminal command defaults.
The rest of the script can be used to parse Terminal output of a non-nesting list that doesn’t include the comma in its items.
set intllangs to do shell script "defaults read NSGlobalDomain AppleLanguages"
set intllangs to findAndReplace of intllangs from "(" to ""
set intllangs to findAndReplace of intllangs from ")" to ""
set intllangs to findAndReplace of intllangs from "\"" to ""
set oldtid to text item delimiters
set text item delimiters to ", "
set intllangs to text items of intllangs
set text item delimiters to oldtid
return intllangs
on findAndReplace of TheString from tofind to toreplace
set ditd to text item delimiters
set text item delimiters to tofind
set textItems to text items of TheString
set text item delimiters to toreplace
if (class of TheString is string) then
set res to textItems as string
else -- if (class of TheString is Unicode text) then
set res to textItems as Unicode text
end if
set text item delimiters to ditd
return res
end findAndReplace