From f0d59a5f995838ed7a19d4fe1c45ebbc67eea1d6 Mon Sep 17 00:00:00 2001 From: rurban Date: Sat, 12 Feb 2005 17:24:24 +0000 Subject: [PATCH] locale update: missing . : fixed. unified strings proper linebreaks git-svn-id: svn://svn.code.sf.net/p/phpwiki/code/trunk@4582 96ab9672-09ca-45d6-a79d-3d69d39ca109 --- lib/WikiPlugin.php | 10 ++--- lib/plugin/AppendText.php | 10 +++-- lib/plugin/UpLoad.php | 15 ++++--- lib/plugin/WikiAdminRename.php | 14 +++++-- lib/plugin/WikiAdminSetAcl.php | 15 ++++--- lib/plugin/WikiAdminUtils.php | 6 +-- lib/plugin/_WikiTranslation.php | 25 +++++++----- lib/stdlib.php | 7 +++- lib/upgrade.php | 71 ++++++++++++++++++++++----------- 9 files changed, 110 insertions(+), 63 deletions(-) diff --git a/lib/WikiPlugin.php b/lib/WikiPlugin.php index 578793449..2a61e26ab 100644 --- a/lib/WikiPlugin.php +++ b/lib/WikiPlugin.php @@ -1,5 +1,5 @@ _error(sprintf(_("Include of '%s' failed"), + return $this->_error(sprintf(_("Include of '%s' failed."), $plugin_source)); return $this->_error(sprintf(_("%s: no such class"), $plugin_class)); } @@ -506,7 +506,7 @@ class WikiPluginLoader { $ErrorManager->popErrorHandler(); $plugin = new $plugin_class; if (!is_subclass_of($plugin, "WikiPlugin")) - return $this->_error(sprintf(_("%s: not a subclass of WikiPlugin"), + return $this->_error(sprintf(_("%s: not a subclass of WikiPlugin."), $plugin_class)); $plugin->_pi = $pi; diff --git a/lib/plugin/AppendText.php b/lib/plugin/AppendText.php index a89a0ec82..d1f05b04a 100644 --- a/lib/plugin/AppendText.php +++ b/lib/plugin/AppendText.php @@ -1,5 +1,5 @@ pushContent(sprintf(_("%s not found. Appending at the end.\n"), $notfound)); + $message->pushContent(sprintf(_("%s not found"), $notfound).". ". + _("Appending at the end.")."\n"); return $oldtext . "\n" . $addtext; } @@ -136,6 +137,9 @@ extends WikiPlugin }; // $Log: not supported by cvs2svn $ +// Revision 1.5 2004/11/26 18:39:02 rurban +// new regex search parser and SQL backends (90% complete, glob and pcre backends missing) +// // Revision ext-1.4 2004/11/25 15:39:40 Pascal Giard // * Directly including modified page when AppendText got called from // the page to be modified. diff --git a/lib/plugin/UpLoad.php b/lib/plugin/UpLoad.php index eeefb85dd..c6a7083cf 100644 --- a/lib/plugin/UpLoad.php +++ b/lib/plugin/UpLoad.php @@ -1,5 +1,5 @@ pushContent(fmt("ERROR uploading '%s': ",$userfile_name)); - $message->pushContent(fmt("Files with extension %s are not allowed", + $message->pushContent(fmt("Files with extension %s are not allowed.", join(", ", $this->disallowed_extensions)),HTML::br(),HTML::br()); } elseif (preg_match("/[^._a-zA-Z0-9-]/", $userfile_name)) @@ -152,12 +152,12 @@ ws[cfh]"); } elseif (file_exists($file_dir . $userfile_name)) { $message->pushContent(fmt("ERROR uploading '%s': ",$userfile_name)); - $message->pushContent(fmt("There is already a file with name %s uploaded", + $message->pushContent(fmt("There is already a file with name %s uploaded.", $userfile_name),HTML::br(),HTML::br()); } elseif ($userfile->getSize() > (MAX_UPLOAD_SIZE)) { $message->pushContent(fmt("ERROR uploading '%s': ",$userfile_name)); - $message->pushContent(_("Sorry but this file is too big"),HTML::br(),HTML::br()); + $message->pushContent(_("Sorry but this file is too big."),HTML::br(),HTML::br()); } elseif (move_uploaded_file($userfile_tmpname, $file_dir . $userfile_name) or (IsWindows() and rename($userfile_tmpname, $file_dir . $userfile_name)) @@ -207,11 +207,11 @@ ws[cfh]"); global $WikiTheme; $user = $GLOBALS['request']->_user; if (!is_writable($upload_log)) { - $message->pushContent(_("Error: the upload log is not writable")); + $message->pushContent(_("Error: the upload log is not writable.")); $message->pushContent(HTML::br()); } elseif (!$log_handle = fopen ($upload_log, "a")) { - $message->pushContent(_("Error: can't open the upload logfile")); + $message->pushContent(_("Error: can't open the upload logfile.")); $message->pushContent(HTML::br()); } else { // file size in KB; precision of 0.1 @@ -234,6 +234,9 @@ ws[cfh]"); } // $Log: not supported by cvs2svn $ +// Revision 1.17 2004/11/09 08:15:50 rurban +// trim filename +// // Revision 1.16 2004/10/21 19:03:37 rurban // Be more stricter with uploads: Filenames may only contain alphanumeric // characters. Patch #1037825 diff --git a/lib/plugin/WikiAdminRename.php b/lib/plugin/WikiAdminRename.php index 12690103f..e9bed5f25 100644 --- a/lib/plugin/WikiAdminRename.php +++ b/lib/plugin/WikiAdminRename.php @@ -1,5 +1,5 @@ pushContent(HTML::strong(_("Type: ")), HTML::tt($type),HTML::br()); - $header->pushContent(HTML::strong(_("getfacl: ")), pagePermissionsSimpleFormat($perm_tree, $owner),HTML::br()); - $header->pushContent(HTML::strong(_("ACL: ")), HTML::tt($perm->asAclLines()),HTML::br()); + $header->pushContent(HTML::strong(_("Type").': '), HTML::tt($type),HTML::br()); + $header->pushContent(HTML::strong(_("getfacl").': '), pagePermissionsSimpleFormat($perm_tree, $owner),HTML::br()); + $header->pushContent(HTML::strong(_("ACL").': '), HTML::tt($perm->asAclLines()),HTML::br()); - $header->pushContent(HTML::p(HTML::strong(_("Description: ")), + $header->pushContent(HTML::p(HTML::strong(_("Description").': '), _("Selected Grant checkboxes allow access, unselected checkboxes deny access."), _("To ignore delete the line."), _("To add check 'Add' near the dropdown list.") @@ -278,6 +278,9 @@ class _PageList_Column_perm extends _PageList_Column { }; // $Log: not supported by cvs2svn $ +// Revision 1.22 2005/01/25 08:05:17 rurban +// protect against !ENABLE_PAGEPERM +// // Revision 1.21 2004/11/23 15:17:20 rurban // better support for case_exact search (not caseexact for consistency), // plugin args simplification: diff --git a/lib/plugin/WikiAdminUtils.php b/lib/plugin/WikiAdminUtils.php index 8d949728d..6b9e23f84 100644 --- a/lib/plugin/WikiAdminUtils.php +++ b/lib/plugin/WikiAdminUtils.php @@ -1,5 +1,5 @@ run consistency: request as reference, added basepage. // encountered strange bug in AllPages (and the test) which destroys ->_dbi diff --git a/lib/stdlib.php b/lib/stdlib.php index d5ff4e916..4e02a10c1 100644 --- a/lib/stdlib.php +++ b/lib/stdlib.php @@ -1,4 +1,4 @@ - */ function loadPhpExtension($extension) { if (!extension_loaded($extension)) { @@ -1956,6 +1956,9 @@ function getMemoryUsage() { } // $Log: not supported by cvs2svn $ +// Revision 1.236 2005/02/08 13:41:32 rurban +// add rand_ascii +// // Revision 1.235 2005/02/04 11:54:48 rurban // fix Talk: names // diff --git a/lib/upgrade.php b/lib/upgrade.php index 6622302f0..f27b6ec13 100644 --- a/lib/upgrade.php +++ b/lib/upgrade.php @@ -1,5 +1,5 @@ \n"; + echo " ",_("FAILED"),": ",sprintf(_("no schema %s found"), + "schemas/${backend_type}.sql")," ...
\n"; return false; } */ @@ -288,7 +289,8 @@ CREATE TABLE $rating_tbl ( rateeversion INT(11) NOT NULL, tstamp TIMESTAMP(14) NOT NULL, )"); - $dbh->genericSqlQuery("CREATE UNIQUE INDEX rating ON $rating_tbl (dimension, raterpage, rateepage)"); + $dbh->genericSqlQuery("CREATE UNIQUE INDEX rating" + ." ON $rating_tbl (dimension, raterpage, rateepage)"); } echo " ",_("CREATED"); break; @@ -425,11 +427,13 @@ function CheckDatabaseUpdate(&$request) { } while ($col = $iter->next()) { if ($col["Field"] == 'sess_id' and !strstr(strtolower($col["Type"]), 'char(32)')) { - $dbh->genericSqlQuery("ALTER TABLE $session_tbl CHANGE sess_id sess_id CHAR(32) NOT NULL"); + $dbh->genericSqlQuery("ALTER TABLE $session_tbl CHANGE sess_id" + ." sess_id CHAR(32) NOT NULL"); echo "sess_id ", $col["Type"], " ", _("fixed"), " => CHAR(32) "; } if ($col["Field"] == 'sess_ip' and !strstr(strtolower($col["Type"]), 'char(15)')) { - $dbh->genericSqlQuery("ALTER TABLE $session_tbl CHANGE sess_ip sess_ip CHAR(15) NOT NULL"); + $dbh->genericSqlQuery("ALTER TABLE $session_tbl CHANGE sess_ip" + ." sess_ip CHAR(15) NOT NULL"); echo "sess_ip ", $col["Type"], " ", _("fixed"), " => CHAR(15) "; } } @@ -459,7 +463,8 @@ function CheckDatabaseUpdate(&$request) { } $row = $dbh->_backend->getRow($query); if (isset($row[0]) and $row[0] == 'N') { - $dbh->genericSqlQuery("UPDATE mysql.db SET lock_tables_priv='Y' WHERE mysql.user='$username'"); + $dbh->genericSqlQuery("UPDATE mysql.db SET lock_tables_priv='Y'" + ." WHERE mysql.user='$username'"); $dbh->genericSqlQuery("FLUSH PRIVILEGES"); echo "mysql.db user='$username'", _("fixed"), "
\n"; } elseif (!$row) { @@ -467,12 +472,14 @@ function CheckDatabaseUpdate(&$request) { $query = "SELECT lock_tables_priv FROM mysql.user WHERE user='$username'"; $row = $dbh->_backend->getRow($query); if ($row and $row[0] == 'N') { - $dbh->genericSqlQuery("UPDATE mysql.user SET lock_tables_priv='Y' WHERE mysql.user='$username'"); + $dbh->genericSqlQuery("UPDATE mysql.user SET lock_tables_priv='Y'" + ." WHERE mysql.user='$username'"); $dbh->genericSqlQuery("FLUSH PRIVILEGES"); echo "mysql.user user='$username'", _("fixed"), "
\n"; } elseif (!$row) { echo " ", _("FAILED"), ": ", - "Neither mysql.db nor mysql.user has a user='$username' or the lock_tables_priv field", + "Neither mysql.db nor mysql.user has a user='$username'" + ." or the lock_tables_priv field", "
\n"; } else { echo _("OK"), "
\n"; @@ -488,7 +495,8 @@ function CheckDatabaseUpdate(&$request) { // 1.3.10 mysql requires page.id auto_increment // mysql, mysqli or mysqlt - if (phpwiki_version() >= 1030.099 and substr($backend_type,0,5) == 'mysql' and $DBParams['dbtype'] != 'PDO') { + if (phpwiki_version() >= 1030.099 and substr($backend_type,0,5) == 'mysql' + and $DBParams['dbtype'] != 'PDO') { echo _("check for mysql page.id auto_increment flag")," ..."; assert(!empty($page_tbl)); $database = $dbh->_backend->database(); @@ -502,7 +510,8 @@ function CheckDatabaseUpdate(&$request) { echo "",_("ADDING"),""," ... "; // MODIFY col_def valid since mysql 3.22.16, // older mysql's need CHANGE old_col col_def - $dbh->genericSqlQuery("ALTER TABLE $page_tbl CHANGE id id INT NOT NULL AUTO_INCREMENT"); + $dbh->genericSqlQuery("ALTER TABLE $page_tbl CHANGE id" + ." id INT NOT NULL AUTO_INCREMENT"); $fields = mysql_list_fields($database, $page_tbl); if (!strstr(strtolower(mysql_field_flags($fields, $i)), "auto_increment")) echo " ", _("FAILED"), "
\n"; @@ -522,12 +531,14 @@ function CheckDatabaseUpdate(&$request) { // "select * from page where LOWER(pagename) like '%search%'" does not apply LOWER! // Confirmed for 4.1.0alpha,4.1.3-beta,5.0.0a; not yet tested for 4.1.2alpha, // On windows only, though utf8 would be useful elsewhere also. - // Illegal mix of collations (latin1_bin,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '=']) + // Illegal mix of collations (latin1_bin,IMPLICIT) and + // (utf8_general_ci, COERCIBLE) for operation '=']) if (isWindows() and substr($backend_type,0,5) == 'mysql') { echo _("check for mysql 4.1.x/5.0.0 binary search on windows problem")," ..."; $mysql_version = $dbh->_backend->_serverinfo['version']; if ($mysql_version < 401.0) { - echo sprintf(_("version %s not affected"), $mysql_version),"
\n"; + echo sprintf(_("version %s"), $mysql_version)," ", + _("not affected"),"
\n"; } elseif ($mysql_version >= 401.6) { // FIXME: since which version? $row = $dbh->_backend->getRow("SHOW CREATE TABLE $page_tbl"); $result = join(" ", $row); @@ -537,11 +548,12 @@ function CheckDatabaseUpdate(&$request) { echo _("OK"), "
\n"; } else { //SET CHARACTER SET latin1 - //$dbh->genericSqlQuery("ALTER DATABASE ".$dbh->_backend->database()." DEFAULT CHARACTER SET ".CHARSET." COLLATE ".CHARSET."_bin"); $dbh->genericSqlQuery("ALTER TABLE $page_tbl CHANGE pagename " - ."pagename VARCHAR(100) CHARACTER SET ".CHARSET." COLLATE ".CHARSET."_bin NOT NULL"); - //."pagename VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL"); - echo sprintf(_("version %s FIXED"), $mysql_version),"
\n"; + ."pagename VARCHAR(100) CHARACTER SET ".CHARSET + ." COLLATE ".CHARSET."_bin NOT NULL"); + echo sprintf(_("version %s"), $mysql_version), + "",_("FIXED"),"", + "
\n"; } } elseif ($DBParams['dbtype'] != 'PDO') { // check if already fixed @@ -558,8 +570,11 @@ function CheckDatabaseUpdate(&$request) { // remove the binary flag if (strstr(strtolower($flags), "binary")) { // FIXME: on duplicate pagenames this will fail! - $dbh->genericSqlQuery("ALTER TABLE $page_tbl CHANGE pagename pagename VARCHAR(100) NOT NULL"); - echo sprintf(_("version %s FIXED"), $mysql_version),"
\n"; + $dbh->genericSqlQuery("ALTER TABLE $page_tbl CHANGE pagename" + ." pagename VARCHAR(100) NOT NULL"); + echo sprintf(_("version %s"), $mysql_version), + "",_("FIXED"),"" + ,"
\n"; } } break; @@ -579,7 +594,7 @@ function CheckDatabaseUpdate(&$request) { if ((DATABASE_TYPE == 'SQL' and $backend->AffectedRows()) or (DATABASE_TYPE == 'ADODB' and $backend->Affected_Rows()) or (DATABASE_TYPE == 'PDO' and $result)) - echo "",_("fixed"),"", "
\n"; + echo "",_("FIXED"),"", "
\n"; else echo _("OK"),"
\n"; } @@ -634,9 +649,9 @@ function _upgrade_db_init (&$dbh) { $form = HTML::form(array("method" => "post", "action" => $request->getPostURL(), "accept-charset"=>$GLOBALS['charset']), - HTML::p(_("Upgrade requires database privileges to CREATE and ALTER the phpwiki database."), +HTML::p(_("Upgrade requires database privileges to CREATE and ALTER the phpwiki database."), HTML::br(), - _("And on windows at least the privilege to SELECT FROM mysql, and possibly UPDATE mysql")), +_("And on windows at least the privilege to SELECT FROM mysql, and possibly UPDATE mysql")), HiddenInputs(array('action' => 'upgrade')), HTML::table(array("cellspacing"=>4), HTML::tr(HTML::td(array('align'=>'right'), @@ -654,7 +669,8 @@ function _upgrade_db_init (&$dbh) { HTML::tr(HTML::td(array('align'=>'center', 'colspan' => 2), Button("submit:", _("Submit"), 'wikiaction'), HTML::raw(' '), - Button("submit:dbadmin[cancel]", _("Cancel"), 'button'))))); + Button("submit:dbadmin[cancel]", _("Cancel"), + 'button'))))); $form->printXml(); echo "\n"; echo asXML(Template("bottom")); @@ -800,7 +816,9 @@ function CheckConfigUpdate(&$request) { echo "

",_("check for necessary config updates"),"

\n"; echo _("check for old CACHE_CONTROL = NONE")," ... "; if (defined('CACHE_CONTROL') and CACHE_CONTROL == '') { - echo "
  ",_("CACHE_CONTROL is set to 'NONE', and must be changed to 'NO_CACHE'")," ..."; + echo "
  ", + _("CACHE_CONTROL is set to 'NONE', and must be changed to 'NO_CACHE'"), + " ..."; fixConfigIni("/^\s*CACHE_CONTROL\s*=\s*NONE/","CACHE_CONTROL = NO_CACHE"); } else { echo _("OK"); @@ -808,7 +826,9 @@ function CheckConfigUpdate(&$request) { echo "
\n"; echo _("check for GROUP_METHOD = NONE")," ... "; if (defined('GROUP_METHOD') and GROUP_METHOD == '') { - echo "
  ",_("GROUP_METHOD is set to NONE, and must be changed to \"NONE\"")," ..."; + echo "
  ", + _("GROUP_METHOD is set to NONE, and must be changed to \"NONE\""), + " ..."; fixConfigIni("/^\s*GROUP_METHOD\s*=\s*NONE/","GROUP_METHOD = \"NONE\""); } else { echo _("OK"); @@ -862,6 +882,9 @@ function DoUpgrade($request) { /* $Log: not supported by cvs2svn $ + Revision 1.45 2005/02/10 19:01:19 rurban + add PDO support + Revision 1.44 2005/02/07 15:40:42 rurban use defined CHARSET for db. more comments -- 2.45.0