Jump to content

Shoud it throw 404 error if language is not active for page


Zeka
 Share

Recommended Posts

Hi.

I have some pages wich do not have translation for second language. So i uncheck checkbox for this laguage. 

Screenshot_1.jpg

Language switcher shows that there is no translation for english, but if i access url site.com/en/about manualy it shows page with deafault language.

Is it right behavior? I think that it shoud throw 404 error instead of default language page, because there is no translation = no right content = no page for this url

So the question is: does it work like this or Im missing some settings or options? 

Thank.

Best community. 

  • Like 1
Link to comment
Share on other sites

The question about behavior is still actual, but for to change it i use this code in init.php

$currentLang = $user->language;
$pageLanguages = $page->getLanguages();
if(!$pageLanguages->has($currentLang)) {
    throw new Wire404Exception();
}

 

  • Like 3
  • Thanks 1
Link to comment
Share on other sites

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...