summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--it_text.class7
1 files changed, 7 insertions, 0 deletions
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 = "<span style='background:#8F8' title='$label (" . it_debug::backtrace(array('levels'=>1, 'skipfiles'=>"text|auto_prepend")) . ")'>" . ($text ? $text : $label) . "</span>";
+ if (isset($GLOBALS['it_text_sampling']))
+ $GLOBALS['it_text_sampling'][$label] = true;
+
return $text;
}