From a4f582c8e62da2c640e07371eab854172f93cfc9 Mon Sep 17 00:00:00 2001
From: ryan
Date: Mon, 25 Sep 2006 02:38:55 +0000
Subject: [PATCH] i18n fixes from nbachiyski. fixes #3109
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4239 1a063a9b-81f0-0310-95a4-ce76da25c4cd
---
wp-admin/import/blogger.php | 44 ++---
wp-admin/import/dotclear.php | 8 +-
wp-admin/import/greymatter.php | 313 ++++++++++++++++++++++++++++++++
wp-admin/import/livejournal.php | 2 +-
wp-admin/import/mt.php | 34 ++--
wp-admin/import/rss.php | 2 +-
wp-admin/import/textpattern.php | 6 +-
wp-admin/post.php | 2 +-
wp-includes/classes.php | 8 +-
9 files changed, 368 insertions(+), 51 deletions(-)
diff --git a/wp-admin/import/blogger.php b/wp-admin/import/blogger.php
index d35f84219c..90c72e7b84 100644
--- a/wp-admin/import/blogger.php
+++ b/wp-admin/import/blogger.php
@@ -135,13 +135,13 @@ class Blogger_Import {
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
if ($header) curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
$response = curl_exec ($ch);
-
+
if ($parse) {
$response = $this->parse_response($response);
$response['url'] = $url;
return $response;
}
-
+
return $response;
}
@@ -210,7 +210,7 @@ class Blogger_Import {
$this->import['blogs'][$_GET['blog']]['nextstep'] = $step;
update_option('import-blogger', $this->import);
}
-
+
// Redirects to next step
function do_next_step() {
wp_redirect("admin.php?import=blogger&noheader=true&blog={$_GET['blog']}");
@@ -224,13 +224,13 @@ class Blogger_Import {
if ( ! ( $_POST['user'] && $_POST['pass'] ) ) {
$this->login_form(__('The script will log into your Blogger account, change some settings so it can read your blog, and restore the original settings when it\'s done. Here\'s what you do:').'
'.__('Back up your Blogger template.').'
'.__('Back up any other Blogger settings you might need later.').'
'.__('Log out of Blogger').'
'.__('Log in here with your Blogger username and password.').'
'.__('On the next screen, click one of your Blogger blogs.').'
'.__('Do not close this window or navigate away until the process is complete.').'
');
}
-
- // Try logging in. If we get an array of cookies back, we at least connected.
+
+ // Try logging in. If we get an array of cookies back, we at least connected.
$this->import['cookies'] = $this->login_blogger($_POST['user'], $_POST['pass']);
if ( !is_array( $this->import['cookies'] ) ) {
$this->login_form(__('Login failed. Please enter your credentials again.'));
}
-
+
// Save the password so we can log the browser in when it's time to publish.
$this->import['pass'] = $_POST['pass'];
$this->import['user'] = $_POST['user'];
@@ -341,7 +341,7 @@ class Blogger_Import {
$form = "
";
$form.= $body;
$form.= "
";
- $output.= '
'.sprintf('%s in progress, please wait...', $blog_opt)."
\n";
+ $output.= '
'.sprintf(__('%s in progress, please wait...'), $blog_opt)."
' . addslashes(print_r($response, 1)) );
}
}
if ( $optary['backup'] != $optary['modify'] ) {
@@ -597,11 +597,11 @@ class Blogger_Import {
if ( $_GET['restart'] == 'true' ) {
$this->restart();
}
-
+
if ( isset($_GET['noheader']) ) {
header('Content-Type: text/html; charset=utf-8');
- $this->import = get_settings('import-blogger');
+ $this->import = get_option('import-blogger');
if ( false === $this->import ) {
$step = 0;
@@ -649,7 +649,7 @@ class Blogger_Import {
break;
}
die;
-
+
} else {
$this->greet();
}
@@ -662,6 +662,6 @@ class Blogger_Import {
$blogger_import = new Blogger_Import();
-register_importer('blogger', 'Blogger', __('Import posts and comments from a Blogger account'), array ($blogger_import, 'start'));
+register_importer('blogger', __('Blogger and Blogspot'), __('Import posts and comments from your Blogger account'), array ($blogger_import, 'start'));
?>
diff --git a/wp-admin/import/dotclear.php b/wp-admin/import/dotclear.php
index b4f2cd3440..35ccad76f7 100644
--- a/wp-admin/import/dotclear.php
+++ b/wp-admin/import/dotclear.php
@@ -626,15 +626,15 @@ class Dotclear_Import {
echo '
'.__('Preserving Authors').'
';
echo '
'.__('Secondly, we have attempted to preserve post authors. If you are the only author or contributor to your blog, then you are safe. In most cases, we are successful in this preservation endeavor. However, if we cannot ascertain the name of the writer due to discrepancies between database tables, we assign it to you, the administrative user.').'
';
echo '
'.__('Textile').'
';
- echo '
'.__('Also, since you\'re coming from Dotclear, you probably have been using Textile to format your comments and posts. If this is the case, we recommend downloading and installing Textile for WordPress. Trust me... You\'ll want it.').'
';
+ echo '
'.__('Also, since you\'re coming from Dotclear, you probably have been using Textile to format your comments and posts. If this is the case, we recommend downloading and installing Textile for WordPress. Trust me... You\'ll want it.').'
';
echo '
'.__('WordPress Resources').'
';
echo '
'.__('Finally, there are numerous WordPress resources around the internet. Some of them are:').'
".$postmorecontent;
+ $post_content=$wpdb->escape($post_content);
+
+ $post_karma=$postinfo[12];
+
+ $post_status = 'publish'; //in greymatter, there are no drafts
+ $comment_status = 'open';
+ $ping_status = 'closed';
+
+ if ($post_ID = post_exists($post_title, '', $post_date)) {
+ echo ' ';
+ _e('(already exists)');
+ } else {
+ //just so that if a post already exists, new users are not created by checkauthor
+ // we'll check the author is registered, or if it's a deleted author
+ $user_id = username_exists($post_author);
+ if (!$user_id) { // if deleted from GM, we register the author as a level 0 user
+ $user_ip="127.0.0.1";
+ $user_domain="localhost";
+ $user_browser="server";
+ $user_joindate="1979-06-06 00:41:00";
+ $user_login=$wpdb->escape($post_author);
+ $pass1=$wpdb->escape("password");
+ $user_nickname=$wpdb->escape($post_author);
+ $user_email=$wpdb->escape("user@deleted.com");
+ $user_url=$wpdb->escape("");
+ $user_joindate=$wpdb->escape($user_joindate);
+
+ $user_info = array("user_login"=>$user_login, "user_pass"=>$pass1, "user_nickname"=>$user_nickname, "user_email"=>$user_email, "user_url"=>$user_url, "user_ip"=>$user_ip, "user_domain"=>$user_domain, "user_browser"=>$user_browser, "dateYMDhour"=>$user_joindate, "user_level"=>0, "user_idmode"=>"nickname");
+ $user_id = wp_insert_user($user_info);
+ $this->gmnames[$postinfo[1]] = $user_id;
+
+ echo ': ';
+ printf(__('registered deleted user %s at level 0 '), "$user_login");
+ }
+
+ if (array_key_exists($postinfo[1], $this->gmnames)) {
+ $post_author = $this->gmnames[$postinfo[1]];
+ } else {
+ $post_author = $user_id;
+ }
+
+ $postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_excerpt', 'post_status', 'comment_status', 'ping_status', 'post_modified', 'post_modified_gmt');
+ $post_ID = wp_insert_post($postdata);
+ }
+
+ $c=count($entry);
+ if ($c>4) {
+ $numAddedComments = 0;
+ $numComments = 0;
+ for ($j=4;$j<$c;$j++) {
+ $entry[$j]=$this->gm2autobr($entry[$j]);
+ $commentinfo=explode("|",$entry[$j]);
+ $comment_post_ID=$post_ID;
+ $comment_author=$wpdb->escape($commentinfo[0]);
+ $comment_author_email=$wpdb->escape($commentinfo[2]);
+ $comment_author_url=$wpdb->escape($commentinfo[3]);
+ $comment_author_IP=$wpdb->escape($commentinfo[1]);
+
+ $commentyear=$commentinfo[7];
+ $commentmonth=zeroise($commentinfo[5],2);
+ $commentday=zeroise($commentinfo[6],2);
+ $commenthour=zeroise($commentinfo[8],2);
+ $commentminute=zeroise($commentinfo[9],2);
+ $commentsecond=zeroise($commentinfo[10],2);
+ if (($commentinfo[11]=="PM") && ($commenthour!="12"))
+ $commenthour=$commenthour+12;
+ $comment_date="$commentyear-$commentmonth-$commentday $commenthour:$commentminute:$commentsecond";
+
+ $comment_content=$wpdb->escape($commentinfo[12]);
+
+ if (!comment_exists($comment_author, $comment_date)) {
+ $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_url', 'comment_author_email', 'comment_author_IP', 'comment_date', 'comment_content', 'comment_approved');
+ $commentdata = wp_filter_comment($commentdata);
+ wp_insert_comment($commentdata);
+ $numAddedComments++;
+ }
+ $numComments++;
+ }
+ if ($numAddedComments > 0) {
+ echo ': ';
+ printf(__('imported %d comment(s)'), $numAddedComments);
+ }
+ $preExisting = $numComments - numAddedComments;
+ if ($preExisting > 0) {
+ echo ' ';
+ printf(__('ignored %d pre-existing comments'), $preExisting);
+ }
+ }
+ echo '... '.__('Done').'
';
+ }
+ }
+ ?>
+
+
+
+footer();
+ }
+
+ function dispatch() {
+ if (empty ($_GET['step']))
+ $step = 0;
+ else
+ $step = (int) $_GET['step'];
+
+ switch ($step) {
+ case 0 :
+ $this->greet();
+ break;
+ case 1:
+ $this->import();
+ break;
+ }
+ }
+
+ function GM_Import() {
+ // Nothing.
+ }
+}
+
+$gm_import = new GM_Import();
+
+register_importer('greymatter', __('Greymatter'), __('Import posts and comments from your Greymatter blog'), array ($gm_import, 'dispatch'));
+?>
diff --git a/wp-admin/import/livejournal.php b/wp-admin/import/livejournal.php
index e8c48c4ad9..520bb9c2e2 100644
--- a/wp-admin/import/livejournal.php
+++ b/wp-admin/import/livejournal.php
@@ -167,5 +167,5 @@ class LJ_Import {
$livejournal_import = new LJ_Import();
-register_importer('livejournal', 'LiveJournal', __('Import posts from LiveJournal'), array ($livejournal_import, 'dispatch'));
+register_importer('livejournal', __('LiveJournal'), __('Import posts from LiveJournal'), array ($livejournal_import, 'dispatch'));
?>
diff --git a/wp-admin/import/mt.php b/wp-admin/import/mt.php
index e5b6626122..4d608f7f3c 100644
--- a/wp-admin/import/mt.php
+++ b/wp-admin/import/mt.php
@@ -11,7 +11,7 @@ class MT_Import {
function header() {
echo '
';
- echo '
'.__('Import Movable Type').'
';
+ echo '
'.__('Import Movable Type and Typepad').'
';
}
function footer() {
@@ -32,7 +32,7 @@ class MT_Import {
global $wpdb, $testing;
$users = $wpdb->get_results("SELECT * FROM $wpdb->users ORDER BY ID");
?>
\n";
+ echo "
";
+ printf(__('%d comment(s) moved to the moderation queue.'), $cnt);
+ echo "
\n";
} // End function move_spam
function find_spam() {
@@ -853,7 +853,7 @@ class retrospam_mgr {
$numfound = count($counters[found]);
$numqueue = $counters[in_queue];
- $body = '