Browse Source

多語言維護合併

Bhikkhu-Kosalla 5 năm trước cách đây
mục cha
commit
ea8221cf16

+ 13 - 0
app/article/mobile.css

@@ -22,3 +22,16 @@
 #main_view {
 	padding-top: 10em;
 }
+.other_tran_div > .tool_bar {
+	display: grid;
+	min-height: 3em;
+}
+.other_tran_div > .tool_bar > .tool_left {
+	width: calc(100vw - 2em - 12px);
+	max-width: 100%;
+}
+.other_tran_div > .tool_bar > .tool_right {
+	position: absolute;
+	right: 6px;
+	margin-top: 1.5em;
+}

+ 3 - 0
app/article/style.css

@@ -160,3 +160,6 @@ img {
     flex: 5;
 }
 */
+.tool_bar {
+	display: flex;
+}

+ 3 - 2
app/doc/pcs2db.php

@@ -101,7 +101,7 @@ $query = "SELECT file_name, doc_info, modify_time from fileindex where id=? ";
 $Fetch = PDO_FetchRow($query, array($_GET["doc_id"]));
 
 if ($Fetch === false) {
-    echo "文件不存在";
+    echo "数据库中查不到文件";
     exit;
 } else {
     $file_modify_time = $Fetch["modify_time"];
@@ -112,13 +112,14 @@ if ($Fetch === false) {
         exit;
     }
 }
+echo "File Name:{$file}<br>";
 if (!file_exists($file)) {
     echo "文件不存在";
     exit;
 }
 $xml = simplexml_load_file($file);
 if ($xml == false) {
-    echo "载入pcs文件错误";
+    echo "载入pcs文件错误。文件名:{$file}";
     exit;
 }
 $xml_head = $xml->xpath('//head')[0];

+ 20 - 18
app/public/js/comm.js

