This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This thread is resolved. Here is a description of the problem and solution.

Problem: How to add an extra version of english so that australian / british / other english variants (or minor string changes ) may be made or how to add a custom language.

Solution: 'Add custom language' is the best way and user-friendly.

You can add it from WPML > languages > Site Languages > Edit Languages : http://take.ms/GYTnv Now click on "Add Language" button : http://take.ms/TW7d3

Fill the generated row as:

Code: a unique value that identifies the language. Once entered, the language code cannot be changed.

Translations: the way the language name will be displayed in different languages.

Flag:the flag to display next to the language (optional). You can either upload your own flag or use one of WPML's built-in flag images.

Default locale: This determines the locale value for this language. You should check the name of WordPress localization file to set this correctly.

Encode URLs: yes/no, determines if URLs in this language are encoded or use ASCII characters (leave ‘no’ if you are not sure).

hreflang: the code Google expects for this language. The hreflang should contain at least the language code (usually, made of two letters), or, if you want to specify the country/region, it should be the same information as the locale name, but in a slightly different format. If the locale for Canadian French is fr_CA, the corresponding hreflang would be fr-ca. Instead of an underscore, use a dash (-) and all letters should be lowercase.

For Australian English:

name = Your choice code = en-au hreflang = en-AU (since this is only for English users who are from Australia) locale = en_AU flag = Your own graphic

Please refer: 1. A complete list of Locale Code: https://wpastra.com/docs/complete-list-wordpress-locale-codes/ 2. How to create / decide 'hreflang' : https://wpml.org/documentation/support/adding-hreflang-wordpress/#how-wpml-creates-hreflang-tags (important)

A quick video : https://www.youtube.com/watch?v=gbdbEOQA0Kw

This topic contains 2 replies, has 2 voices.

Last updated by Bryan 8 months, 2 weeks ago.

Assigned support staff: Riffaz.

Author Posts
October 4, 2018 at 10:37 pm #2788911

Bryan

Tell us what you are trying to do?
Add an extra version of english so that australian / british / other english variants (or minor string changes ) may be made

Is there any documentation that you are following?

I found many support forum hits but nothing covers the full process and/or best practice

IMO

This might be best answered with a documentation/code base update but I also need help before hand, after which I will write my own process and share if you like.

As an example; lets say I want to add a new language called

Australian English

..but where I want to translate some of the code strings r

I can see perhaps two ways to do this

1. 'Add custom language'
2. Add a new language to wordpress via some .po files?

Please help me with the best way especially where the translated strings are best done in WPML string translations and where I already have other languages installed.

if 'Add a custom language '

When adding a custom english language for australia what should I use ?

name = Australian (my choice I guess?)
code = ?
hreflang = ?
locale = en-AU
flag = (own graphic)

I assume the default language needs to be default English ? ..and where the base language is, for example Australian, this should all be done during the initial site setup.

thanks

October 5, 2018 at 9:48 am #2790234

Riffaz
Supporter

Languages: English (English )

Timezone: Asia/Colombo (GMT+05:30)

Hi,

Thank you for contacting WPML support.

'Add custom language' is the best way and user-friendly.

You can add it from WPML > languages > Site Languages > Edit Languages : hidden link
Now click on "Add Language" button : hidden link

Fill the generated row as:

Code:

a unique value that identifies the language. Once entered, the language code cannot be changed.

Translations:

the way the language name will be displayed in different languages.

Flag:
the flag to display next to the language (optional). You can either upload your own flag or use one of WPML's built-in flag images.

Default locale:

This determines the locale value for this language. You should check the name of WordPress localization file to set this correctly.

Encode URLs:

yes/no, determines if URLs in this language are encoded or use ASCII characters (leave ‘no’ if you are not sure).

hreflang:

the code Google expects for this language. The hreflang should contain at least the language code (usually, made of two letters), or, if you want to specify the country/region, it should be the same information as the locale name, but in a slightly different format. If the locale for Canadian French is fr_CA, the corresponding hreflang would be fr-ca. Instead of an underscore, use a dash (-) and all letters should be lowercase.


For Australian English:

name = Your choice
code = en-au
hreflang = en-AU (since this is only for English users who are from Australia)
locale = en_AU
flag = Your own graphic

Please refer:
1. A complete list of Locale Code: hidden link
2. How to create / decide 'hreflang' : https://wpml.org/documentation/support/adding-hreflang-wordpress/#how-wpml-creates-hreflang-tags (important)

A quick video : hidden link

Hope, this will help you.

Let me know.

Regards,
Riffaz.

October 6, 2018 at 9:06 am #2792632

Bryan

My issue is resolved now. Thank you!