Category filter
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 the default app language
First, fetch the languages supported by your device. Executing the following command on the device displays all languages supported by it.
1 |
languagesetup |
You can then execute this script to change the app language to any preferred language supported on the device.
1 2 3 4 |
#!/bin/bash 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
.