Jump to content
  • 0

Set language no longer work


Blesta Addons

Question

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. !!!

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0

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.

Link to comment
Share on other sites

  • 0
4 hours ago, 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.

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

Link to comment
Share on other sites

  • 0
4 hours ago, Tyson said:

Blesta supports staff-configurable language now.

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

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.

Link to comment
Share on other sites

  • 0
10 minutes ago, Tyson said:

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

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);

 

Link to comment
Share on other sites

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.

Loading...
×
×
  • Create New...