How to Configure WPML to Have US and UK English

Configure WPML to Have US and UK English

By default, WPML has only one English language which is the American one with the en_US locale and the British flag(!). In many cases, you might need to use more than one English version, for example, you may want to add British English or Australian English. Fortunately, you can do that easily with WPML in just a few steps. In this short tutorial, I’ll show you how to configure WPML to have US and UK English or any English version you might need.

Configure WPML to Have US and UK English

Before you start, you will need to add this line of code to your wp-config.php file or your theme’s functions.php file.

define('ICL_PRESERVE_LANGUAGES_TRANSLATIONS', true);

As we’re going to edit WPML languages, you don’t want to lose your edits when you update WPML to a newer version. That line will do the trick.

Don’t forget to backup your website database!

Step 1

Go to WPML -> Languages. In the Site Languages section, click ‘Edit Languages’ link.

Edit WPML Languages

You’ll see a list of your active languages, in our case, we have only English as the active language.

WPML Active languages

Step 2

As we’re going to add more than English language, we will not use the English version defined by WPML. Because as you can notice, it has en code and this cannot be changed. So the URLs in this language will look like site.com/en/some-page/. In that case, your website visitors will not be able to recognize which English is that, as this should be something like site.com/en-us/some-page.

So, in this step, you’ll need to change the Default locale value of this language to anything else such as en_en because you cannot use the same locale for 2 languages and we will need this locale in another step.

Default Locale

Step 3: Add the American English

After saving the page, click ‘Add Language’ button. To add the Americal English language correctly, you will need some info

  • Language Name: American English
  • Code: en-us. If you want, you can use just us. So your URL will look like site.com/us/some-page
  • Translation: American English
  • Flag: You can get the US flag by going to this URL within your website: YOUR-DOMAIN/wp-content/plugins/sitepress-multilingual-cms/res/flags/us.png and save the image on your computer. Then choose the option to upload a new flag and use that image.
  • Default locale: en_US and it must be that!
  • Encode URLs: No.
  • Language tag: en-US

After filling the info, the table should look like this

Hit the save button and click ‘Back to languages‘.

Step 4: Get rid of the original English

When you go back to the Languages page, you’ll see that the original language is the original English that’s defined by WPML. Click ‘Change default language’ button and choose ‘American English’

You might see this message ‘Error: data not saved’. Ignore it and reload the page. When the page reloads, click ‘Add/Remove language’ button and deselect the ‘English’ language, then save.

Step 5: Add the British English

Similarly, you will add the British English by clicking ‘Edit languages’ button and use the following info:

  • Language Name: British English
  • Code: en-gb. If you want, you can use just gb.
  • Translation: British English
  • Flag: You can get the UK flag by going to this URL within your website: YOUR-DOMAIN/wp-content/plugins/sitepress-multilingual-cms/res/flags/en.png and save the image on your computer. Then choose the option to upload a new flag and use that image.
  • Default locale: en_GB and it must be that!
  • Encode URLs: No.
  • Language tag: en-GB

Hit the save button and click ‘Back to languages‘.

That’s All!

I hope this short tutorial helps you configure WPML to have US and UK English. If you have any questions, please feel free to use the comments section below.

Hopefully you'll come back soon!
Get More Stuff
WordPress Multilingual, Performance, SEO, Reviews and HOT Deals. One email per week!
Stay Updated
Give it a try, you can unsubscribe anytime.
Close
GET MORE STUFF
IN YOUR INBOX
WordPress Multilingual, Performance, SEO, Reviews and HOT Deals. One email per week!
Stay Updated
Give it a try, you can unsubscribe anytime.
Black Friday & Cyber Monday WordPress Deals
Save Some Buck!
b2ae7ed60bd62b676a78f4e5715b76ceaaaaaaaaaaaaaaaaaaaaaaaa
Share This

Do you find this interesting?

Share it with your friends!