|
From: Florin C B. <ory...@us...> - 2013-04-05 07:34:21
|
Update of /cvsroot/mxbb/core/includes In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv12030 Modified Files: mx_functions.php Log Message: Index: mx_functions.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions.php,v retrieving revision 1.112 retrieving revision 1.113 diff -C2 -d -r1.112 -r1.113 *** mx_functions.php 5 Apr 2013 06:21:58 -0000 1.112 --- mx_functions.php 5 Apr 2013 07:34:19 -0000 1.113 *************** *** 2668,2704 **** function mx_t($string, array $args = array(), array $options = array()) { ! global $lang, $mx_cache; ! static $custom_strings; ! ! // Merge in default. ! if (empty($options['langcode'])) { ! $options['langcode'] = $lang['USER_LANG'] ? $lang['USER_LANG'] : $mx_user->encode_lang($board_config['default_lang']); ! } ! if (empty($options['context'])) { ! $options['context'] = ''; ! } ! ! // First, check for an array of customized strings. If present, use the array ! // *instead of* database lookups. ! // Cache the $custom_strings variable to improve performance. ! if (!isset($custom_strings[$options['langcode']])) ! { ! $custom_strings[$options['langcode']] = variable_get('locale_custom_strings_' . $options['langcode'], array()); ! } ! ! // Custom strings work for English. ! if (isset($custom_strings[$options['langcode']][$options['context']][$string])) ! { ! $string = $custom_strings[$options['langcode']][$options['context']][$string]; ! } ! ! if (empty($args)) ! { ! return $string; ! } ! else ! { ! return $mx_cache->format_string($string, $args); ! } } --- 2668,2694 ---- function mx_t($string, array $args = array(), array $options = array()) { ! global $lang, $mx_cache, $mx_user; ! static $lang_string; ! // Merge in default. ! if (empty($options['langcode'])) ! { ! $options['langcode'] = $lang['USER_LANG'] ? $lang['USER_LANG'] : $mx_user->encode_lang($board_config['default_lang']); ! } ! if (!isset($lang[$string])) ! { ! $lang_string = $lang[$string]; ! } ! else ! { ! $lang_string = $string; ! } ! if (empty($args)) ! { ! return $lang_string; ! } ! else ! { ! return $mx_cache->format_string($lang_string, $args); ! } } |