Skip Navigation

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

Problem: Currently, for site visitors where a language doesn't exist, English is shown as this is the default language. This works well for us. However, one exception is Brazilian Portuguese and Portuguese. Our site is translated into Brazilian Portuguese - whilst not ideal, we'd want visitors to see the Brazilian Portuguese version if the language code is set to (European) Portuguese.

Solution: I'm afraid that WPML doesn't have an option to do something like this. As you said, you should create add the Portuguese language. Only this way, the visitors will be redirected to it. To make things work the way you described - English Portuguese be redirected to Brazilian Portuguese, some custom coding is required.

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.

No supporters are available to work today on this forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

This topic contains 2 replies, has 2 voices.

Last updated by andrewW-31 7 months, 3 weeks ago.

Assigned support staff: Radu.

Author Posts
January 25, 2020 at 2:05 pm #5361565

andrewW-31

Tell us what you are trying to do?
Currently, for site visitors where a language doesn't exist, English is shown as this is the default language. This works well for us. However, the one exception is Brazilian Portuguese and Portuguese. Our site is translated into Brazilian Portuguese - whilst not ideal, we'd want visitors to see the Brazilian Portuguese version if the language code is set to (European) Portuguese.

This is particularly relevant for site terms and conditions. In this instance, the language variable is already passed to the page (this links in with an app that exists). For example, the language variable is passed as ?lang=pt-pt but this defaults to English.

Is there anyway to load pt-br in this instance? Or will I need to set-up Portuguese as a standalone language?

January 27, 2020 at 9:07 am #5368147

Radu
Supporter

    Languages: English (English )

    Timezone: Europe/Bucharest (GMT+03:00)

    Hey Andrew,

    Thank you for reaching out to the WPML support!

    I understand what you'd like to do but I'm afraid that WPML doesn't have an option to do something like this. As you said, you should create add the Portuguese language. Only this way, the visitors will be redirected to it.

    To make things work the way you described - English Portuguese be redirected to Brazilian Portuguese, some custom coding is required. Unfortunately, this is outside of our support scope. I tried to look for some changes that might help you but I couldn't find anything to do the trick.

    If you want, you can reach out to one of the contractors (https://wpml.org/contractors/) and work with them in order to create the custom code that will do this job.

    Regards,
    Radu

    January 27, 2020 at 4:27 pm #5371369

    andrewW-31

    I thought that may well be the case - we'll give this some thought as to how best to proceed, thanks for taking the time to respond.