All add-ons currently require PHP 7.4 or greater.

On July 4th 2024 PHP 8.2 will be the new minimum requirement for all add-ons. Expect any add-on released after that date to require 8.2 or greater. Some releases may not immediately take advantage of 8.x specific features in PHP, which means you might, be able to continue using new releases in PHP 7.4, however, if you experience an error the first thing you should do is update to PHP 8.2 then create a support ticket if the error persists.

Publisher does not support the Fluid field type. Please do not contact asking when support will be available.

If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.

Ticket: Default site language

Status Resolved
Add-on / Version Publisher 1.0.9
Severity Critical
EE Version 2.5.3

Chad Tomkiss

Sep 11, 2013

Hi,

I have set English to be the default language.

However,

If I visit example.com/de/about-us and then example.com/about-us

The language stays as German, rather than the default English language.

Is it because this is set as a cookie/session?

And if so, how can I stop this from happening?

Cheers,

Chad

#1

BoldMinded (Brian)

The only way to stop that from happening is if you add /en/ to the URL or use the ?ACT=x&lang_id=2 (basically use the language switcher). Yes this is due to the cookie and session value. Something needs to trigger it to change, just removing the prefix won’t work.

#2

Chad Tomkiss

Hi,

Would it be possible to add something like:

if(!in_array($segments[1], $this->language_codes)) {
    $this->set('site_language', ee()->publisher_lib->default_lang_id);
}

As I want to be able to switch languages based on URL alone, not just by the language switcher.

Cheers,

Chad

#3

BoldMinded (Brian)

You can switch languages by changing the URL, just use the {translated_url} value in the exp:publisher:languages tag.

#4

Chad Tomkiss

I want to switch to the default language when there is no language segment in the URL though?

#5

BoldMinded (Brian)

I’ll consider adding something like this, but its going to be a few days. I have no laptop/dev environment right now.

#6

Chad Tomkiss

Ah man, that would be awesome.

For now I’ve added that above code to set_url_prefix function, which seems to work, but not sure of any implications.

Keep me posted 😊

Cheers

#7

BoldMinded (Brian)

I included this fix for the next release. Thanks for the suggestion.

#8

BoldMinded (Brian)

Chad, I’m actually going to retract that change b/c after some further testing it really messes up the language switching for me.

Where exactly did you add it so that it works for you?

Login to reply