• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
set404Override - setLocale not working?

#1
Question 
Hi!

I'm just wondering why the controller set in set404Override() not listening to the selected locale. Is this a feature or a bug?
Any other controller is working properly.

app/Config/Routes.php
PHP Code:
$routes->set404Override('App\Controllers\Error::error_404'); 

app/Controllers/Error.php
PHP Code:
<?php namespace App\Controllers;
 
class 
Error extends BaseController {
  public function error_404() {
    echo $this->request->getLocale(); //Output: no (Norwegian)
 
    echo view('_includes/header_clean'); // Outputs data from en (English)
    echo view('main/main');              // Outputs data from en (English)
    echo view('_includes/footer_clean'); // Outputs data from en (English)
 
    echo $this->request->getLocale(); //Output: no (Norwegian)
  }

Reply

#2
Bump? No idea?
Reply

#3
Trying again. Bump
Reply

#4
What do you mean your view files output data in English? Are the views supposed to be multilingual?
Reply

#5
(09-28-2020, 02:24 AM)paulbalandan Wrote: What do you mean your view files output data in English? Are the views supposed to be multilingual?

All text in the view files is stored in the language files.
When language is selected all text should be read from that language.

It works on any page but, App\Controllers\Error::error_404

It seems to read browser's preferred language when hitting this page. Ignoring the selected language.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.