Sample Header Ad - 728x90

Cannot change terminal language despite doing everything seemingly correctly, GUI is translated

1 vote
2 answers
94 views
Happening on macOS: 14.4.1 I can't change through the GUI as this is required to be done for several languages and needs to be automated, the different locales will be in a script. ### Everything I tried so far - GUI translated, Terminal is not Here are the commands I ran to change the GUI to French (only first 2 are needed). These are overkill as I was trying to get the terminal to translate:
sudo defaults write /Library/Preferences/.GlobalPreferences AppleLanguages -array fr-FR
sudo defaults write /Library/Preferences/.GlobalPreferences AppleLocale -string fr_FR
sudo defaults write /Library/Preferences/.GlobalPreferences Country -string FR


sudo defaults write ~/Library/Preferences/.GlobalPreferences AppleLanguages -array fr-FR
sudo defaults write ~/Library/Preferences/.GlobalPreferences AppleLocale -string fr_FR
sudo defaults write ~/Library/Preferences/.GlobalPreferences Country -string FR
Then I rebooted the machine, on checking the locale I get en_GB:
defaults read -g AppleLocale
en_GB
However the file the command above supposedly reads shows fr_FR:
defaults read /Library/Preferences/.GlobalPreferences AppleLocale
fr_FR
Language is also shown as fr-FR:
defaults read /Library/Preferences/.GlobalPreferences AppleLanguages
{
    "fr-FR"
}
The outputs are the same for .GlobalPreferences in ~/Library. I then tried to export these vars to ~/.zshrc which solved the problem for others:
cat ~/.zshrc

# tried this before to no avail, other answers said to use the uncommented LANG variable
# export LANG='fr_FR' 
export LANG='fr_FR.UTF-8'
export LC_ALL='fr_FR.UTF-8'

locale

locale
LANG="fr_FR.UTF-8"
LC_COLLATE="fr_FR.UTF-8"
LC_CTYPE="fr_FR.UTF-8"
LC_MESSAGES="fr_FR.UTF-8"
LC_MONETARY="fr_FR.UTF-8"
LC_NUMERIC="fr_FR.UTF-8"
LC_TIME="fr_FR.UTF-8"
LC_ALL="fr_FR.UTF-8"
Example to show terminal is still in English (the error text should be translated):
ls fged

ls: fged: No such file or directory
System Preferences shows français. Any ideas?
Asked by Nickotine (374 rep)
Oct 28, 2024, 07:29 PM
Last activity: Oct 31, 2024, 12:39 PM