From d8da0d3bca055c67ca0824fb0ed76bbae7cc10dc Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Mon, 2 Nov 2009 14:39:08 +0000 Subject: sample usage of labels --- it_text.class | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'it_text.class') diff --git a/it_text.class b/it_text.class index c82c750..1334c88 100644 --- a/it_text.class +++ b/it_text.class @@ -87,6 +87,10 @@ function it_text($p = array()) $this->initlang(it::match('\.([a-z]{2})\.[^./]+$', $_SERVER['PHP_SELF']), "setting language from url override"); $this->initlang($p['forcelanguage'], "setting language from programmer override"); + # Sample usage of text labels + if (!it::is_live() || rand(1, 100) == 1) + $GLOBALS['it_text_sampling'] = array(); + # Make this object available under $GLOBALS['it_text'], or add my texts to $GLOBALS['it_text'] if it exists if ($p['global']) { @@ -141,6 +145,9 @@ function text($label, $language = null) if ($GLOBALS['debug_texts'] && !preg_match('/submit|reset|button|_search$|service|claim/i', $label)) $text = "1, 'skipfiles'=>"text|auto_prepend")) . ")'>" . ($text ? $text : $label) . ""; + if (isset($GLOBALS['it_text_sampling'])) + $GLOBALS['it_text_sampling'][$label] = true; + return $text; } -- cgit v1.2.3