@@ -161,27 +161,29 @@ function getPassDataTime(time) {
 
 	let pass = currDate.getTime() - time;
 	let strPassTime = "";
-	if (pass < 60 * 1000) {
-		//分钟内
-		strPassTime = Math.floor(pass / 1000) + "秒前";
-	} else if (pass < 3600 * 1000) {
-		//小时内
-		strPassTime = Math.floor(pass / 1000 / 60) + "分钟前";
-	} else if (pass < 3600 * 24 * 1000) {
-		//天内
-		strPassTime = Math.floor(pass / 1000 / 3600) + "小时前";
-	} else if (pass < 3600 * 24 * 7 * 1000) {
-		//周内
-		strPassTime = Math.floor(pass / 1000 / 3600 / 24) + "天前";
-	} else if (pass < 3600 * 24 * 30 * 1000) {
-		//个月内
-		strPassTime = Math.floor(pass / 1000 / 3600 / 24 / 7) + "周前";
+	if (pass < 120 * 1000) {
+		//分钟内
+		strPassTime = Math.floor(pass / 1000) + gLocal.gui.secs_ago;
+	} else if (pass < 7200 * 1000) {
+		//小时内
+		strPassTime = Math.floor(pass / 1000 / 60) + gLocal.gui.mins_ago;
+	} else if (pass < 3600 * 48 * 1000) {
+		//天内
+		strPassTime = Math.floor(pass / 1000 / 3600) + gLocal.gui.hs_ago;
+	} else if (pass < 3600 * 24 * 14 * 1000) {
+		//周内
+		strPassTime = Math.floor(pass / 1000 / 3600 / 24) + gLocal.gui.days_ago;
+	} else if (pass < 3600 * 24 * 60 * 1000) {
+		//个月内
+		strPassTime = Math.floor(pass / 1000 / 3600 / 24 / 7) + gLocal.gui.weeks_ago;
 	} else if (pass < 3600 * 24 * 365 * 1000) {
 		//一年内
-		strPassTime = Math.floor(pass / 1000 / 3600 / 24 / 30) + "月前";
+		strPassTime = Math.floor(pass / 1000 / 3600 / 24 / 30) + gLocal.gui.months_ago;
+	} else if (pass < 3600 * 24 * 730 * 1000) {
+		//超过1年小于2年
+		strPassTime = Math.floor(pass / 1000 / 3600 / 24 / 365) + gLocal.gui.year_ago;
 	} else {
-		//超过一年
-		strPassTime = Math.floor(pass / 1000 / 3600 / 24 / 365) + "年前";
+		strPassTime = Math.floor(pass / 1000 / 3600 / 24 / 365) + gLocal.gui.years_ago;
 	}
 	return strPassTime;
 }

+ 9 - 0
app/public/lang/default.json

@@ -616,6 +616,15 @@
 		"dict_searching_placehold": "insert “+” into a word to search them separately",
 		"copy_to": "copy to",
 		"add_tran": "add translation",
+		"no_updated": "no update",
+		"secs_ago": "secs ago",
+		"mins_ago": "mins ago",
+		"hs_ago": "hs ago",
+		"days_ago": "days ago",
+		"weeks_ago": "weeks ago",
+		"months_ago": "months ago",
+		"year_ago": "year ago",
+		"years_ago": "years ago",
 		"": ""
 	},
 	"grammastr": [

+ 9 - 0
app/public/lang/en.json

@@ -615,6 +615,15 @@
 		"dict_searching_placehold": "insert “+” into a word to search them separately",
 		"copy_to": "copy to",
 		"add_tran": "add translation",
+		"no_updated": "no update",
+		"secs_ago": "&nbsp;secs&nbsp;ago",
+		"mins_ago": "&nbsp;mins&nbsp;ago",
+		"hs_ago": "&nbsp;hs&nbsp;ago",
+		"days_ago": "&nbsp;days&nbsp;ago",
+		"weeks_ago": "&nbsp;weeks&nbsp;ago",
+		"months_ago": "&nbsp;months&nbsp;ago",
+		"year_ago": "&nbsp;year&nbsp;ago",
+		"years_ago": "&nbsp;years&nbsp;ago",
 		"": ""
 	},
 	"grammastr": [

+ 9 - 0
app/public/lang/my.json

@@ -615,6 +615,15 @@
 		"dict_searching_placehold": "insert “+” into a word to search them separately",
 		"copy_to": "copy to",
 		"add_tran": "add translation",
+		"no_updated": "no update",
+		"secs_ago": "&nbsp;secs ago",
+		"mins_ago": "&nbsp;mins ago",
+		"hs_ago": "&nbsp;hs ago",
+		"days_ago": "&nbsp;days ago",
+		"weeks_ago": "&nbsp;weeks ago",
+		"months_ago": "&nbsp;months ago",
+		"year_ago": "&nbsp;year ago",
+		"years_ago": "&nbsp;years ago",
 		"": ""
 	},
 	"grammastr": [

+ 9 - 0
app/public/lang/si.json

@@ -620,6 +620,15 @@
 		"dict_searching_placehold": "insert “+” into a word to search them separately",
 		"copy_to": "copy to",
 		"add_tran": "add translation",
+		"no_updated": "no update",
+		"secs_ago": "&nbsp;secs ago",
+		"mins_ago": "&nbsp;mins ago",
+		"hs_ago": "&nbsp;hs ago",
+		"days_ago": "&nbsp;days ago",
+		"weeks_ago": "&nbsp;weeks ago",
+		"months_ago": "&nbsp;months ago",
+		"year_ago": "&nbsp;year ago",
+		"years_ago": "&nbsp;years ago",
 		"": ""
 	},
 	"grammastr": [

+ 10 - 1
app/public/lang/zh-cn.json

@@ -544,7 +544,7 @@
 		"recommendation": "推荐",
 		"collection": "收藏",
 		"rates": "评分",
-		"updated": "更新",
+		"updated": "更新",
 		"my_zone": "我的空间",
 		"share_to": "分享到",
 		"EXP": "经验",
@@ -618,6 +618,15 @@
 		"dict_searching_placehold": "单词里面添加“+”可分别查看查询结果",
 		"copy_to": "复制到",
 		"add_tran": "添加译文",
+		"no_updated": "无更新",
+		"secs_ago": "秒前",
+		"mins_ago": "分钟前",
+		"hs_ago": "小时前",
+		"days_ago": "天前",
+		"weeks_ago": "周前",
+		"months_ago": "月前",
+		"year_ago": "年前",
+		"years_ago": "年前",
 		"": ""
 	},
 	"grammastr": [

+ 9 - 0
app/public/lang/zh-tw.json

@@ -617,6 +617,15 @@
 		"dict_searching_placehold": "单词里面添加“+”可分别查看查询结果",
 		"copy_to": "複製到",
 		"add_tran": "新增譯文",
+		"no_updated": "無更新",
+		"secs_ago": "秒前",
+		"mins_ago": "分鐘前",
+		"hs_ago": "小時前",
+		"days_ago": "天前",
+		"weeks_ago": "週前",
+		"months_ago": "月前",
+		"year_ago": "年前",
+		"years_ago": "年前",
 		"": ""
 	},
 	"grammastr": [

+ 46 - 10
app/redis/index.php

@@ -4,6 +4,32 @@ require_once "function.php";
 ?>
 
 <body>
+<style>
+.data_row{
+	display:flex;
+}
+.key{
+	flex:2;
+}
+.type{
+	flex:1;
+}
+.valid{
+	flex:1;
+}
+.rebuild{
+	flex:1;
+}
+.count{
+	flex:1;
+}
+.description{
+	flex:8;
+}
+.function{
+	flex:2;
+}
+</style>
 <?php
 $redis = redis_connect();
 if($redis==false){
@@ -16,27 +42,38 @@ else{
 	if(file_exists("redis.json")){
 	$redisList=json_decode(file_get_contents("redis.json"),true);
 	echo "<div>";
+	echo "<div class='data_row' >";
+	echo "<div class='key'>key</div>";
+	echo "<div  class='type'>type</div>";
+	echo "<div  class='valid'>valid</div>";
+	echo "<div  class='rebuild'>rebuild</div>";
+	echo "<div class='count'>count</div>";
+	echo "<div class='description'>description</div>";
+	echo "<div class='function'>function</div>";
+	echo "</div>";
 	
 	foreach ($redisList as $key => $value) {
 		# code..
-		echo "<div class='card' style='display:block;";
+		echo "<div class='data_row' ";
 		if($value["valid"]==false){
 			echo "background-color:lightpink;";
 		}
 		echo "'>";
-		echo "<div>key:<b>{$value["key"]}</b></div>";
-		echo "<div>type:{$value["type"]}</div>";
-		echo "<div >valid:";
+		echo "<div class='key'><b>{$value["key"]}</b></div>";
+		echo "<div class='type'>{$value["type"]}</div>";
+		echo "<div class='valid'>";
 		if($value["valid"]){
 			echo "有效";
 		}
 		else{
-			echo "已经过时";
+			echo "<span style='color:red;'>已经过时</span>";
 		}
 		echo "</div>";
+		echo "<div class='rebuild'>";
 		if(isset($value["rebuild"]) && !empty($value["rebuild"])){
-			echo "<div >rebuild:<a href='{$value["rebuild"]}' target='_blank'>{$value["rebuild"]}</a></div>";
+			echo "<a href='{$value["rebuild"]}' target='_blank'>rebuild</a>";
 		}
+		echo "</div>";
 
 		if(substr($value["key"],-1)==="*"){
 			$keys = $redis->keys($value["key"]);
@@ -52,7 +89,7 @@ else{
 					break;
 			}
 		}
-		echo "<div >count:";
+		echo "<div class='count'>";
 		if(isset($keys)){
 			echo count($keys);
 		}
@@ -60,9 +97,8 @@ else{
 			echo "未知";
 		}
 		echo "</div>";
-		echo "<div >description:{$value["description"]}</div>";
-		echo "<div ><button onclick=\"del('{$value["key"]}')\">删除数据</button></div>";
-		
+		echo "<div class='description' >{$value["description"]}</div>";
+		echo "<div class='funcion'><button onclick=\"del('{$value["key"]}')\">删除数据</button></div>";
 		echo "</div>";
 	}
 	echo "</div>";

+ 57 - 1
app/redis/redis.json

@@ -18,6 +18,62 @@
 		"key": "article://*",
 		"type": "hash",
 		"valid": true,
-		"description": "article 主要信息 key: article://id  字段 title,owner,summary,create_time,modify_time "
+		"description": "article 主要信息 key: article://id  字段 title,owner,summary,tag,content,create_time,modify_time "
+	},
+	{
+		"key": "dict://comp",
+		"type": "hash",
+		"valid": true,
+		"rebuild": "../dict/redis_comp_part.php",
+		"description": "复合词数据库内容 feild value= json "
+	},
+	{
+		"key": "dict://term",
+		"type": "hash",
+		"valid": true,
+		"rebuild": "../dict/redis_import_term.php",
+		"description": "术语数据库内容 feild value= json "
+	},
+	{
+		"key": "dict://user",
+		"type": "hash",
+		"valid": true,
+		"rebuild": "../dict/redis_import_user.php",
+		"description": "用户字典内容 feild value= json "
+	},
+	{
+		"key": "pali://wordindex.set",
+		"type": "set",
+		"valid": true,
+		"rebuild": "../dict/redis_pali_word_list.php",
+		"description": "三藏单词列表 "
+	},
+	{
+		"key": "pali://wordindex.hash",
+		"type": "hash",
+		"valid": true,
+		"rebuild": "../dict/redis_pali_word_list.php",
+		"description": "三藏单词列表 "
+	},
+	{
+		"key": "dict://pm/part",
+		"type": "hash",
+		"valid": true,
+		"rebuild": "../dict/redis_pm_part.php",
+		"description": "巴缅拆分 "
+	},
+	{
+		"key": "dict://part.hash",
+		"type": "hash",
+		"valid": true,
+		"rebuild": "../dict/redis_split_part.php",
+		"description": "电脑自动拆分 "
+	},
+	{
+		"key": "dict://regular/part",
+		"type": "hash",
+		"valid": true,
+		"rebuild": "../dict/redis_sys_rgl_part.php",
+		"description": "系统规则变形表中的拆分部分 "
 	}
 ]

+ 2 - 1
app/studio/js/message.js

@@ -103,7 +103,8 @@ function msg_send() {
 				switch (getNodeText(arrMsg[x], "type")) {
 					case "maxid":
 						iMsgLastUpdateId = getNodeText(arrMsg[x], "data");
-						doc_head("msg_db_max_id", iMsgLastUpdateId);
+						//TO DO 用local storage解决
+						//doc_head("msg_db_max_id", iMsgLastUpdateId);
 						console.log("iMsgLastUpdateId:" + iMsgLastUpdateId);
 						break;
 					default:

+ 5 - 5
app/term/note.js

@@ -542,7 +542,7 @@ function note_json_html(in_json) {
 	//未选择的其他译文开始
 	output += "<div class='other_tran_div' sent='";
 	output += in_json.book + "-" + in_json.para + "-" + in_json.begin + "-" + in_json.end + "' >";
-	output += "<div class='tool_bar' style='display:flex;' sent='";
+	output += "<div class='tool_bar' sent='";
 	output += in_json.book + "-" + in_json.para + "-" + in_json.begin + "-" + in_json.end + "' >";
 	output += "<span class='tool_left'>";
 	//第一个按钮
@@ -814,7 +814,7 @@ function render_one_sent_tran_a(iterator) {
 	html += "</div>";
 	html += "</div>";
 	//tool_bar 结束
-	html += '<div class="left_bar">';
+	html += '<div class="left_bar" >';
 	html += '	<div class="face">';
 	if (iterator.id != "") {
 		html += '<span class="head_img">' + iterator.editor_name.nickname.slice(0, 1) + "</span>";
@@ -859,12 +859,12 @@ function render_one_sent_tran_a(iterator) {
 		html += '<span class="name">' + iterator.editor_name.nickname + "</span>";
 	}
 	if (iterator.id != "") {
-		html += '<span class="date"> ' + getPassDataTime(iterator.update_time) + "</span>";
+		html += '<span class="date"> ' + getPassDataTime(iterator.update_time) + "</span>";
 	}
 	if (iterator.id != "") {
-		html += '<span class="channel">更新了 @' + iterator.channalinfo.name + "</span>";
+		html += '<span class="channel">'+gLocal.gui.updated+' @' + iterator.channalinfo.name + "</span>";
 	} else {
-		html += '<span class="channel">无人更新 @' + iterator.channalinfo.name + "</span>";
+		html += '<span class="channel">'+gLocal.gui.no_updated+' @' + iterator.channalinfo.name + "</span>";
 	}
 
 	html += '<ul class="tag_list">';

+ 22 - 9
app/term/term.css

@@ -129,7 +129,7 @@ chapter {
 	cursor: pointer;
 }
 chapter::after {
-	content: "  ";
+	content: " > ";
 }
 chapter:hover {
 	color: var(--link-color);
@@ -137,7 +137,7 @@ chapter:hover {
 }
 para {
 	background-color: var(--drop-bg-color);
-	padding: 2px 8px;
+	padding: 0 4px;
 	text-decoration: none;
 	cursor: pointer;
 	color: var(--btn-border-color);
@@ -262,7 +262,7 @@ note > .palitext,
 	line-height: 1.5em;
 	color: #9f3a01;
 	font-weight: 500;
-	margin-bottom: 10px;
+	margin: 4px;
 }
 note n {
 	display: inline;
@@ -296,6 +296,7 @@ note .ref {
 	white-space: nowrap;
 	overflow-x: scroll;
 	max-width: 100%;
+	white-space: pre-wrap;
 }
 note:hover .ref {
 	/*border-top: solid 1px var(--border-line-color);*/
@@ -401,15 +402,23 @@ note:hover .add_new {
 	padding: 0 6px;
 	border-radius: 0 0 4px 4px;
 	cursor: pointer;
-	display: flex;
 	justify-content: space-between;
 }
+.other_tran_div > .tool_bar > .tool_left {
+	white-space: nowrap;
+}
+.other_tran_div > .tool_bar > .tool_right {
+	white-space: pre-wrap;
+	margin-left: auto;
+}
 .other_tran_div > .other_tran {
 	min-height: 1em;
 	transition: all 0.2s ease;
 	display: none;
 }
-
+.tool_bar {
+	display: flex;
+}
 .bg_color_1 {
 	background-color: #ebebeb66;
 }
@@ -438,6 +447,7 @@ pre {
 	position: relative;
 	display: none;
 	z-index: 50;
+	margin-right: 1em;
 }
 
 note:hover .note_tool_bar {
@@ -506,9 +516,10 @@ note:hover .note_tool_bar {
 	display: none;
 	margin: auto 2px;
 	color: whitesmoke;
+	padding: 0 3px;
 }
 .similar_sent_num {
-	display: unset;
+	display: inline-flex;
 }
 .separate_line {
 	border: solid 1px #e8e8e8;
@@ -548,10 +559,11 @@ pw {
 	display: flex;
 }
 .sent_tran:hover {
-	background-color: #fafafa;
+	background-color: var(--btn-border-color);
 }
 .left_bar {
-	width: 40px;
+	flex: 2;
+	display: flex;
 }
 .sent_tran .left_bar > .face {
 	display: block;
@@ -569,6 +581,7 @@ pw {
 .sent_tran_inner > .body {
 	width: 100%;
 	display: block;
+	flex: 13;
 }
 .preview {
 	font-size: 110%;
@@ -596,7 +609,7 @@ pw {
 	display: none;
 }
 .foot_bar .info {
-	color: gray;
+	color: var(--main-color);
 }
 .tool_bar > .right {
 	position: absolute;