Просмотр исходного кода

多语言multi-language #26 阅读器

Bhikkhu-Kosalla 5 лет назад
Родитель
Сommit
abca62b2e6

+ 5 - 2
app/dict/index.php

@@ -244,8 +244,11 @@ require_once "../pcdl/html_head.php";
 	<div id="tool_btn" class="right_tool_btn" style="display: none;">
 		<button style="border: 2px solid var(--nocolor); background-color: unset;"><a href="#toc_root">
 			<svg t="1596888255722" class="icon" style="height: 3em; width: 3em;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4368" width="200" height="200">
-				<path d="M510.4 514.2m-449.2 0a449.2 449.2 0 1 0 898.4 0 449.2 449.2 0 1 0-898.4 0Z" fill="#8a8a8a" p-id="4369"></path><path d="M719.4 314.5h-416c-8.5 0-15.4-6.9-15.4-15.4v-4.8c0-8.5 6.9-15.4 15.4-15.4h416.1c8.5 0 15.4 6.9 15.4 15.4v4.8c-0.1 8.4-7 15.4-15.5 15.4z" fill="#ffffff" p-id="4370"></path><path d="M494.1 735.1v-416c0-8.5 6.9-15.4 15.4-15.4h4.8c8.5 0 15.4 6.9 15.4 15.4v416.1c0 8.5-6.9 15.4-15.4 15.4h-4.8c-8.4-0.1-15.4-7-15.4-15.5z" fill="#ffffff" p-id="4371"></path><path d="M672.5 503.1l-165-165c-6-6-6-15.8 0-21.7l3.4-3.4c6-6 15.8-6 21.7 0l165 165c6 6 6 15.8 0 21.7l-3.4 3.4c-6 6-15.7 6-21.7 0z" fill="#ffffff" p-id="4372"></path><path d="M325.2 478l165-165c6-6 15.8-6 21.7 0l3.4 3.4c6 6 6 15.8 0 21.7l-165 165c-6 6-15.8 6-21.7 0l-3.4-3.4c-5.9-6-5.9-15.7 0-21.7z" fill="#ffffff" p-id="4373">
-				</path>
+				<path d="M510.4 514.2m-449.2 0a449.2 449.2 0 1 0 898.4 0 449.2 449.2 0 1 0-898.4 0Z" fill="#8a8a8a" p-id="4369"></path>
+				<path d="M719.4 314.5h-416c-8.5 0-15.4-6.9-15.4-15.4v-4.8c0-8.5 6.9-15.4 15.4-15.4h416.1c8.5 0 15.4 6.9 15.4 15.4v4.8c-0.1 8.4-7 15.4-15.5 15.4z" fill="#ffffff" p-id="4370"></path>
+				<path d="M494.1 735.1v-416c0-8.5 6.9-15.4 15.4-15.4h4.8c8.5 0 15.4 6.9 15.4 15.4v416.1c0 8.5-6.9 15.4-15.4 15.4h-4.8c-8.4-0.1-15.4-7-15.4-15.5z" fill="#ffffff" p-id="4371"></path>
+				<path d="M672.5 503.1l-165-165c-6-6-6-15.8 0-21.7l3.4-3.4c6-6 15.8-6 21.7 0l165 165c6 6 6 15.8 0 21.7l-3.4 3.4c-6 6-15.7 6-21.7 0z" fill="#ffffff" p-id="4372"></path>
+				<path d="M325.2 478l165-165c6-6 15.8-6 21.7 0l3.4 3.4c6 6 6 15.8 0 21.7l-165 165c-6 6-15.8 6-21.7 0l-3.4-3.4c-5.9-6-5.9-15.7 0-21.7z" fill="#ffffff" p-id="4373"></path>
 			</svg>
 		</a>
 		</button>

+ 1 - 1
app/palicanon/index.php

