Macs support so many different languages and keyboards now that it’s maybe not surprising that sometimes they can get a little confuddled. If you find your Mac starting up in the wrong language or – even worse – with the wrong keyboard, here’s what you can do about it.
Starting up with the wrong keyboard is often the more serious, as this can make it incredibly difficult to type your password in. If you’re keying in what you think is the letter Q but your Mac is using a traditional French keyboard and thinks that’s an A, that’s not going to help you much.
macOS actually maintains at least two separate property lists specifying the keyboard layout to be used. Both are named com.apple.HIToolbox.plist, and they are stored in /Library/Preferences and ~/Library/Preferences (if there is more than one user, each has their own in their Home folder). The first of those applies before you have logged in, and the second is specific to that user. macOS should try to keep them in sync if there’s only a single admin user, but can get confused.
Like all preference files, they are now maintained by a service which means that editing them directly is unlikely to do a great deal: the service will happily overwrite the files with what it thinks they should be.
Apple recommends that the most reliable way to set the language and keyboard to be used at startup, when there’s only a single admin user, is to use the Language & Region pane. If the language that you want isn’t in that list, click on the + tool to add it. Then drag it to be the top of the list, so it’s designated as Primary.
Selecting the keyboard is most easily accomplished in the Input menu, enabled in the Input Sources tab of the Keyboard pane. Whichever keyboard is set at the time that you shut down or restart should be used when you start up again.
This all gets more complicated when your Mac has more than one user, and the users don’t all have the same keyboard selected. You may also encounter situations where the primary language and keyboard for a single admin user may not get properly synchronised with those used prior to logging in.
If keyboard and/or language settings are confused or inconsistent, or they are different across two or more user accounts, use the command line once you have set the individual users up correctly. The command you need is
languagesetup, and if you want to change the system settings, you’ll need to run it as root using
The command that you need runs something like
sudo languagesetup -langspec [lang]
[lang] is a recognised name like
"English", or an ISO-639 language code such as
"ko" – either should be entered inside standard double-quotes like that. You’ll then need to authenticate with your admin user’s password.
You can get further information about this command using
man languagesetup or
languagesetup -h. ISO-639-1 codes can be found here.
Rarely, you may have problems getting these to work. You can then try:
- Trash the two preference files at /Library/Preferences/com.apple.HIToolbox.plist and ~/Library/Preferences/com.apple.HIToolbox.plist
- Set the primary admin user’s language and keyboard correctly, as above.
- Use the
languagesetupcommand to set the correct language.
Another useful workaround if you have problems getting the right keyboard to work for the login screen is to enable the Input menu (in which you can select the keyboard to use) to appear at login. Open the Users & Groups pane, unlock it, click Login Options, and there tick the box labelled Show Input menu in login window. You can then use that menu to select the keyboard you want for typing in your password.