General developer forum

Users can't change language on my custom form page

 
Picture of Martin Greenaway
Re: Users can't change language on my custom form page
 

Well, this is now solved:

* As part of this custom form, I extract the values from custom user profile fields, many of which are defined with multilang values.

* These values need to be processed in order to ensure that the key is the english value, regardless of the language of the value.

* In doing this, I'm using force_current_language('en') to ensure I get the key in english, then doing force_current_language($prevlang) to put it back.

Something something something, force_current_language('') instead of ($prevlang), profit.

 
Average of ratings: -