Browse Source

Merge pull request #776 from visuddhinanda/laravel

🌐 myanmar
visuddhinanda 4 years ago
parent
commit
1a330874ad

+ 10 - 0
dashboard/src/pages/[username]/index.tsx

@@ -0,0 +1,10 @@
+import {Link} from 'umi';
+
+export default ({match}) => {
+  return (
+    <div>
+      <h1>welcome to  {match.params.username} zone</h1>
+      <Link to="/demo">Go home</Link>
+    </div>
+  )
+}

+ 13 - 1
public/app/article/article.js

@@ -514,7 +514,19 @@ function render_toc(){
 					nextChapter = it.next_chapter;
 					nextChapter = it.next_chapter;
 					prevChapter = it.prev_chapter;
 					prevChapter = it.prev_chapter;
 				}
 				}
-				arrToc.push({article:it.paragraph,title:it.toc,level:it.level});
+                let strTitle;
+                switch (getCookie('language')) {
+                    case 'my':
+                        strTitle = roman_to_my(it.toc);
+                        break;
+                    case 'si':
+                        strTitle = roman_to_si(it.toc);
+                        break;
+                    default:
+                        strTitle = it.toc;
+                        break;
+                }
+				arrToc.push({article:it.paragraph,title:strTitle,title_roman:it.toc,level:it.level});
 			}
 			}
 			$("#toc_content").fancytree({
 			$("#toc_content").fancytree({
 				autoScroll: true,
 				autoScroll: true,

+ 53 - 13
public/app/palicanon/palicanon.js

@@ -19,6 +19,7 @@ function palicanon_onload() {
 	$("#tag_input").keypress(function () {
 	$("#tag_input").keypress(function () {
 		tag_render_others();
 		tag_render_others();
 	});
 	});
+    render_main_tag();
 }
 }
 
 
 function palicanon_load_term() {
 function palicanon_load_term() {
@@ -32,7 +33,7 @@ function palicanon_load_term() {
             break;    
             break;    
         case '':
         case '':
             lang = 'en';
             lang = 'en';
-            break;  
+            break;
     }
     }
 	$.get(
 	$.get(
 		"/api/v2/terms",
 		"/api/v2/terms",
@@ -67,13 +68,17 @@ function tag_changed() {
 	}
 	}
 	console.log(strTags);
 	console.log(strTags);
 	let lang = getCookie("language");
 	let lang = getCookie("language");
-	if (lang == "zh-cn") {
-		lang = "zh-hans";
-	} else if (lang == "zh-tw") {
-		lang = "zh-hant";
-	} else if (lang == "") {
-		lang = "en";
-	}
+    switch (lang) {
+        case 'zh-cn':
+            lang = 'zh-hans';
+            break;
+        case 'zh-tw':
+            lang = 'zh-hant';
+            break;    
+        case '':
+            lang = 'en';
+            break;
+    }
 	$.get(
 	$.get(
 		"./book_tag.php",
 		"./book_tag.php",
 		{
 		{
@@ -206,7 +211,21 @@ function render_chapter_head(chapter_info, parent) {
 	let link = "../reader/?view=chapter&book=" + chapter_info.book + "&par=" + chapter_info.paragraph;
 	let link = "../reader/?view=chapter&book=" + chapter_info.book + "&par=" + chapter_info.paragraph;
 	html += "<div class='title'>";
 	html += "<div class='title'>";
 	if (typeof chapter_info.trans_title == "undefined") {
 	if (typeof chapter_info.trans_title == "undefined") {
-		html += "	<div class='title_1'><a href='" + link + "' target='_blank'>" + chapter_info.text + "</a></div>";
+		html += "	<div class='title_1'>";
+        html += "<a href='" + link + "' target='_blank'>" ;
+        switch (getCookie('language')) {
+            case 'my':
+                html += roman_to_my(chapter_info.text);
+                break;
+            case 'si':
+                html += roman_to_si(chapter_info.text);
+                break;        
+            default:
+                html += chapter_info.text ;
+                break;
+        }
+        html += "</a>";
+        html += "</div>";
 	} else {
 	} else {
 		html +=
 		html +=
 			"	<div class='title_1'><a href='" + link + "' target='_blank'>" + chapter_info.trans_title + "</a></div>";
 			"	<div class='title_1'><a href='" + link + "' target='_blank'>" + chapter_info.trans_title + "</a></div>";
@@ -310,7 +329,20 @@ function palicanon_render_chapter_row(chapter) {
 	html += '<div class="title">';
 	html += '<div class="title">';
 
 
 	if (typeof chapter.trans_title == "undefined") {
 	if (typeof chapter.trans_title == "undefined") {
-		html += "	<div class='title_1'>" + chapter.title + "</div>";
+		html += "	<div class='title_1'>" ;
+        switch (getCookie('language')) {
+            case 'my':
+                html += roman_to_my(chapter.title);
+                break;
+            case 'si':
+                html += roman_to_si(chapter.title);
+                break;
+            default:
+                html += chapter.title ;
+                break;
+        }
+        
+        html += "</div>";
 	} else {
 	} else {
 		html += "	<div class='title_1'>" + chapter.trans_title + "</div>";
 		html += "	<div class='title_1'>" + chapter.trans_title + "</div>";
 	}
 	}
@@ -342,10 +374,18 @@ function palicanon_render_chapter_row(chapter) {
 }
 }
 function tag_get_local_word(word) {
 function tag_get_local_word(word) {
 	let termKey = term_lookup_my(word, "", getCookie("userid"), getCookie("language"));
 	let termKey = term_lookup_my(word, "", getCookie("userid"), getCookie("language"));
-	if (termKey) {
-		return termKey.meaning;
+	if (typeof termKey == 'undefined' || termKey === false || termKey === '') {
+        switch (getCookie('language')) {
+            case 'my':
+                return roman_to_my(word);
+            case 'si':
+                return roman_to_si(word);
+            default:
+                return word;
+        }        
+		
 	} else {
 	} else {
-		return word;
+        return termKey.meaning;
 	}
 	}
 }
 }
 function tag_render_others() {
 function tag_render_others() {

+ 4 - 0
public/app/public/js/comm.js

@@ -292,6 +292,10 @@ function testCJK(string){
 	return reg.test(string);
 	return reg.test(string);
 
 
 }
 }
+//显示程序行号
+function get_line(){
+    return (new Error().stack.split(':')[7]);
+}
 
 
 //所有页面都需要在加载的的时候设置浏览器时区
 //所有页面都需要在加载的的时候设置浏览器时区
 setTimeZone();
 setTimeZone();

+ 15 - 15
public/app/public/lang/my.json

@@ -45,13 +45,13 @@
 		"click_word_to": "click word to ",
 		"click_word_to": "click word to ",
 		"code_convert": "Code Convert",
 		"code_convert": "Code Convert",
 		"color": "Color",
 		"color": "Color",
-		"column_compare": "Up&nbsp;&&nbsp;Down",
+		"column_compare": "ပေါ်&nbsp;&&nbsp;အောက်",
 		"commentary": "Commentary",
 		"commentary": "Commentary",
 		"completely_delete": "completely delete",
 		"completely_delete": "completely delete",
 		"computer": "Computer",
 		"computer": "Computer",
 		"confirm": "Confirm",
 		"confirm": "Confirm",
-		"content": "Content",
-		"contents": "Table of Content",
+		"content": "မာတိကာ",
+		"contents": "မာတိကာ",
 		"copy": "copy",
 		"copy": "copy",
 		"copy_to_clipboard": "copy the link to clipboard",
 		"copy_to_clipboard": "copy the link to clipboard",
 		"creat_a_new_file_by_yourself": "Creat a new file by yourself",
 		"creat_a_new_file_by_yourself": "Creat a new file by yourself",
@@ -71,7 +71,7 @@
 		"dict": "Dict",
 		"dict": "Dict",
 		"dict_match": "Match the Dictionary and Document",
 		"dict_match": "Match the Dictionary and Document",
 		"dict_terms": "Terms",
 		"dict_terms": "Terms",
-		"dictionary": "Dictionary",
+		"dictionary": "အဘိဓာန်",
 		"dictionary_match_result": "Dictionary Match Result",
 		"dictionary_match_result": "Dictionary Match Result",
 		"dictsouce": "Source of Terms",
 		"dictsouce": "Source of Terms",
 		"difficulty": "difficulty level",
 		"difficulty": "difficulty level",
@@ -80,8 +80,8 @@
 		"download": "[Download]",
 		"download": "[Download]",
 		"draft": "As Draft",
 		"draft": "As Draft",
 		"dawn": "dawn",
 		"dawn": "dawn",
-		"each_paragraph": "E&nbsp;paragraph",
-		"each_sentence": "E&nbsp;sentence",
+		"each_paragraph": "paragraph",
+		"each_sentence": "ဝါကျကဏ္ဍ",
 		"eat": "eat",
 		"eat": "eat",
 		"edit": "Edit",
 		"edit": "Edit",
 		"edit_now": "Edit in Studio",
 		"edit_now": "Edit in Studio",
@@ -147,11 +147,11 @@
 		"input": "input",
 		"input": "input",
 		"kala": "ကာလ",
 		"kala": "ကာလ",
 		"keywords": "Keywords",
 		"keywords": "Keywords",
-		"language": "Language",
+		"language": "ဘာသာ",
 		"language_select": "ဘာသာ",
 		"language_select": "ဘာသာ",
 		"layout": "Layout",
 		"layout": "Layout",
 		"left": "Remains ",
 		"left": "Remains ",
-		"lesson": "lesson",
+		"lesson": "သင်တန်း",
 		"letters": "&nbsp;letters",
 		"letters": "&nbsp;letters",
 		"level": "Lv",
 		"level": "Lv",
 		"list": "List",
 		"list": "List",
@@ -220,8 +220,8 @@
 		"pa_auk_dictionary": "Pa-auk Dictionary",
 		"pa_auk_dictionary": "Pa-auk Dictionary",
 		"pacchā_māsa": "ပစ္ဆာ-မာသ",
 		"pacchā_māsa": "ပစ္ဆာ-မာသ",
 		"pakkha": "Lunar Phases ",
 		"pakkha": "Lunar Phases ",
-		"pāli": "Pāli",
-		"pali_canon": "Pāḷi Canon",
+		"pāli": "ပါဠိ",
+		"pali_canon": "တိပိဋက",
 		"pāli_code": "Pāli Code",
 		"pāli_code": "Pāli Code",
 		"para": "&nbsp;Paragraphs",
 		"para": "&nbsp;Paragraphs",
 		"paragraph": "Paragraph",
 		"paragraph": "Paragraph",
@@ -245,7 +245,7 @@
 		"pubba_māsa": "ပုဗ္ဗ-မာသ",
 		"pubba_māsa": "ပုဗ္ဗ-မာသ",
 		"publish": "Publish",
 		"publish": "Publish",
 		"ravi": "ရဝိ",
 		"ravi": "ရဝိ",
-		"read": "Read",
+		"read": "စာဖတ်",
 		"read_only": "Read Only",
 		"read_only": "Read Only",
 		"recent_scan": "Recent Scan",
 		"recent_scan": "Recent Scan",
 		"recycle_bin": "Recycle Bin",
 		"recycle_bin": "Recycle Bin",
@@ -261,7 +261,7 @@
 		"revision_mode": "Revision Mode",
 		"revision_mode": "Revision Mode",
 		"round_1": "Round ",
 		"round_1": "Round ",
 		"round_2": "&nbsp;dictionary",
 		"round_2": "&nbsp;dictionary",
-		"row_compare": "Left&nbsp;&&nbsp;Right",
+		"row_compare": "ဘယ်&nbsp;&&nbsp;ညာ",
 		"same_word": "same words",
 		"same_word": "same words",
 		"saṃvacchara": "သံဝစ္ဆရ",
 		"saṃvacchara": "သံဝစ္ဆရ",
 		"sandhi": "Sandhi",
 		"sandhi": "Sandhi",
@@ -312,7 +312,7 @@
 		"total_workload": "total workload",
 		"total_workload": "total workload",
 		"totally": "Totally ",
 		"totally": "Totally ",
 		"tran_workload": "whole passage translate ",
 		"tran_workload": "whole passage translate ",
-		"translate": "Translate",
+		"translate": "စကားပြန်",
 		"translate_convert": "Translate Convert",
 		"translate_convert": "Translate Convert",
 		"translate1": "Translated By ",
 		"translate1": "Translated By ",
 		"translation": "Translation",
 		"translation": "Translation",
@@ -321,7 +321,7 @@
 		"undo_shared": "undo shared",
 		"undo_shared": "undo shared",
 		"unsplit": "Slur Splited",
 		"unsplit": "Slur Splited",
 		"up": "Up",
 		"up": "Up",
-		"up_and_down": "Up And Down",
+		"up_and_down": "ပေါ် And အောက်",
 		"update_all_wbw_to_database": "Update All WBW to Database",
 		"update_all_wbw_to_database": "Update All WBW to Database",
 		"user": "User",
 		"user": "User",
 		"to_user_dictionary": "Save & Add to My Vocabulary List",
 		"to_user_dictionary": "Save & Add to My Vocabulary List",
@@ -935,7 +935,7 @@
 		},
 		},
 		{
 		{
 			"id": ".comp.",
 			"id": ".comp.",
-			"value": "သမာသ"
+			"value": "စကားပေါင်း"
 		},
 		},
 		{
 		{
 			"id": ".pre.",
 			"id": ".pre.",

+ 1 - 1
public/app/term/note.js

@@ -308,7 +308,7 @@ function render_read_mode_sent(iterator) {
 	htmlSent += "</div>";
 	htmlSent += "</div>";
 	htmlSent += "<div class='sent_tran_div'>";
 	htmlSent += "<div class='sent_tran_div'>";
 	for (const oneTran of iterator.translation) {
 	for (const oneTran of iterator.translation) {
-		let html = "<span class='tran_sent' lang='" + oneTran.lang + "' channal='" + oneTran.channal + "'>";
+		let html = "<span class='sent_tran' lang='" + oneTran.lang + "' channal='" + oneTran.channal + "'>";
 
 
 		//将绝对链接转换为 用户连接的主机链接
 		//将绝对链接转换为 用户连接的主机链接
 		//oneTran.text = oneTran.text.replace(/www-[A-z]*.wikipali.org/g,location.host);
 		//oneTran.text = oneTran.text.replace(/www-[A-z]*.wikipali.org/g,location.host);

+ 10 - 4
public/app/term/term.css

@@ -668,6 +668,12 @@ pw {
 .preview {
 .preview {
 	font-size: 110%;
 	font-size: 110%;
 }
 }
+.preview::first-letter {
+	text-transform:uppercase;
+}
+.sent_tran > p::first-letter {
+	text-transform:uppercase;
+}
 .compact .body > .head_bar {
 .compact .body > .head_bar {
 	display: flex;
 	display: flex;
 }
 }
@@ -887,7 +893,7 @@ w:hover {
 .sent_mode .note_shell {
 .sent_mode .note_shell {
 	display: block;
 	display: block;
 }
 }
-.tran_sent p {
+.sent_tran p {
 	display: inline;
 	display: inline;
 }
 }
 .sent_tran li {
 .sent_tran li {
@@ -923,11 +929,11 @@ span.keybutton {
 	padding: 0.7rem;
 	padding: 0.7rem;
 	word-break: break-word;
 	word-break: break-word;
 }
 }
-span.tran_sent {
+span.sent_tran {
 	line-height: 1.7em;
 	line-height: 1.7em;
 }
 }
-.tran_sent ul,
-.tran_sent li {
+.sent_tran ul,
+.sent_tran li {
 	list-style-type: unset;
 	list-style-type: unset;
 	margin-left: 1em;
 	margin-left: 1em;
 }
 }

+ 1 - 1
public/app/term/term_edit_dlg.js

@@ -175,7 +175,7 @@ function term_edit_dlg_render(word = null,obj=null) {
         if(word.channel === ''){
         if(word.channel === ''){
             output += "通用于<b>所有版本</b>";
             output += "通用于<b>所有版本</b>";
             //判断是否只读
             //判断是否只读
-            if(sentChannel.power !== 30){
+            if(sentChannel !==null && sentChannel.power !== 30){
                 output += "(只读)";
                 output += "(只读)";
             }
             }
         }else{
         }else{