Script to change app language on Mac
macOS allows users to change the default language for each app without altering the device’s system language. Use the Execute Custom Script action from the Hexnode portal to run commands for changing an app’s default language on target macOS devices.
Change default app language
First, fetch the languages supported by your device. Executing the following command on the device displays all languages supported by it.
You can then execute this script to change the app language to any preferred language supported on the device.
CURRENT_USER=`stat -f%Su /dev/console`
# Change app language
sudo su $CURRENT_USER -c "defaults write -app Calendar AppleLanguages -array de"
The script takes effect for the currently logged-in user. You must first provide the desired app name after
defaults write –app and then provide the language designator of a language supported by your device after
AppleLanguages - array.