@@ -190,7 +190,7 @@ $("#tag_input").keypress(function(){
   }
 
   function render_tag_list(){
-    let strListTag = "已经选择:";
+    let strListTag = gLocal.gui.selected+":";
       for (const iterator of list_tag) {
         strListTag +="<tag><span style='margin-right: 5px; font-weight: bold;'>"+iterator+"</span>";
         strListTag +="<span style='display: contents;' onclick =\"tag_remove('"+iterator+"')\">";

+ 1 - 1
app/pcdl/css/reader.css

@@ -418,7 +418,7 @@ pb {
   opacity: 1;
 }
 #tool_bar_title {
-  font-family: times;
+  font-family: 'Noto Serif';
   font-weight: bold;
 }
 

+ 5 - 4
app/pcdl/reader.php

@@ -8,6 +8,7 @@ require_once '../public/load_lang.php';
 <head>
 	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
 	<meta name="viewport" content="width=device-width, initial-scale=1.0">
+	<link type="text/css" rel="stylesheet" href="../studio/css/font.css"/>
 	<link type="text/css" rel="stylesheet" href="css/reader.css"/>
 	<link type="text/css" rel="stylesheet" href="css/reader_mob.css" media="screen and (max-width:767px)">
 	<title id="page_title">PCD Reader</title>
@@ -165,7 +166,7 @@ para:hover{
 				</button>
 			</div>
 			<div>
-				<span id="tool_bar_title"><?php echo $_local->gui->title; ?></span>
+				<span id="tool_bar_title" style="font-family: 'Noto Serif';"><?php echo $_local->gui->title; ?></span>
 			</div>
 			<div style="display: flex;">
 				<form action="../studio/project.php" method="post" onsubmit="return pali_canon_edit_now(this)" target="_blank" style="display: inline-block;">
@@ -424,7 +425,7 @@ else{
 				$query = "select paragraph , toc from 'pali_text' where book='$book' and paragraph='$par_next' ";
 				$FetchPara = PDO_FetchAll($query);
 				if(count($FetchPara)>0){
-					$next_para_link = "<a href='reader.php?view={$_view}&book={$book}&para={$par_next}'><span id='para_nav_next'>{$FetchPara[0]["toc"]}</span><span  id='para_nav_next_a'>";
+					$next_para_link = "<a href='reader.php?view={$_view}&book={$book}&para={$par_next}&display={$_display}'><span id='para_nav_next'>{$FetchPara[0]["toc"]}</span><span  id='para_nav_next_a'>";
 					$next_para_link .= "<svg t='1598093121925' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='4451' width='32px' height='32px'><path d='M540.5696 102.4c-225.83296 0-409.6 183.74656-409.6 409.6s183.76704 409.6 409.6 409.6c225.85344 0 409.6-183.74656 409.6-409.6s-183.74656-409.6-409.6-409.6z m180.14208 439.84896l-109.19936 128.59392a46.65344 46.65344 0 0 1-65.86368 5.36576 46.71488 46.71488 0 0 1-5.38624-65.8432l43.86816-51.63008h-188.12928a46.6944 46.6944 0 1 1 0-93.42976h188.12928l-43.86816-51.63008a46.75584 46.75584 0 0 1 71.24992-60.47744l109.19936 128.59392c14.82752 17.408 14.82752 43.008 0 60.45696z' p-id='4452' fill='#757AF7'></path></svg>";
 					$next_para_link .= "</span></a>";
 				}
@@ -440,7 +441,7 @@ else{
 				$query = "select paragraph , toc from 'pali_text' where book='$book' and paragraph='$par_prev' ";
 				$FetchPara = PDO_FetchAll($query);
 				if(count($FetchPara)>0){
-					$prev_para_link = "<a href='reader.php?view={$_view}&book={$book}&para={$par_prev}'><span id='para_nav_prev_a'>";
+					$prev_para_link = "<a href='reader.php?view={$_view}&book={$book}&para={$par_prev}&display={$_display}'><span id='para_nav_prev_a'>";
 					$prev_para_link .= "<svg t='1598093521111' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='4644' width='32' height='32'><path d='M540.5696 102.4c-225.83296 0-409.6 183.74656-409.6 409.6s183.76704 409.6 409.6 409.6c225.85344 0 409.6-183.74656 409.6-409.6s-183.74656-409.6-409.6-409.6z m144.54784 456.31488h-188.12928l43.84768 51.63008a46.6944 46.6944 0 0 1-35.59424 76.96384 46.55104 46.55104 0 0 1-35.61472-16.4864l-109.24032-128.59392a46.71488 46.71488 0 0 1 0-60.47744l109.24032-128.59392a46.6944 46.6944 0 1 1 71.20896 60.47744l-43.84768 51.63008h188.12928a46.6944 46.6944 0 1 1 0 93.45024z' p-id='4645' fill='#757AF7'></path></svg>";
 					$prev_para_link .= "</span><span id='para_nav_prev'>{$FetchPara[0]["toc"]}</span></a>";
 				}
@@ -713,7 +714,7 @@ else{
 				</div>
 			</div>
 			
-		<div class='toc' id='leftmenuinnerinner'>	
+		<div class='toc' id='leftmenuinnerinner' style="font-family: 'Noto Serif';">	
 			<!-- toc begin -->
 			<div class="menu" id="menu_toc">
 				<a name="_Content" ></a>

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

@@ -466,6 +466,9 @@
 		"scan_in_reader": "scan in reader",
 		"selected": "selected",
 		"to_be_selected": "to be selected",
+		"text_without_title": "text without title",
+		"end_of_text": "No Prev",
+		"begin_of_text": "No Next",
 		"": ""
 	},
 	"grammastr": [

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

@@ -465,6 +465,9 @@
 		"scan_in_reader": "scan in reader",
 		"selected": "selected",
 		"to_be_selected": "to be selected",
+		"text_without_title": "text without title",
+		"end_of_text": "No Prev",
+		"begin_of_text": "No Next",
 		"": ""
 	},
 	"grammastr": [

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

@@ -465,6 +465,9 @@
 		"scan_in_reader": "scan in reader",
 		"selected": "selected",
 		"to_be_selected": "to be selected",
+		"text_without_title": "text without title",
+		"end_of_text": "No Prev",
+		"begin_of_text": "No Next",
 		"": "",
 		"": ""
 	},

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

@@ -470,6 +470,9 @@
 		"scan_in_reader": "scan in reader",
 		"selected": "selected",
 		"to_be_selected": "to be selected",
+		"text_without_title": "text without title",
+		"end_of_text": "No Prev",
+		"begin_of_text": "No Next",
 		"": "",
 		"": ""
 	},

+ 3 - 0
app/public/lang/zh-cn.json

@@ -468,6 +468,9 @@
 		"scan_in_reader": "去藏经阁中阅览",
 		"selected": "已选",
 		"to_be_selected": "待选",
+		"text_without_title": "有正文缺标题",
+		"end_of_text": "到底啦",
+		"begin_of_text": "到顶啦",
 		"": ""
 	},
 	"grammastr": [

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

@@ -467,6 +467,9 @@
 		"scan_in_reader": "去藏經閣中閱覽",
 		"selected": "已選",
 		"to_be_selected": "待選",
+		"text_without_title": "有正文缺標題",
+		"end_of_text": "到底啦",
+		"begin_of_text": "到頂啦",
 		"": ""
 	},
 	"grammastr": [

+ 48 - 6
app/studio/index_pc.php

@@ -151,11 +151,15 @@ require_once '../studio/index_head.php';
 		
 </div>
 	<!--  Tool bar on right side -->
-	<div class="right_tool_btn">
-		<button ><a href="#toc_root">
-		<svg class="icon">
-    		<use xlink:href="svg/icon.svg#ic_move_to_inbox"></use>
-		</svg>
+	<div id="tool_btn" class="right_tool_btn" style="display: none;">
+		<button style="border: 2px solid var(--nocolor); background-color: unset;"><a href="#toc_root">
+			<svg t="1596888255722" class="icon" style="height: 3em; width: 3em;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4368" width="200" height="200">
+				<path d="M510.4 514.2m-449.2 0a449.2 449.2 0 1 0 898.4 0 449.2 449.2 0 1 0-898.4 0Z" fill="#8a8a8a" p-id="4369"></path>
+				<path d="M719.4 314.5h-416c-8.5 0-15.4-6.9-15.4-15.4v-4.8c0-8.5 6.9-15.4 15.4-15.4h416.1c8.5 0 15.4 6.9 15.4 15.4v4.8c-0.1 8.4-7 15.4-15.5 15.4z" fill="#ffffff" p-id="4370"></path>
+				<path d="M494.1 735.1v-416c0-8.5 6.9-15.4 15.4-15.4h4.8c8.5 0 15.4 6.9 15.4 15.4v416.1c0 8.5-6.9 15.4-15.4 15.4h-4.8c-8.4-0.1-15.4-7-15.4-15.5z" fill="#ffffff" p-id="4371"></path>
+				<path d="M672.5 503.1l-165-165c-6-6-6-15.8 0-21.7l3.4-3.4c6-6 15.8-6 21.7 0l165 165c6 6 6 15.8 0 21.7l-3.4 3.4c-6 6-15.7 6-21.7 0z" fill="#ffffff" p-id="4372"></path>
+				<path d="M325.2 478l165-165c6-6 15.8-6 21.7 0l3.4 3.4c6 6 6 15.8 0 21.7l-165 165c-6 6-15.8 6-21.7 0l-3.4-3.4c-5.9-6-5.9-15.7 0-21.7z" fill="#ffffff" p-id="4373"></path>
+			</svg>
 		</a>
 		</button>
 	</div>
@@ -191,7 +195,45 @@ require_once '../studio/index_head.php';
 		</div>
 	</div>
 	<!--  Tool bar on right side end -->
-	
+	<script>
+	 window.addEventListener('scroll',winScroll);
+	function winScroll(e){ 
+		if(GetPageScroll().y>150){
+			$("#search_toolbar_1").css("top",0) ;
+		}
+		else{
+			$("#search_toolbar_1").css("top",GetPageScroll().y - 150) ;
+		}
+		if(GetPageScroll().y>$(window).height()*0.9){
+			$("#tool_btn").show();
+		}
+		else{
+			$("#tool_btn").hide();
+		}
+		
+	}
+ //滚动条位置
+function GetPageScroll() 
+{ 
+	var pos=new Object();
+	var x, y; 
+	if(window.pageYOffset) 
+	{	// all except IE	
+		y = window.pageYOffset;	
+		x = window.pageXOffset; 
+	} else if(document.documentElement && document.documentElement.scrollTop) 
+	{	// IE 6 Strict	
+		y = document.documentElement.scrollTop;	
+		x = document.documentElement.scrollLeft; 
+	} else if(document.body) {	// all other IE	
+		y = document.body.scrollTop;	
+		x = document.body.scrollLeft;   
+	} 
+	pos.x=x;
+	pos.y=y;
+	return(pos);
+}
+	</script>	
 	<?php
 require_once '../studio/index_foot.php';
 ?>