By gábor hojtsy on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.x
Issue links:
Description:
You can now load a language by its language code with a dedicated load function.
Drupal 7:
$languages = language_list();
$language = $languages[$langcode];
Drupal 8:
$language = language_load($langcode);
Comments
Changing the current language
We needed to change the language as part of the checkout processes of a Drupal 7 commerce site
The following code did not work:
however assigning the properties of $new_language to $language did work:
Guy Schneerson
Main Site: www.blue-bag.com
Technology Blog: http://technology.blue-bag.com