Explorar o código

多语言multi-language #26

Bhikkhu-Kosalla %!s(int64=5) %!d(string=hai) anos
pai
achega
8686f0dd16

+ 16 - 16
app/article/index.php

@@ -285,14 +285,14 @@ require_once "../pcdl/html_head.php";
 	padding-right:0;
 }
 .index_toolbar{
-		position:unset;
-	}
-	#pali_pedia{
-		font-size: 200%;
-    margin-top: auto;
-    margin-bottom: auto;
-    padding-left: 0.5em;
-	}
+	position:unset;
+}
+#pali_pedia{
+	font-size: 200%;
+	margin-top: auto;
+	margin-bottom: auto;
+	padding-left: 0.5em;
+}
 
 
 </style>
@@ -306,20 +306,20 @@ term_word_link_fun("wiki_goto_word");
 ?>
 <div id="head_bar" >
 	<div id="pali_pedia" style="display:flex;">
-		<span>文集</span>
+		<span><?php echo $_local->gui->anthology; ?></span>
 	</div>
 
 	<div>
 		<span>
 		<?php
-		echo "<a href='../article/?id=".$_GET["id"];
+		echo "<button class='icon_btn'><a href='../article/?id=".$_GET["id"];
 		echo "&display=para";
-		echo "'>[逐段]</a>";
-		echo "<a href='../article/?id=".$_GET["id"];
+		echo "'>{$_local->gui->each_paragraph}</a></button>";
+		echo "<button class='icon_btn'><a href='../article/?id=".$_GET["id"];
 		echo "&display=sent";
-		echo "'>[逐句]</a>";
+		echo "'>{$_local->gui->each_sentence}</a></button>";
 		?>
-			<a href="#">[帮助]</a>
+			<button class='icon_btn'><a href="#"><?php echo $_local->gui->help; ?></a></button>
 		</span>
 	</div>
 </div>
@@ -332,7 +332,7 @@ term_word_link_fun("wiki_goto_word");
 <div id="contents_view">
 	<div id="contents_div" style="padding: 0 1em;">
 		<div id="contents">
-		loading...
+		<?php echo $_local->gui->loading; ?>...
 		</div>
 		<div id="contents_foot">
 			<div id="contents_nav" style="display:flex;justify-content: space-between;">
@@ -351,7 +351,7 @@ term_word_link_fun("wiki_goto_word");
 			</div>
 		</div>
 		<div class="fun_frame">
-			<div class="title">Translations</div>
+			<div class="title"><?php echo $_local->gui->channels; ?></div>
 			<div id="channal_list" class="content" style="max-height:20em;">
 			</div>
 		</div>

+ 1 - 1
app/channal/my_channal_index.php

@@ -31,7 +31,7 @@ require_once '../studio/index_head.php';
 
 		<div class="tool_bar">
 	<div>
-	频道
+		<?php echo $_local->gui->channels; ?>
 	</div>
 
 	<div>

+ 3 - 3
app/dict/index.php

@@ -193,7 +193,7 @@ require_once "../pcdl/html_head.php";
 					<div id="pre_search_result" style="background-color: var(--btn-color);z-index: 50;">
 						<div id="pre_search_word"  class="pre_serach_block">
 							<div id="pre_search_word_title"   class="pre_serach_block_title">
-								<div id="pre_search_word_title_left">单词</div>
+								<div id="pre_search_word_title_left"><?php echo $_local->gui->vocabulary_list;?></div>
 								<div id="pre_search_word_title_right"></div>						
 							</div>
 							<div id="pre_search_word_content"   class="pre_serach_content">
@@ -228,10 +228,10 @@ require_once "../pcdl/html_head.php";
 					<div id="pre_search_result_1" style="position: absolute;max-width: 100%; width: 50em;background-color: var(--btn-color);z-index: 51;display: none;">
 						<div  class="pre_serach_block">
 							<div class="pre_serach_block_title">
-								<div id="pre_search_word_title_left_1">单词</div>
+								<div id="pre_search_word_title_left_1"><?php echo $_local->gui->vocabulary_list;?></div>
 								<div id="pre_search_word_title_right_1"></div>						
 							</div>
