You are here

function themekey_locale_dummy2language_from_browser in ThemeKey 7.3

ThemeKey mapping function to set a ThemeKey property's value (destination) with the aid of another ThemeKey property (source).

src: system:dummy dst: locale:language_from_browser

Parameters

$dummy: string containing current value of ThemeKey property system:dummy

Return value

The language code as string or NULL

1 string reference to 'themekey_locale_dummy2language_from_browser'
themekey_locale_themekey_properties in modules/themekey.locale.inc
Implements hook_themekey_properties().

File

modules/themekey.locale.inc, line 97
Provides some node attributes as ThemeKey properties.

Code

function themekey_locale_dummy2language_from_browser($dummy) {

  // This implementation is simple but too expensive to be handled by
  // themekey_locale_themekey_global() on every page request.
  $langcode = locale_language_from_browser(language_list());
  return $langcode ? $langcode : NULL;
}