Sign in to follow this  
Followers 0
Fuad Ibrahimov

Problem with default language

2 posts in this topic

Hi all!
I have a problem with selecting default language in frontend.

I tried to set default language from admin panel in Access->Users for guests and admin to another language, but it changed only backend language.

I read a lot of topics about this problem and i didn't find any normal solution.

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Marcel Stäheli
      Hello
      if have a few article pages that have a multi-page reference field with tags about the content of the article. All tags of a given page are displayed and link to a tag-overview page.
      Every link has a query string added with the tag name like &tag=cars so that I know which articles have to be displayed on the tag-overview page,
      The tag name is created using $tag->name. Since the website is multi language using German (default) and English, I use $page->localName($language) to get the localized page name . The code looks like this:
      foreach($tags as $tag) { $tagsMarkup .= "<a href='" . wire('pages')->get('/tags-overview/')->url . "?tag=" . $tag->localName(wire('user')->language) . "'>" . $tag->title . "</a>, "; }
      The code works mostly fine, but when a page has the same name in both languages, the query string will have no value just ?tag=. Why?
       
      A second problem that might be tied to the first:
      Once on that tags-overview page, I check if the tag actually exists using:
       
      $allTags = $pages->get("/tags/")->children); if($allTags->has("name=$tag") {...} But as I read on the forum (https://processwire.com/talk/topic/2979-multi-language-page-names-urls/?page=6) that only checks for name in the default language. It was suggested to use $page->parent->path . "pageNameEnglish" but I'm not sure where and how to use it in my case.
      Any help?
       
    • By Ibrahim El Haddad
      Hi guys, 
      Yesterday, I faced a problems to run a processwire old system from backup locally, finally after your support, the system start working but still I have the below problems issues. 
      1. Once I try to press a sub-link, it guides me to Object not found, Error 404  similar to the below , and the link of the website became like below: 
      http://www.www.www.www.www.www.www.www.www.www.www.www.www.www.www.www.www.www.www.www.localhost:9999/publications-and-ressources/texts/books/
      despite of that my application name is ibrahem, so if I amend the url manually to be as 
      http://www.www.www.www.www.www.www.www.www.www.www.www.www.www.www.www.www.www.www.www.localhost:9999/ibrahem/publications-and-ressources/texts/books/
      it works fine, but every link, i should amend the url to add the application name. 
      Object not found!
      The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.
      If you think this is a server error, please contact the webmaster.
      Error 404
       
      2. The images issues, that the images related to the book cover or another issue such as the slider is not appear, please advice.
       
      Thank you in advance for all of your support and help. 
       
    • By Alex L
      Hello Community,

      I have read that I get no support on GitHub. For this reason I am here for the second time.

      The thing is that I enabled a fresh Processwire installation and under https://processwire.wpzweinull.ch/processwire no page is found.

      The admin login is thus not possible. How can I fix the problem?

      Thanks in advance, Alexander
    • By FIA2008
      I'm trying to create tests using PHPUnit, and I have the following method:
      protected function _getRootItems(Page $currentPage) { /** @var Page $page */ foreach (wire('pages')->find("has_parent!=2,id!=2|7,status<" . Page::statusTrash . ",include=all") as $page) { if ($this->_isActivePage($page) && $page->parent_id == 1) { $output[$page->sort] = [ 'id' => $page->id, 'title' => $page->title, 'url' => $page->url, 'template' => $page->template->name, 'isActive' => $page->id == $currentPage->rootParent->id, 'children' => [] ]; } } ksort($output); return $output; } I want to write a test for this method in PHPUnit. I end up with the error: Trying to get property of non-object
      This is because $currentPage->rootParent is null.
      My test looks like this:
      public function testGetRootItems() { $mock = $this ->__getMock() ->disableOriginalConstructor() ->setMethods([ '_isActive' ]) ->getMock(); $mock ->expects($this->any()) ->method('_isActive') ->willReturn(false); $page = $this ->getMockBuilder(\ProcessWire\Page::class) ->disableOriginalConstructor() ->setMethods([ '__get' ]) ->getMock(); $rootParent = $this ->getMockBuilder(\ProcessWire\Page::class) ->disableOriginalConstructor() ->setMethods([ '__get' ]) ->getMock(); $template = $this ->getMockBuilder(\ProcessWire\Template::class) ->disableOriginalConstructor() ->setMethods([ '__get' ]) ->getMock(); $template->name = 'name of the template'; $rootParent->id = 1; $page->template = $template; $page->id = 2; $page->rootParent = 'hierzo!'; var_dump( $page->rootParent ); $method = $this->__getReflectionMethod('_getRootItems', $mock); $method->invoke( $mock, $page ); } I've already tried to override the rootParent with it's method (___rootParent), tried setting it directly ($page->rootParent) but so far nothing worked. I probably miss something really simple here.
      I know that in my example, I set the value to a string. But the result of the var_dump below it is still NULL. I also tried setting it using $page->rootParent = $rootParent, this had no effect.
       
      So my question: How can I possible override this rootParent variable?
    • By Alfonso Rodriguez
      Hello, i am new in the processwire. I tried to install pw in my server a few time but nothing happen. I saw a video on youtube how its installed but the las step was not finish. I tried two diferente versions, the 3.0.42 master version and the 2.8.35 legacy master version, even i tried to install the beginner page and the classic page but the result was the same. 
      I take an screenshot of the last step.
      Thanks for you time.