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 7 replies, has 2 voices.

Last updated by Carlos Rojas 5 months, 3 weeks ago.

Assigned support staff: Carlos Rojas.

Author Posts
April 26, 2019 at 10:00 am

nelsonG-5

I am trying to:

Change the language code for Portuguese (Portugal) for only "pt" instead of "pt-pt"
Other major languages, such as English (EN), French (FR) os Spanish (ES) do not show en-en, ou fr-fr ou es-es, although they have language variations. Why Portuguese is pt-pt?

Link to a page where the issue can be seen:

hidden link

I expected to see:

hidden link

Instead, I got:

hidden link
And all other pages in Portuguese.

Is it possible to change the language code?

Thank you
Nelson / Contacto Visual, Portugal

April 26, 2019 at 2:32 pm #3691567

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

Timezone: America/Montevideo (GMT-03:00)

Hello,
Thank you for contacting WPML support.

As a workaround for this issue you can create a custom language and add only the 'pt' code. In this link you will find the steps to follow in order to add a custom language using WPML: https://wpml.org/documentation/support/editing-wpmls-languages-table/

Kind regards,
Carlos

April 26, 2019 at 3:02 pm #3691749

nelsonG-5

I did found that previously, and tried, but I cannot save the new language. It keeps on yellow.
Maybe because all the items are the same as the Portuguese internal version except the code. Maybe if I remove it first, but I need it there to move contents already translated.
Also after loading a flag icon, it ignores it and ask again.
See attached img.

Thank you
Nelson / Contacto Visual, Portugal

April 26, 2019 at 3:08 pm #3691903

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

Timezone: America/Montevideo (GMT-03:00)

Hi Nelson,
Thank you very much for your feedback.

Before trying to add the custom language again I kindly ask you to check if you can remove the 'pt-pt' and leave only the 'pt' code in the Portuguese language in the hreflang column of the table. If you can successfully change the hreflang in the original Portuguese language then you can remove the custom language.

Regards,
Carlos

April 26, 2019 at 3:25 pm #3692001

nelsonG-5

Yes, I tried that too. It saves, with hreflang set to pt (instead of pt-pt). But the URLs remain the same: hidden link

I read that hreflang is for Google only, and as no influence in the URLs.

Nelson / Contacto Visual, Portugal

April 26, 2019 at 5:39 pm #3692657

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

Timezone: America/Montevideo (GMT-03:00)

Hi Nelson,

1.- After changing the hreflang to 'pt' did you re-saved the permalink structure?

2.- Please provide the debug information of the site. In this link you will find the steps to follow: https://wpml.org/faq/provide-debug-information-faster-support/

Regards,
Carlos

April 29, 2019 at 7:58 am #3700777

nelsonG-5

Good morning

Yes, I did re-saved the permalinks. Twice. No luck.

This is just annoying, not a serious problem. I have another problem, with a plugin (Jomres), and probably I will drop WPML and switch to Polylang.
WPML is no doubt a very good and professional multi-language plugin, but not for this project.

Thank you

Nelson / Contacto Visual, Portugal

April 29, 2019 at 7:13 pm #3706281

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

Timezone: America/Montevideo (GMT-03:00)

Hi Nelson,

Before we close this ticket I would like to request temporary access (wp-admin and FTP) to your site to take better look at the issue (the credentials you shared in your first message didn't worked). You will find the needed fields for this below the comment area when you log in to leave your next reply. The information you will enter is private which means only you and I can see and have access to it.

Our Debugging Procedures

I will be checking various settings in the backend to see if the issue can be resolved. Although I won't be making changes that affect the live site, it is still good practice to backup the site before providing us access. In the event that we do need to debug the site further, I will duplicate the site and work in a separate, local development environment to avoid affecting the live site.

Regards,
Carlos