# 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](https://www.hexnode.com/mobile-device-management/help/how-to-run-scripts-on-mac-using-hexnode-mdm/) action from the Hexnode portal to run commands for changing an app’s default language on target macOS devices.

 Disclaimer: 
The sample scripts provided below are adapted from third-party open-source sites.

 

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.

Script to fetch supported language

languagesetup 

   1

  languagesetup 

   

 

  

You can then execute this script to change the app language to any preferred language supported on the device.

Script to change app language

\#!/bin/bash CURRENT\_USER=`stat -f%Su /dev/console` # Change app language sudo su $CURRENT\_USER -c "defaults write -app Calendar AppleLanguages -array de" 

   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](https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPInternational/LanguageandLocaleIDs/LanguageandLocaleIDs.html) of a language supported by your device after `AppleLanguages - array`.

 Notes:- It is recommended to manually validate the script execution on a system before executing the action in bulk.
- Hexnode will not be responsible for any damage/loss to the system on the behavior of the script.