[Bbs2ch-cvs 101] CVS update: bbs2chreader/content/bbs2chreader

Back to archive index

flyson flyso****@users*****
2006年 5月 14日 (日) 20:23:02 JST


Index: bbs2chreader/content/bbs2chreader/thread.js
diff -u bbs2chreader/content/bbs2chreader/thread.js:1.31 bbs2chreader/content/bbs2chreader/thread.js:1.32
--- bbs2chreader/content/bbs2chreader/thread.js:1.31	Tue Dec 27 19:48:35 2005
+++ bbs2chreader/content/bbs2chreader/thread.js	Sun May 14 20:23:02 2006
@@ -250,7 +250,7 @@
 
 				for (var i = startNo; i <= endNo; i++)
 					this.requestRespond(this.datLineParse(logLines[i - 1], i, false) + "\n\n\n");
-				this.requestEnd(true, "LOG PICKUP MODE");
+				this.requestEnd(true, this.getStatusText("log_pickup_mode"));
 				return;
 			}
 
@@ -275,7 +275,7 @@
 		
 			// オフラインなら終了
 		if(Bbs2chGlobal.ioService.offline){
-			this.requestEnd(false, "OFFLINE MODE");
+			this.requestEnd(false, this.getStatusText("offline_mode"));
 			return;
 		}
 		
@@ -396,9 +396,9 @@
 		if(this.type == Bbs2chGlobal.TYPE_JBBS) resArray.shift();
 		
 		var resNumber = aNumber;
-		var resName = "BLOKEN";
+		var resName = "BROKEN";
 		var resMail = "";
-		var resDate = "BLOKEN";
+		var resDate = "BROKEN";
 		var resID = "";
 		var resBeID = "";
 		var resMes	= "";
@@ -517,6 +517,25 @@
 		return result;
 	},
 
+	
+	getStatusText: function(aStatus){
+	    var strBundleService = Components.classes["@mozilla.org/intl/stringbundle;1"]
+                                      .getService(Components.interfaces.nsIStringBundleService);
+		var statusBundle = strBundleService.createBundle(
+								"chrome://bbs2chreader/locale/thread-status.properties");
+		var statusText = "";
+		if(typeof(aStatus) == "string"){
+			try{
+				statusText = statusBundle.GetStringFromName(aStatus);
+			}catch(ex){}
+		}else{
+			try{
+				statusText = statusBundle.formatStringFromName("error", [String(aStatus)], 1);
+			}catch(ex){}
+		}
+		return Bbs2chGlobal.toSJIS(statusText);
+	},
+
 
 	/**
 	 * 板のタイプにあわせて文字コード変換
@@ -583,16 +602,19 @@
 			case 206: //差分GET OK
 				break;
 			case 304: //未更新
-				this.requestEnd(false, "NOT MODIFIED");
+				this.requestEnd(false, this.getStatusText("not_modified"));
+				return;
+			case 416: //あぼーん
+				this.requestEnd(false, this.getStatusText("abone"));
 				return;
 			default: // HTTP エラー
-				this.requestEnd(false, "ERROR HTTP STATUS : " + aStatus);
+				this.requestEnd(false, this.getStatusText(aStatus));
 				return;
 		}
 
 			// JBBS は未更新のとき空文字を返す
 		if(!aResponseText){
-			this.requestEnd(false, "NOT MODIFIED");
+			this.requestEnd(false, this.getStatusText("not_modified"));
 			return;
 		}		
 
@@ -603,7 +625,7 @@
 			this.requestRespond(this.datLineParse(this._buffer, this.lineCount, true));
 		}
 			// リクエストの終了
-		this.requestEnd(true, "OK");
+		this.requestEnd(true, this.getStatusText("ok"));
 
 		this._lastModified = this._httpReq.getResponseHeader("Last-Modified");
 		this._eTag = this._httpReq.getResponseHeader("Etag");


bbs2ch-cvs メーリングリストの案内
Back to archive index