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.

Tagged: 

This topic contains 6 replies, has 2 voices.

Last updated by Jamal 8 months, 4 weeks ago.

Assigned support staff: Jamal.

Author Posts
January 22, 2019 at 2:20 pm #3116873

Robert Brandl

Hi there! The proposed way of adding the language didn't work unfortunately: "The Language code already exists".

Please let me know how we should approach this!

January 22, 2019 at 4:28 pm #3117427

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello Robert,

Thank you for contacting WPML Support. I will be glad to help with this.

I might understand that we have already worked together on this before, but i could not find any old ticket about it. Would you please elaborate a little on your message.

You are not able right now to add "uk" ? Can you go through the Cleanup controls in WPML->Support->Troubleshooting. Don't miss the backup warning

Can you also activate debugging when trying to add "uk" and share the debug.log file.
1. Please follow the debugging information provided here: http://wpml.org/documentation/support/debugging-wpml/ .
2. Repeat the action of creating the problem.
3. Share the debug.log (log file inside the /wp-content/ directory) here or using DropBox or GoogleDrive.

Can you also paste your WPML Debug information in the Debug information field?
- http://wpml.org/faq/provide-debug-information-faster-support/

Looking forward to your answer.

Best regards,
Jamal
WPML Support

January 22, 2019 at 4:33 pm #3117435

Robert Brandl

Hi Jamal, thanks for your answer.
Before I go through all your suggested steps, my previous conversation was titled:
"Language sub-versions (UK, IE etc.)" - it was a live chat.

So, generally it should be possible to add UK as a language version next to EN, is that correct?

January 22, 2019 at 4:50 pm #3117461

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello Robert,

Thank you for the explanation. Yes it should be possible to add a new language, another english, uk, us and more.
I guess we have suggested in the chat that you follow our article
https://wpml.org/documentation/support/editing-wpmls-languages-table/

I assumed you have tried and you got the error "The Language code already exists", that's why i suggested the attempts in my previous message.
1. Troubleshooting actions to get WPML to a consistent/integrated state.
2. PHP Debug to detect any possible PHP errors.

I would also suggest to try in a minimal setup, please check if this issue appears when:
- Only WPML plugins are activated. It will tell us if there is an interaction issue with other plugin.
- Theme is set to a WordPress default like Twenty Fourteen. Its will tell us if there is an interaction issue with your theme.
- If the problem disappears, start activating one at the time to track where the incompatibility is produced.

And finally, the debug information, may help me know what plugins you are using and what settings you are having with WPML.

I remain at your disposal.

Best regards,
Jamal
WPML Support

January 22, 2019 at 5:16 pm #3117554

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hi Robert,

Thank you for the feedback, i made the debug as private.

As far as i can tell right now, you do not have uk registered.
active_languages
array
0 en
1 es
2 de
3 fr
4 it
5 nl
6 sv
7 pt

Let me know what you get with the other suggested manipulations.
1. Troubleshooting actions in WPML->Support->Troubleshooting.
2. Minimal setup by deactivating other plugins and switching to default theme.
3. Activating PHP debugging to see if there are any errors.
http://wpml.org/documentation/support/debugging-wpml/

I will also suggest to check the .htaccess if available.

Let me know what you get.

Best regards,
Jamal
WPML Support

January 24, 2019 at 12:46 pm #3125057

Robert Brandl

Hi Jamal,

We were wrong. We wanted to use the "uk" code for a different "language" (uk english) but i just saw that the "uk" code is the preset for the "Ukranian". That's why we were getting this errors.

I've tried several other codes (that do not belong to any other preset language) and it's working fine.

Could we use whatever (2 letters?) code we'd like?

And one last question. If our goal is to define a different site for UK visitors, although the content is the same, shoud we set the Default locale to "en_UK"? (now the "en" language has the Default locale set to "en_US".

And what if we wanted to make a version for Ireland (en_IE?) or Canada (en_CA? / fr_CA?)

If this is correct, what country codes should we be using from here on, alpha2 code?

I hope you can help us.

Thanks,

January 24, 2019 at 2:01 pm #3125459

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello Robert,

I am glad you could found the cause of this issue. I will try to answer your questions.

I've tried several other codes (that do not belong to any other preset language) and it's working fine.

Could we use whatever (2 letters?) code we'd like?
You can even use more than 2 letters like en-uk for UK english or en-ca for Canadian english, but remember. Once you set the code value and add content, you should never change it, or content language will be lost. This value will be used for the language URLs. For example, http://wpml.org/es-mx/, http://wpml.org/?lang=es-mx, hidden link;

And one last question. If our goal is to define a different site for UK visitors, although the content is the same, shoud we set the Default locale to "en_UK"? (now the "en" language has the Default locale set to "en_US".

And what if we wanted to make a version for Ireland (en_IE?) or Canada (en_CA? / fr_CA?)

If this is correct, what country codes should we be using from here on, alpha2 code?
Yes you will need to set default locale to en_IE for Ireland and en_CA and fr_CA for Canada.
You can use en-ie, en-ca, fr-ca respectively as "language code" for these cases.
You can use this table to help you decide.
https://make.wordpress.org/polyglots/teams/

I hope this answers your questions.

Best regards,
Jamal
WPML Support