Jump to content
  • 0

Question

Posted

after upgrading to v4.2, the Configure::set('Blesta.language', $language_code); and Language::setlang($language_code); in the event Appcontroller.preAction no longer take effect in blesta.  not should what it was changed in the core but what we thing is blesta should load all thier setting in the function before Appcontroller.preAction .

now we cant use the multi-languages system in blesta. !!!

9 answers to this question

Recommended Posts

  • 0
Posted

i have changed app_controller.php to a previos file of b4.1.1 and it worked fine now, so is something changed in v4.2. can the staff make loading language and setting it before the Appcontroller.preAction , we use it to set a lot of thing to override some blesta settings, language is one of it. without this Appcontroller.preAction is a useless event.

  • 0
Posted
  On 2/23/2018 at 12:49 AM, Blesta Addons said:

i have changed app_controller.php to a previos file of b4.1.1 and it worked fine now, so is something changed in v4.2. can the staff make loading language and setting it before the Appcontroller.preAction , we use it to set a lot of thing to override some blesta settings, language is one of it. without this Appcontroller.preAction is a useless event.

Expand  

There were definitely changes in that file. Since it's ionCube encoded, I can't tell exactly what the differences are.

  • 0
Posted
  On 2/23/2018 at 5:35 PM, Tyson said:

Blesta supports staff-configurable language now.

What is it you're changing the language for in your event?

Expand  

my snippet code was

			if (file_exists(LANGDIR . $language_code)
				&& ($this->Languages->get(Configure::get('Blesta.company_id'), $language_code))
			) {
				Configure::set('Blesta.language', $language_code);
				Language::setlang($language_code);
				return $language_code;
			} else {
				header("HTTP/1.1 404 Not Found");
				header("Location: ". str_replace('/'. CURRENTLANGUAGE .'/', '/',  WEBDIR));
			}

it was working , now not.

  • 0
Posted
  On 3/6/2018 at 12:46 AM, Tyson said:

Could you elaborate on your need to override the user's language in preAction? Do you have a link to an example?

Expand  

in the past, this code in preAction(), change the language used in blesta settings, now it doesn't do it .

				Configure::set('Blesta.language', $language_code);
				Language::setlang($language_code);

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...