Q: Reliable method to determine system language in OS X I was hoping to do something like
defaults read -g AppleLanguages | awk -F, '/[^(]/{print $1;exit}'  

but if only one language is listed in "Preferred Languages", then defaults read -g AppleLanguages returns an error:

The domain/default pair of (kCFPreferencesAnyApplication, AppleLanguages) does not exist  

It works fine if multiple languages are listed.
Does anyone have a reliable way of determining the language selected for a given user in OS X?