-							<div id="pre_search_word_content_1"   class="pre_serach_content">
+							<div id="pre_search_word_content_1" class="pre_serach_content">
 							</div>
 						</div>
 					</div>

+ 1 - 0
app/pcdl/css/color_day.css

@@ -9,6 +9,7 @@
     --btn-border-color: #7D7D7D;
     --btn-hover-color: #FFFFFF;
     --btn-hover-bg-color:#494949;
+    --btn-border-line-color:#7D7D7D
  
     --input-bg-color:#424242;
     --select-bg-color:#424242;

+ 6 - 3
app/pcdl/css/style.css

@@ -2607,16 +2607,19 @@ color:red;
 }
 
 .icon_btn{
-    color:var(--btn-color);
+    color: var(--btn-color);
     padding: 0.3em 0.3em;
-    border: 1px solid var(--nocolor);
+    border: 1px solid var(--btn-border-color);
     border-radius: 3px;
     margin: 0 2px;
 }
 
 .icon_btn:hover{
+    padding: 0.3em 0.3em;
     background-color: var(--btn-hover-bg-color);
-    border: 1px solid var(--btn-border-line-color);
+    border: 1px solid var(--btn-border-color);
+    border-radius: 3px;
+    margin: 0 2px;
 }
 
 .importbtn{

+ 7 - 4
app/pcdl/head_bar.php

@@ -4,17 +4,20 @@
 	
 </script>
 	<style>
-		.icon_btn{
-    color:var(--btn-color);
+.icon_btn{
+    color: var(--btn-color);
     padding: 0.3em 0.3em;
     border: 1px solid var(--nocolor);
-    border-radius: 6px;
+    border-radius: 3px;
     margin: 0 2px;
 }
 
 .icon_btn:hover{
+    padding: 0.3em 0.3em;
     background-color: var(--btn-hover-bg-color);
-    border: 1px solid var(--btn-border-line-color);
+    border: 1px solid var(--btn-border-color);
+    border-radius: 3px;
+    margin: 0 2px;
 }
 
 		/* 容器 <div> - 需要定位下拉内容 */

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

@@ -517,6 +517,13 @@
 		"text_num": "No. of text",
 		"copied_to_clipboard": "has been copied to clipboard.",
 		"I_know": "Got it!",
+		"text": "DIY text",
+		"anthology": "anthology",
+		"channel": "channel & style",
+		"channels": "channels list",
+		"like": "like",
+		"blank": "blank",
+		"vocabulary_list": "words list",
 		"": ""
 	},
 	"grammastr": [

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

@@ -516,6 +516,13 @@
 		"text_num": "No. of text",
 		"copied_to_clipboard": "has been copied to clipboard.",
 		"I_know": "Got it!",
+		"text": "DIY text",
+		"anthology": "anthology",
+		"channel": "channel & style",
+		"channels": "channels list",
+		"like": "like",
+		"blank": "blank",
+		"vocabulary_list": "words list",
 		"": ""
 	},
 	"grammastr": [

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

@@ -516,6 +516,13 @@
 		"text_num": "No. of text",
 		"copied_to_clipboard": "has been copied to clipboard.",
 		"I_know": "Got it!",
+		"text": "DIY text",
+		"anthology": "anthology",
+		"channel": "channel & style",
+		"channels": "channels list",
+		"like": "like",
+		"blank": "blank",
+		"vocabulary_list": "words list",
 		"": "",
 		"": ""
 	},

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

@@ -521,6 +521,13 @@
 		"text_num": "No. of text",
 		"copied_to_clipboard": "has been copied to clipboard.",
 		"I_know": "Got it!",
+		"text": "DIY text",
+		"anthology": "anthology",
+		"channel": "channel & style",
+		"channels": "channels list",
+		"like": "like",
+		"blank": "blank",
+		"vocabulary_list": "words list",
 		"": "",
 		"": ""
 	},

+ 7 - 7
app/public/lang/zh-cn.json

