From: Carsten K. <car...@us...> - 2001-12-28 09:53:27
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv13875/phpwiki/lib Modified Files: stdlib.php Log Message: Found more strings needing gettext _() and sprintf. Error strings containing function names now use sprintf. Some debugging strings intentionally left alone. Index: stdlib.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/stdlib.php,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -r1.62 -r1.63 *** stdlib.php 2001/12/26 10:40:13 1.62 --- stdlib.php 2001/12/28 09:53:24 1.63 *************** *** 132,136 **** return Element('strong', QElement('u', array('class' => 'baduri'), ! _("BAD URL -- remove all of <, >, \""))); //" } --- 132,136 ---- return Element('strong', QElement('u', array('class' => 'baduri'), ! _("BAD URL -- remove all of <, >, \""))); } *************** *** 194,201 **** // FIXME: Is this needed (or sufficient?) // As long as the src in htmlspecialchars()ed I think it's safe. ! if(ereg('[<>"]', $url)) { return Element('strong', QElement('u', array('class' => 'baduri'), ! 'BAD URL -- remove all of <, >, "')); } return Element('img', array('src' => $url, 'alt' => $alt)); --- 194,201 ---- // FIXME: Is this needed (or sufficient?) // As long as the src in htmlspecialchars()ed I think it's safe. ! if(ereg("[<>\"]", $url)) { return Element('strong', QElement('u', array('class' => 'baduri'), ! _("BAD URL -- remove all of <, >, \""))); } return Element('img', array('src' => $url, 'alt' => $alt)); *************** *** 457,461 **** $txt = QElement('strong', ! sprintf (gettext ("%d best incoming links:"), NUM_RELATED_PAGES)); for($i = 0; $i < NUM_RELATED_PAGES; $i++) { if(isset($links['in'][$i])) { --- 457,461 ---- $txt = QElement('strong', ! sprintf (_("%d best incoming links:"), NUM_RELATED_PAGES)); for($i = 0; $i < NUM_RELATED_PAGES; $i++) { if(isset($links['in'][$i])) { *************** *** 467,471 **** $txt .= "\n" . Element('br'); $txt .= Element('strong', ! sprintf (gettext ("%d best outgoing links:"), NUM_RELATED_PAGES)); for($i = 0; $i < NUM_RELATED_PAGES; $i++) { if(isset($links['out'][$i])) { --- 467,471 ---- $txt .= "\n" . Element('br'); $txt .= Element('strong', ! sprintf (_("%d best outgoing links:"), NUM_RELATED_PAGES)); for($i = 0; $i < NUM_RELATED_PAGES; $i++) { if(isset($links['out'][$i])) { *************** *** 478,482 **** $txt .= "\n" . Element('br'); $txt .= Element('strong', ! sprintf (gettext ("%d most popular nearby:"), NUM_RELATED_PAGES)); for($i = 0; $i < NUM_RELATED_PAGES; $i++) { if(isset($links['popular'][$i])) { --- 478,482 ---- $txt .= "\n" . Element('br'); $txt .= Element('strong', ! sprintf (_("%d most popular nearby:"), NUM_RELATED_PAGES)); for($i = 0; $i < NUM_RELATED_PAGES; $i++) { if(isset($links['popular'][$i])) { *************** *** 530,538 **** $html = Element('p', QElement('strong', gettext("Bad Version"))) . "\n"; $html .= QElement('p', ! sprintf(gettext("I'm sorry. Version %d of %s is not in my database."), $version, $page->getName())) . "\n"; include_once('lib/Template.php'); ! echo GeneratePage('MESSAGE', $html, gettext("Bad Version")); ExitWiki (""); } --- 530,538 ---- $html = Element('p', QElement('strong', gettext("Bad Version"))) . "\n"; $html .= QElement('p', ! sprintf(_("I'm sorry. Version %d of %s is not in my database."), $version, $page->getName())) . "\n"; include_once('lib/Template.php'); ! echo GeneratePage('MESSAGE', $html, _("Bad Version")); ExitWiki (""); } *************** *** 682,686 **** // PHP doesn't support this. if (preg_match('/(?<!%)%[- ]?\d*[^- \d$]/x', $fmt)) ! trigger_error("Can't mix '%1\$s' with '%s' type format strings", E_USER_WARNING); $fmt = preg_replace('/(?<!%)%\d+\$/x', '%', $fmt); --- 682,686 ---- // PHP doesn't support this. if (preg_match('/(?<!%)%[- ]?\d*[^- \d$]/x', $fmt)) ! trigger_error(sprintf(_("Can't mix '%s' with '%s' type format strings"),'%1\$s','%s'), E_USER_WARNING); $fmt = preg_replace('/(?<!%)%\d+\$/x', '%', $fmt); *************** *** 690,694 **** foreach($m[1] as $argnum) { if ($argnum < 1 || $argnum > count($args)) ! trigger_error("$argnum: argument index out of range", E_USER_WARNING); $newargs[] = $args[$argnum - 1]; } --- 690,694 ---- foreach($m[1] as $argnum) { if ($argnum < 1 || $argnum > count($args)) ! trigger_error(sprintf(_("%s: argument index out of range"),$argnum), E_USER_WARNING); $newargs[] = $args[$argnum - 1]; } |