From: Geoffrey T. D. <da...@us...> - 2001-12-16 18:33:28
|
Update of /cvsroot/phpwiki/phpwiki/lib/plugin In directory usw-pr-cvs1:/tmp/cvs-serv13266/lib/plugin Modified Files: BackLinks.php Calendar.php FullTextSearch.php HelloWorld.php IncludePage.php LikePages.php MostPopular.php PageHistory.php RecentChanges.php TitleSearch.php _BackendInfo.php text2png.php Log Message: Refactor $WikiPlugin::name and $WikiPlugin::description stuff. It is best if all calls to gettext have constant, double-quoted strings as their arguments. (Otherwise xgettext won't find the strings for translation.) Also, a few other gettext cleanups. Index: BackLinks.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/BackLinks.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** BackLinks.php 2001/12/15 10:54:36 1.3 --- BackLinks.php 2001/12/16 18:33:25 1.4 *************** *** 6,11 **** extends WikiPlugin { ! var $name = 'BackLinks'; ! var $description = "Get BackLinks for [pagename]"; function getDefaultArguments() { --- 6,16 ---- extends WikiPlugin { ! function getName () { ! return _("BackLinks"); ! } ! ! function getDescription () { ! return _("Get BackLinks for [pagename]"); ! } function getDefaultArguments() { *************** *** 37,43 **** $html = ''; if (!$noheader) { ! $fs = $lines ! ? gettext("These pages link to %s:") ! : gettext("No pages link to %s."); $header = sprintf(htmlspecialchars($fs), LinkExistingWikiWord($page)); --- 42,46 ---- $html = ''; if (!$noheader) { ! $fs = $lines ? _("These pages link to %s:") : _("No pages link to %s."); $header = sprintf(htmlspecialchars($fs), LinkExistingWikiWord($page)); Index: Calendar.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/Calendar.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** Calendar.php 2001/12/15 10:54:40 1.3 --- Calendar.php 2001/12/16 18:33:25 1.4 *************** *** 21,27 **** extends WikiPlugin { ! var $name = 'Calendar'; ! var $description = 'Calendar'; ! function getDefaultArguments() { // FIXME: how to exclude multiple pages? --- 21,32 ---- extends WikiPlugin { ! function getName () { ! return _("Calendar"); ! } ! ! function getDescription () { ! return _("Calendar"); ! } ! function getDefaultArguments() { // FIXME: how to exclude multiple pages? *************** *** 107,111 **** 'href' => WikiURL($page_for_date, array('action' => 'edit')), ! 'title' => "Edit $page_for_date"), $t['tm_mday']); } --- 112,116 ---- 'href' => WikiURL($page_for_date, array('action' => 'edit')), ! 'title' => sprintf(_("Edit %s"), $page_for_date)), $t['tm_mday']); } Index: FullTextSearch.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/FullTextSearch.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** FullTextSearch.php 2001/12/16 11:52:30 1.3 --- FullTextSearch.php 2001/12/16 18:33:25 1.4 *************** *** 9,14 **** extends WikiPlugin { ! var $name = 'FullTextSearch'; ! var $description = 'FullTextSearch'; function getDefaultArguments() { --- 9,19 ---- extends WikiPlugin { ! function getName () { ! return _("FullTextSearch"); ! } ! ! function getDescription () { ! return _("Full Text Search"); ! } function getDefaultArguments() { *************** *** 18,26 **** } - function getDefaultFormArguments() { - $defaults = parent::getDefaultFormArguments(); - $defaults['description'] = gettext('Full Text Search'); - return $defaults; - } function run($dbi, $argstr, $request) { --- 23,26 ---- *************** *** 50,56 **** if (!$noheader) $html .= QElement('p', ! sprintf(gettext("Full text search results for '%s'"), $s)); if (!$lines) ! $lines[] = QElement('dd', gettext("<no matches>")); $html .= Element('dl', join("\n", $lines)); --- 50,56 ---- if (!$noheader) $html .= QElement('p', ! sprintf(_("Full text search results for '%s'"), $s)); if (!$lines) ! $lines[] = QElement('dd', _("<no matches>")); $html .= Element('dl', join("\n", $lines)); *************** *** 72,81 **** } return $html; - } - - function make_form($args) { - // FIXME: need more thought about this whole interface. - $args['search'] = '()'; - return MakeWikiForm(_($GLOBALS['pagename']), $args, 'wikiaction','Full Text Search'); } }; --- 72,75 ---- Index: HelloWorld.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/HelloWorld.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** HelloWorld.php 2001/12/15 10:54:49 1.3 --- HelloWorld.php 2001/12/16 18:33:25 1.4 *************** *** 7,20 **** extends WikiPlugin { ! var $name = "HelloWorld"; ! var $description = "PhpWiki"; function getDefaultArguments() { ! return array('salutation' => 'Hello,', ! 'name' => 'World'); } ! function run($argstr) { ! extract($this->parseArgs($argstr)); return sprintf("<tt>%s %s</tt>", $salutation, $name); --- 7,25 ---- extends WikiPlugin { ! function getName () { ! return _("HelloWorld"); ! } ! ! function getDescription () { ! return _("Simple Sample Plugin"); ! } function getDefaultArguments() { ! return array('salutation' => "Hello,", ! 'name' => "World"); } ! function run($dbi, $argstr, $request) { ! extract($this->getArgs($argstr, $request)); return sprintf("<tt>%s %s</tt>", $salutation, $name); Index: IncludePage.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/IncludePage.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** IncludePage.php 2001/12/16 16:52:45 1.3 --- IncludePage.php 2001/12/16 18:33:25 1.4 *************** *** 12,18 **** extends WikiPlugin { ! var $name='IncludePage'; ! var $description='Embeds text from another page.'; ! function getDefaultArguments() { return array( 'page' => false, // the page to include --- 12,19 ---- extends WikiPlugin { ! function getName() { ! return _("IncludePage"); ! } ! function getDefaultArguments() { return array( 'page' => false, // the page to include Index: LikePages.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/LikePages.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** LikePages.php 2001/12/15 10:54:54 1.2 --- LikePages.php 2001/12/16 18:33:25 1.3 *************** *** 9,15 **** extends WikiPlugin { ! var $name = 'LikePages'; ! var $description = "List LikePages for [pagename]"; ! function getDefaultArguments() { // FIXME: how to exclude multiple pages? --- 9,20 ---- extends WikiPlugin { ! function getName() { ! return _("LikePages"); ! } ! ! function getDescription() { ! return _("List LikePages for [pagename]"); ! } ! function getDefaultArguments() { // FIXME: how to exclude multiple pages? *************** *** 32,41 **** $suffix = false; if (!$noheader) ! $html .= QElement('p', sprintf(gettext("Page names with prefix '%s'"), $prefix)); } elseif ($suffix) { if (!$noheader) ! $html .= QElement('p', sprintf(gettext("Page names with suffix '%s'"), $suffix)); } --- 37,46 ---- $suffix = false; if (!$noheader) ! $html .= QElement('p', sprintf(_("Page names with prefix '%s'"), $prefix)); } elseif ($suffix) { if (!$noheader) ! $html .= QElement('p', sprintf(_("Page names with suffix '%s'"), $suffix)); } *************** *** 46,53 **** list($suffix) = array_reverse($words); $exclude = $page; ! ! $fs = gettext("These pages share an initial or final title word with '%s'"); ! if (!$noheader) $html .= Element('p', sprintf(htmlspecialchars($fs), LinkWikiWord($page))); } --- 51,59 ---- list($suffix) = array_reverse($words); $exclude = $page; ! ! if (!$noheader) { ! $fs = _("These pages share an initial or final title word with '%s'"); $html .= Element('p', sprintf(htmlspecialchars($fs), LinkWikiWord($page))); + } } Index: MostPopular.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/MostPopular.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** MostPopular.php 2001/12/16 07:33:56 1.3 --- MostPopular.php 2001/12/16 18:33:25 1.4 *************** *** 6,11 **** extends WikiPlugin { ! var $name = 'MostPopular'; ! var $description = 'MostPopular'; function getDefaultArguments() { --- 6,16 ---- extends WikiPlugin { ! function getName () { ! return _("MostPopular"); ! } ! ! function getDescription () { ! return _("List the most popular pages"); ! } function getDefaultArguments() { *************** *** 20,25 **** $pages = $dbi->mostPopular($limit); ! $lines[] = $this->_tr(QElement('u', gettext("Hits")), ! QElement('u', gettext("Page Name"))); while ($page = $pages->next()) { --- 25,30 ---- $pages = $dbi->mostPopular($limit); ! $lines[] = $this->_tr(QElement('u', _("Hits")), ! QElement('u', _("Page Name"))); while ($page = $pages->next()) { Index: PageHistory.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/PageHistory.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** PageHistory.php 2001/12/15 10:55:02 1.3 --- PageHistory.php 2001/12/16 18:33:25 1.4 *************** *** 197,202 **** extends WikiPlugin_RecentChanges { ! var $name = 'PageHistory'; ! var $description = "List PageHistory for [pagename]"; function getDefaultArguments() { --- 197,207 ---- extends WikiPlugin_RecentChanges { ! function getName () { ! return _("PageHistory"); ! } ! ! function getDescription () { ! return _("List PageHistory for [pagename]"); ! } function getDefaultArguments() { Index: RecentChanges.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/RecentChanges.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** RecentChanges.php 2001/12/15 17:03:45 1.10 --- RecentChanges.php 2001/12/16 18:33:25 1.11 *************** *** 304,310 **** extends WikiPlugin { ! var $name = 'RecentChanges'; ! var $description = 'RecentChanges'; ! function getDefaultArguments() { return array('days' => 2, --- 304,311 ---- extends WikiPlugin { ! function getName () { ! return _("RecentChanges"); ! } ! function getDefaultArguments() { return array('days' => 2, Index: TitleSearch.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/TitleSearch.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** TitleSearch.php 2001/12/15 10:55:16 1.3 --- TitleSearch.php 2001/12/16 18:33:25 1.4 *************** *** 9,14 **** extends WikiPlugin { ! var $name = 'TitleSearch'; ! var $description = 'TitleSearch'; function getDefaultArguments() { --- 9,19 ---- extends WikiPlugin { ! function getName () { ! return _("TitleSearch"); ! } ! ! function getDescription () { ! return _("Title Search"); ! } function getDefaultArguments() { *************** *** 18,27 **** } - function getDefaultFormArguments() { - $defaults = parent::getDefaultFormArguments(); - $defaults['description'] = 'Title Search'; - return $defaults; - } - function run($dbi, $argstr, $request) { --- 23,26 ---- *************** *** 47,55 **** if (!$noheader) $html .= QElement('p', ! sprintf(gettext("Title search results for '%s'"), $s)); if ($lines) $html .= Element('ul', join("\n", $lines)); else ! $html .= Element('dl', QElement('dd', gettext("<no matches>"))); return $html; --- 46,54 ---- if (!$noheader) $html .= QElement('p', ! sprintf(_("Title search results for '%s'"), $s)); if ($lines) $html .= Element('ul', join("\n", $lines)); else ! $html .= Element('dl', QElement('dd', _("<no matches>"))); return $html; Index: _BackendInfo.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/_BackendInfo.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** _BackendInfo.php 2001/12/15 10:54:31 1.2 --- _BackendInfo.php 2001/12/16 18:33:25 1.3 *************** *** 7,12 **** extends WikiPlugin { ! var $name = '_BackendInfo'; ! var $description = "Get debugging information for [pagename]."; function WikiPlugin__BackendInfo() { --- 7,17 ---- extends WikiPlugin { ! function getName () { ! return _("DebugInfo"); ! } ! ! function getDescription () { ! return _("Get debugging information for [pagename]."); ! } function WikiPlugin__BackendInfo() { *************** *** 38,42 **** $html = QElement('h3', ! "Querying backend directly for '$page'"); --- 43,47 ---- $html = QElement('h3', ! sprintf(_("Querying backend directly for '%s'"), $page)); *************** *** 44,48 **** $pagedata = $backend->get_pagedata($page); if (!$pagedata) ! $html .= QElement('p', "No pagedata for $page\n"); else { ksort($pagedata); --- 49,53 ---- $pagedata = $backend->get_pagedata($page); if (!$pagedata) ! $html .= QElement('p', sprintf(_("No pagedata for %s\n"), $page)); else { ksort($pagedata); Index: text2png.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/text2png.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** text2png.php 2001/12/15 10:55:12 1.4 --- text2png.php 2001/12/16 18:33:25 1.5 *************** *** 7,17 **** extends WikiPlugin { ! var $name = 'text2png'; ! var $description = 'text2png'; function getDefaultArguments() { ! global $LANG; ! return array('text' => "Hello WikiWorld!", ! 'l' => $LANG ); } --- 7,18 ---- extends WikiPlugin { ! function getName () { ! return "text2png"; ! } function getDefaultArguments() { ! global $LANG; ! return array('text' => "Hello WikiWorld!", ! 'l' => $LANG ); } |