/** * @deprecated * * Loads received language variables into language cache * * @param array $var_names Language variable that to be loaded * @param string $lang_code 2-letter language code * * @return boolean True if any of received language variables were added into cache; false otherwise */ function fn_preload_lang_vars($var_names, $lang_code = CART_LANGUAGE) { return LanguageHelper::preloadLangVars($var_names, $lang_code); }
/** * Gets block descriptions * @param array $blocks blocks list * @param string $lang_code language code * @return array blocks list with descriptions */ public static function getBlockDescriptions($blocks, $lang_code = CART_LANGUAGE) { $descriptions = array(); foreach ($blocks as $type => $block) { $descriptions[$type] = 'block_' . $type . '_description'; } LanguageHelper::preloadLangVars($descriptions, $lang_code); foreach ($blocks as $type => $block) { $description = __($descriptions[$type], array(), $lang_code); // language variable does not exist if ($description == '_' . $descriptions[$type]) { $description = ''; } $blocks[$type]['description'] = $description; } return $blocks; }