@@ -518,13 +518,13 @@
 		"text_num": "文本编号",
 		"copied_to_clipboard": "已复制到剪切板",
 		"I_know": "我知道了",
-		"": "",
-		"": "",
-		"": "",
-		"": "",
-		"": "",
-		"": "",
-		"": "",
+		"text": "著作文章",
+		"anthology": "收藏文集",
+		"channel": "版风管理",
+		"channels": "版风列表",
+		"like": "",
+		"blank": "空白",
+		"vocabulary_list": "词汇列表",
 		"": "",
 		"": "",
 		"": ""

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

@@ -518,6 +518,13 @@
 		"text_num": "文字編號",
 		"copied_to_clipboard": "已複製到剪下板",
 		"I_know": "我知道了",
+		"text": "著作文章",
+		"anthology": "收藏文集",
+		"channel": "版風管理",
+		"channels": "版風列表",
+		"like": "贊",
+		"blank": "空白",
+		"vocabulary_list": "詞彙列表",
 		"": ""
 	},
 	"grammastr": [

+ 1 - 1
app/studio/css/style.css

@@ -4145,7 +4145,7 @@ see:hover {
 
 .sent_wbw_trans_bar {
   position: absolute;
-  margin-top: -42px;
+  margin-top: -29px;
   width: 92%;
   display: flex;
 }

+ 6 - 6
app/studio/index_tool_bar.php

@@ -63,6 +63,7 @@
 					<?php echo $_local->gui->recycle_bin;?>
 					</span>
 				</li>
+
 				<li id="course"  onclick="goto_url(this,'../course/my_course_index.php')">
 					<span  class="navi_icon">
 						<svg class="icon">
@@ -70,19 +71,18 @@
 						</svg>	
 					</span>	
 					<span class="navi_text">
-					<?php echo $_local->gui->academy;?>
-					
+						<?php echo $_local->gui->academy;?>
 					</span>
 				</li>
 
 				<li id="channal"  onclick="goto_url(this,'../channal/my_channal_index.php')">
 					<span  class="navi_icon">
 						<svg class="icon">
-							<use xlink:href="../studio/svg/icon.svg#class_video"></use>
+							<use xlink:href="../studio/svg/icon.svg#channel_leaves"></use>
 						</svg>	
 					</span>	
 					<span class="navi_text">
-					<?php echo "Channal";?>
+					<?php echo $_local->gui->channel;?>
 					
 					</span>
 				</li>
@@ -113,7 +113,7 @@
 						<svg t="1603167726865" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3914" width="32" height="32"><path d="M927.873506 253.409882H768V160.018071C768 71.806494 696.193506 0 607.981929 0H160.015059C71.661929 0 0.144565 71.661929 0 160.018071V863.984941C0 952.193506 71.806494 1024 160.018071 1024h702.238117l0.572236-0.144565 1.153505 0.144565C952.193506 1024 1024 952.193506 1024 863.981929V349.536376c-0.144565-53.097412-43.026071-95.984941-96.126494-96.126494zM525.239718 602.515576H205.203576c-17.700141 0-31.945788-14.390212-31.945788-31.945788 0-17.700141 14.390212-31.9488 31.945788-31.9488h320.036142c17.700141 0 31.945788 14.390212 31.945788 31.9488 0 17.697129-14.245647 31.945788-31.945788 31.945788z m0-159.873505H205.203576c-17.700141 0-31.945788-14.390212-31.945788-31.945789 0-17.700141 14.390212-31.9488 31.945788-31.9488h320.036142c17.700141 0 31.945788 14.390212 31.945788 31.9488 0 17.555576-14.245647 31.945788-31.945788 31.945789z m0-160.021083H205.203576c-17.700141 0-31.945788-14.3872-31.945788-31.945788 0-17.697129 14.390212-31.945788 31.945788-31.945788h320.036142c17.700141 0 31.945788 14.390212 31.945788 31.945788 0 17.558588-14.245647 31.945788-31.945788 31.945788z m434.724141 581.360941c0 52.811294-43.026071 95.984941-95.984941 95.984942-52.952847 0-95.978918-43.173647-95.978918-95.984942V317.446024h160.015059c17.703153 0 31.9488 14.390212 31.9488 31.945788v514.590117z" p-id="3915"></path></svg>	
 					</span>	
 					<span class="navi_text">
-					<?php echo "作品";?>
+					<?php echo $_local->gui->text;?>
 					</span>
 				</li>
 
@@ -124,7 +124,7 @@
 						</svg>
 					</span>	
 					<span class="navi_text">
-					<?php echo "文集";?>
+					<?php echo $_local->gui->anthology;?>
 					</span>
 				</li>
 

+ 7 - 7
app/studio/project.php

@@ -344,13 +344,13 @@ switch($op){
 			echo "<input type='hidden' name='data' value='{$data}'/>";
 			
 			echo "<fieldset>";
-			echo "<legend>Title 文档标题(必填)</legend>";
+			echo "<legend>{$_local->gui->title} ({$_local->gui->required})</legend>";
 			echo "<div>";
 			echo "<input type='input' name='title' value='{$title}'/>";
 			echo "</div>";
 			echo "</fieldset>";
 			echo "<fieldset>";
-			echo "<legend>Channal 频道(必填)</legend>";
+			echo "<legend>{$_local->gui->channel} ({$_local->gui->required})</legend>";
 			echo "<div>";
 			PDO_Connect("sqlite:"._FILE_DB_CHANNAL_);
 			$query = "select * from channal where owner = '{$_COOKIE["userid"]}'   limit 0,100";
@@ -374,10 +374,10 @@ switch($op){
 				echo '</div>';
 				echo '<div class="title" style="flex:2;padding-bottom:5px;">';
 				if($FetchWBW==0){
-					echo "空白";
+					echo $_local->gui->blank;
 				}
 				else{
-					echo $FetchWBW."个段落";
+					echo $FetchWBW.$_local->gui->para;
 				}
 				echo '</div>';
 
@@ -388,10 +388,10 @@ switch($op){
 				echo '</div>';
 				echo '<div class="title" style="flex:2;padding-bottom:5px;">';
 				if($FetchWBW==0){
-					echo "空白";
+					echo $_local->gui->blank;
 				}
 				else{
-					echo $FetchWBW."个段落";
+					echo $FetchWBW.$_local->gui->para;
 				}
 				echo '</div>';
 
@@ -412,7 +412,7 @@ switch($op){
 			echo "</div>";
 			echo "</fieldset>";
 			echo "<fieldset>";
-			echo "<legend>Language 语言</legend>";
+			echo "<legend>{$_local->gui->language}</legend>";
 			echo "<select name='lang'>";
 			$lang_list = new lang_enum;
 			foreach ($user_setting['studio.translation.lang'] as $key => $value) {

+ 27 - 0
app/studio/svg/icon.svg

@@ -665,4 +665,31 @@
 			</g>
 		</g>
 	</symbol>
+	<symbol xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"
+		id="channel_leaves" viewBox=" 0 0 512 512">
+		<g>
+			<g>
+				<path
+					d="M310.039,455.366c-3.9,0-7.798-0.08-11.692-0.242c-45.707-1.895-89.202-14.36-129.273-37.049    c-31.671-17.932-58.945-41.001-81.41-68.745c-32.397,16.057-61.362,39.042-85.001,68.057C51.769,477.66,123.799,512,202.005,512    c63.386,0,122.711-22.562,169.066-63.202C351.012,453.135,330.506,455.366,310.039,455.366z" />
+			</g>
+		</g>
+		<g>
+			<g>
+				<path
+					d="M295.566,390.201c-38.839-24.169-70.547-56.444-94.24-95.932c-18.726-31.209-31.094-64.721-36.975-99.931    c-36.103-1.989-72.63,3.743-107.499,17.344c13.036,76.642,58.799,142.013,126.855,180.545    c55.153,31.227,117.884,40.823,178.24,28.304C338.631,413.257,316.236,403.062,295.566,390.201z" />
+			</g>
+		</g>
+		<g>
+			<g>
+				<path
+					d="M325.138,332.333c-21.892-40.168-33.581-83.877-34.745-129.912c-0.919-36.384,4.829-71.641,17.062-105.179    c-30.438-19.518-65.048-32.528-102.093-37.87c-26.417,73.121-18.801,152.552,21.439,219.613    c32.608,54.345,82.47,93.604,141.16,112.446C351.253,373.613,336.787,353.707,325.138,332.333z" />
+			</g>
+		</g>
+		<g>
+			<g>
+				<path
+					d="M509.253,196.891C507.279,118.708,471.13,47.569,409.636,0c-59.012,50.614-91.522,123.488-89.546,201.671    c1.8,71.276,32.014,136.689,83.932,183.734V240.646c0-8.203,6.651-14.853,14.853-14.853c8.202,0,14.853,6.65,14.853,14.853v144.95    C483.823,335.891,511.065,268.633,509.253,196.891z" />
+			</g>
+		</g>
+	</symbol>
 </svg>

+ 31 - 29
app/term/term.js

@@ -23,7 +23,7 @@ function note_replace(strIn) {
   return output;
 }
 
-function term_init() {}
+function term_init() { }
 var str_term_fun_word_link = "term_show_win";
 function term_word_link_fun(fun_name) {
   str_term_fun_word_link = fun_name;
@@ -104,9 +104,9 @@ function term_get_my_std_str(strMean) {
 function note_lookup(word, showto) {
   $("#" + showto).load(
     "../term/term.php?op=search&word=" +
-      word +
-      "&username=" +
-      getCookie("username"),
+    word +
+    "&username=" +
+    getCookie("username"),
     function (responseTxt, statusTxt, xhr) {
       if (statusTxt == "success") {
         $(".term_note").each(function (index, element) {
@@ -231,7 +231,7 @@ function term_get_word_to_div(strWord, div, callback) {
               }
               html += "</div>";
             }
-            html += "<div class='term_word_head_authors'>贡献者:";
+            html += "<div class='term_word_head_authors'>" + gLocal.gui.contributor + ":";
             for (y in authors) {
               html += '<a onclick="">' + y + "</a> ";
             }
@@ -266,7 +266,9 @@ function term_get_word_to_div(strWord, div, callback) {
 
               html += "<div class='term_block_bar_right'>";
               html +=
-                "<span><a href='#'>[编辑]</a><a href='#'>[赞]</a><a href='#'>[收藏]</a></span>";
+                "<span><button class='icon_btn'><a href='#'>" + gLocal.gui.edit + "</a></button>";
+              html += "<button class='icon_btn'><a href='#'>" + gLocal.gui.like + "</a></button>";
+              html += "<button class='icon_btn'><a href='#'>" + gLocal.gui.favorite + "</a></button></span>";
               html += "</div>";
 
               html += "</div>";
@@ -282,17 +284,17 @@ function term_get_word_to_div(strWord, div, callback) {
             html += "<div id='term_list_right' >";
 
             html += '<div class="fun_frame">';
-            html += '<div class="title">Language</div>';
+            html += '<div class="title">' + gLocal.gui.language + '</div>';
             html += '<div class="content" style="max-height:10em;">';
-            html += '<div><a href="">All</a></div>';
+            html += '<div><a href="">' + gLocal.gui.all + '</a></div>';
             html += "</div>";
             html += "</div>";
 
             html += '<div class="fun_frame">';
-            html += '<div class="title">Translation</div>';
+            html += '<div class="title">' + gLocal.gui.translation + '</div>';
             html +=
               '<div id="channal_list"  class="content" style="max-height:10em;">';
-            html += '<div><a href="">All</a></div>';
+            html += '<div><a href="">' + gLocal.gui.all + '</a></div>';
             html += "</div>";
             html += "</div>";
 
@@ -333,7 +335,7 @@ function term_get_word_to_div(strWord, div, callback) {
     }
   );
 }
-function term_get_guid_to_html(strGuid) {}
+function term_get_guid_to_html(strGuid) { }
 function term_apply(guid) {
   if (g_eCurrWord) {
     setNodeText(g_eCurrWord, "note", "=term(" + guid + ")");
@@ -603,18 +605,18 @@ function term_updata_translation() {
         noteText = noteText.replace(
           "[",
           "<span class='" +
-            linkclass +
-            "' id='term_link_" +
-            guid +
-            "' gid='" +
-            guid +
-            "' onclick=\"" +
-            str_term_fun_word_link +
-            "('" +
-            guid +
-            "','" +
-            pali +
-            "')\">"
+          linkclass +
+          "' id='term_link_" +
+          guid +
+          "' gid='" +
+          guid +
+          "' onclick=\"" +
+          str_term_fun_word_link +
+          "('" +
+          guid +
+          "','" +
+          pali +
+          "')\">"
         );
         noteText = noteText.replace("]", "</span>");
         noteText = noteText.replace(
@@ -667,8 +669,8 @@ function term_show_win(guid, keyWord = "") {
   if (guid == "") {
     $(term_body).html(
       "当前词条未创建。<br /><a onclick=\"term_add_new('" +
-        keyWord +
-        "')\">现在创建</a>"
+      keyWord +
+      "')\">现在创建</a>"
     );
   } else {
     let currWord = term_lookup_my_id(guid);
@@ -825,16 +827,16 @@ function term_popup_init() {
         //出现在左侧
         $(this).append(
           '<div id="gid_' +
-            gid +
-            '" class="guide_contence" style="left: -5px;"></div>'
+          gid +
+          '" class="guide_contence" style="left: -5px;"></div>'
         );
         $(".guide_contence:after").css("left", "0");
       } else {
         //出现在右侧
         $(this).append(
           '<div id="gid_' +
-            gid +
-            '" class="guide_contence" style="right: -5px;"></div>'
+          gid +
+          '" class="guide_contence" style="right: -5px;"></div>'
         );
         $(".guide_contence:after").css("right", "0");
       }

+ 9 - 13
app/wiki/wiki.php

@@ -288,29 +288,25 @@ term_word_link_fun("wiki_goto_word");
     require_once("../pcdl/head_bar.php");
 ?>
 <div id="head_bar" >
-	<div id="pali_pedia" style="display:flex;">
-		<span>圣典百科</span>
-		<span id="wiki_search" style="width:25em;">
+	<div id="pali_pedia" style="display:flex;width: 100%;">
+		<span style="margin: auto 1em auto 0;"><?php echo $_local->gui->wiki_term; ?></span>
+		<span id="wiki_search" style="width:35vw;margin: auto 0em;font-size: large;">
 			<span style="display:block;">
-				<input id="wiki_search_input" type="input" placeholder="search" style="width:30em;background-color: var(--btn-color);"  onkeyup="wiki_search_keyup(event,this)"/>
+				<input id="wiki_search_input" type="input" placeholder=<?php echo $_local->gui->search; ?> style="width:30vw;background-color: var(--btn-color);border: 1px solid var(--btn-border-color);border-radius: 99px;padding: 3px 15px;"  onkeyup="wiki_search_keyup(event,this)"/>
 			</span>
 			<span id="search_result">
 			</span>
 		</span>	
-	</div>
-
-	<div>
-
-		<span>
-			<a href="#">[设置]</a>
-			<a href="#">[建立词条]</a>
-			<a href="#">[帮助]</a>
+		<span style="font-size: medium; margin: auto 1em auto auto;">
+			<button class="icon_btn"><a href="#"><?php echo $_local->gui->setting; ?></a></button>
+			<button class="icon_btn"><a href="#"><?php echo $_local->gui->new; ?></a></button>
+			<button class="icon_btn"><a href="#"><?php echo $_local->gui->help; ?></a></button>
 		</span>
 	</div>
 </div>
 
 <div id="wiki_contents" style="padding: 0 1em;">
-loading...
+	<?php echo $_local->gui->loading; ?>...
 </div>
 <script>
 	 window.addEventListener('scroll',winScroll);