function _l10n_pretext() { function load_localised_pref($name) { global $prefs, $pretext; $k = "snip-{$name}"; $r = gTxt($k); if ($r !== $k) { $GLOBALS[$name] = $r; $GLOBALS['prefs'][$name] = $r; $prefs[$name] = $r; $pretext[$name] = $r; } } global $l10n_language, $textarray, $prefs; $first_chunk = _l10n_process_url(); # # Now we know what language this user is browsing in. # If it is NOT the site's currently selected language then we need to re-load # the textarray with the right language (otherwise some strings used in comment forms # and older/newer tags will be wrong! # if (LANG !== $l10n_language['long'] and LANG !== $l10n_language['short']) { trace_add("L10N MLP: Switching to {$l10n_language['long']} from " . LANG); $textarray = load_lang($l10n_language['long']); $prefs['language'] = $l10n_language['long']; } load_localised_pref('site_slogan'); @($GLOBALS['prefs']['comments_default_invite'] = gTxt('comment')); # # Don't know why, but there seems to be some whitespace getting into the # output buffer. XHTML can cope but it causes a parse error in the feed xml # # Simple solution is to make sure the output buffer is empty before # continuing the processing of rss or atom requests... # $ob_cleaning = array('rss', 'atom'); if (in_array($first_chunk, $ob_cleaning)) { while (@ob_end_clean()) { } } }
function _l10n_pretext() { global $l10n_language, $textarray, $prefs; $first_chunk = _l10n_process_url(); # # Now we know what language this user is browsing in. # If it is NOT the site's currently selected language then we need to re-load # the textarray with the right language (otherwise some strings used in comment forms # and older/newer tags will be wrong! # if (LANG !== $l10n_language['long'] and LANG !== $l10n_language['short']) { trace_add("L10N MLP: Switching to {$l10n_language['long']} from " . LANG); $textarray = load_lang($l10n_language['long']); $prefs['language'] = $l10n_language['long']; } _l10n_load_localised_pref('site_slogan'); @($GLOBALS['prefs']['comments_default_invite'] = gTxt('comment')); $feeds = array('rss', 'atom'); if (in_array($first_chunk, $feeds)) { # Prevent the feed routine(s) from removing our handler! if (extension_loaded('zlib') && ini_get('zlib.output_compression') == 0 && ini_get('output_handler') != 'ob_gzhandler' && !headers_sent()) { @ob_start('ob_gzhandler'); if ($prefs['l10n_l10n-clean_feeds'] == '0') { ini_set('zlib.output_compression', 1); } } # Inject our language markers into the feed stream... @ob_start('_l10n_inject_' . $first_chunk . '_lang_markers'); } elseif ($first_chunk !== 'file_download') { @ob_start('_l10n_inject_lang_markers'); } }