Procházet zdrojové kódy

Merge pull request #1840 from visuddhinanda/agile

添加黑体字过滤
visuddhinanda před 2 roky
rodič
revize
3972b523bc

+ 7 - 1
dashboard/src/components/fts/FullTextSearchResult.tsx

@@ -49,6 +49,7 @@ interface IWidget {
   bookId?: string | null;
   bookId?: string | null;
   book?: number;
   book?: number;
   para?: number;
   para?: number;
+  bold?: string | null;
   orderBy?: string | null;
   orderBy?: string | null;
   match?: string | null;
   match?: string | null;
   keyWord2?: string;
   keyWord2?: string;
@@ -65,6 +66,7 @@ const FullTxtSearchResultWidget = ({
   para,
   para,
   orderBy,
   orderBy,
   match,
   match,
+  bold,
   keyWord2,
   keyWord2,
   view = "pali",
   view = "pali",
   pageType,
   pageType,
@@ -76,7 +78,7 @@ const FullTxtSearchResultWidget = ({
 
 
   useEffect(
   useEffect(
     () => setCurrPage(1),
     () => setCurrPage(1),
-    [view, keyWord, keyWords, tags, bookId, match, pageType]
+    [view, keyWord, keyWords, tags, bookId, match, pageType, bold]
   );
   );
 
 
   useEffect(() => {
   useEffect(() => {
@@ -111,6 +113,9 @@ const FullTxtSearchResultWidget = ({
     if (pageType) {
     if (pageType) {
       url += `&type=${pageType}`;
       url += `&type=${pageType}`;
     }
     }
+    if (bold) {
+      url += `&bold=${bold}`;
+    }
     const offset = (currPage - 1) * 10;
     const offset = (currPage - 1) * 10;
     url += `&limit=10&offset=${offset}`;
     url += `&limit=10&offset=${offset}`;
     console.log("fetch url", url);
     console.log("fetch url", url);
@@ -149,6 +154,7 @@ const FullTxtSearchResultWidget = ({
     pageType,
     pageType,
     tags,
     tags,
     view,
     view,
+    bold,
   ]);
   ]);
   return (
   return (
     <List
     <List

+ 2 - 2
dashboard/src/locales/en-US/article/index.ts

@@ -1,6 +1,6 @@
 const items = {
 const items = {
-	"article.lable": "文章",
-	"article.fields.article.count.label": "文章数量",
+  "article.lable": "article",
+  "article.fields.article.count.label": "article count",
 };
 };
 
 
 export default items;
 export default items;

+ 12 - 12
dashboard/src/locales/en-US/auth/index.ts

@@ -1,16 +1,16 @@
 const items = {
 const items = {
-  "auth.role.label": "角色",
-  "auth.role.owner": "拥有者",
-  "auth.role.manager": "管理员",
-  "auth.role.editor": "编辑者",
-  "auth.role.member": "成员",
-  "auth.role.student": "学生",
-  "auth.role.assistant": "助理老师",
-  "auth.role.unknown": "未知",
-  "auth.role.delete": "已删除",
-  "auth.role.reader": "阅读",
-  "auth.type.user": "用户",
-  "auth.type.group": "群组",
+  "auth.role.label": "role",
+  "auth.role.owner": "owner",
+  "auth.role.manager": "manager",
+  "auth.role.editor": "editor",
+  "auth.role.member": "member",
+  "auth.role.student": "student",
+  "auth.role.assistant": "assistant",
+  "auth.role.unknown": "unknown",
+  "auth.role.delete": "delete",
+  "auth.role.reader": "reader",
+  "auth.type.user": "user",
+  "auth.type.group": "group",
 };
 };
 
 
 export default items;
 export default items;

+ 2 - 2
dashboard/src/locales/en-US/blog/index.ts

@@ -1,6 +1,6 @@
 const items = {
 const items = {
-	"blog.overview": "概览",
-	"blog.palicanon": "译文",
+  "blog.overview": "overview",
+  "blog.palicanon": "palicanon",
 };
 };
 
 
 export default items;
 export default items;

+ 15 - 15
dashboard/src/locales/en-US/channel/index.ts

@@ -1,19 +1,19 @@
 const items = {
 const items = {
-	"channel.title": "版本风格",
-	"channel.type": "类型",
-	"channel.name": "名称",
-	"channel.create.message.noname": "请输入版本名称",
-	"channel.type.all.title": "全部",
-	"channel.type.translation.label": "译文",
-	"channel.type.nissaya.label": "Nissaya",
-	"channel.type.commentary.label": "注疏",
-	"channel.type.original.label": "原文",
-	"channel.type.general.label": "通用",
-	"channel.type.message.required": "请输入版本类型",
-	"channel.lang": "语言",
-	"channel.fields.lang.label": "语言",
-	"channel.fields.type.label": "类型",
-	"channel.fields.name.label": "名称",
+  "channel.title": "channel",
+  "channel.type": "type",
+  "channel.name": "name",
+  "channel.create.message.noname": "请输入版本名称",
+  "channel.type.all.title": "all",
+  "channel.type.translation.label": "translation",
+  "channel.type.nissaya.label": "Nissaya",
+  "channel.type.commentary.label": "commentary",
+  "channel.type.original.label": "original",
+  "channel.type.general.label": "general",
+  "channel.type.message.required": "请输入版本类型",
+  "channel.lang": "language",
+  "channel.fields.lang.label": "语言",
+  "channel.fields.type.label": "类型",
+  "channel.fields.name.label": "名称",
 };
 };
 
 
 export default items;
 export default items;

+ 72 - 72
dashboard/src/locales/en-US/forms.ts

@@ -1,89 +1,89 @@
 const items = {
 const items = {
-  "forms.fields.email.label": "电子邮箱",
-  "forms.fields.email.or.username.label": "电子邮箱/用户名",
-  "forms.fields.password.label": "密码",
-  "forms.fields.confirm-password.label": "确认密码",
+  "forms.fields.email.label": "email",
+  "forms.fields.email.or.username.label": "email / username",
+  "forms.fields.password.label": "password",
+  "forms.fields.confirm-password.label": "confirm password",
   "forms.fields.id.label": "ID",
   "forms.fields.id.label": "ID",
-  "forms.fields.message.label": "消息",
-  "forms.fields.created-at.label": "创建时间",
-  "forms.fields.updated-at.label": "更新时间",
-  "forms.fields.lang.label": "语言",
-  "forms.message.lang.required": "请选择一种语言",
-  "forms.fields.title.label": "标题",
-  "forms.message.title.required": "请输入标题",
-  "forms.fields.subtitle.label": "副标题",
-  "forms.fields.summary.label": "摘要",
-  "forms.fields.content.label": "内容",
-  "forms.fields.content.placeholder": "请输入内容",
-  "forms.fields.tag.label": "标签",
-  "forms.fields.power.label": "权限",
-  "forms.fields.type.label": "类型",
-  "forms.fields.publicity.label": "公开性",
-  "forms.fields.publicity.disable.label": "禁用",
-  "forms.fields.publicity.private.label": "私有",
-  "forms.fields.publicity.public.label": "公开",
-  "forms.fields.teacher.label": "主讲人",
-  "forms.fields.studentsassistant.label": "学生与助教",
-  "forms.fields.student.label": "学生",
-  "forms.fields.assistant.label": "助教",
-  "forms.fields.lesson.label": "",
-  "forms.fields.note.label": "注解",
-  "forms.fields.confidence.label": "信心指数",
-  "forms.fields.confidence.0.label": "不靠谱",
-  "forms.fields.confidence.25.label": "没把握",
-  "forms.fields.confidence.50.label": "一般",
-  "forms.fields.confidence.75.label": "还可以",
-  "forms.fields.confidence.100.label": "有把握",
-  "forms.fields.upload.texture": "上传封面",
-  "forms.fields.markdown.label": "markdown效果预览",
-  "forms.fields.role.label": "角色",
-  "forms.fields.name.label": "名称",
-  "forms.fields.meaning.label": "意思",
+  "forms.fields.message.label": "message",
+  "forms.fields.created-at.label": "created at",
+  "forms.fields.updated-at.label": "updated at",
+  "forms.fields.lang.label": "language",
+  "forms.message.lang.required": "language is required",
+  "forms.fields.title.label": "title",
+  "forms.message.title.required": "title is required",
+  "forms.fields.subtitle.label": "subtitle",
+  "forms.fields.summary.label": "summary",
+  "forms.fields.content.label": "content",
+  "forms.fields.content.placeholder": "content",
+  "forms.fields.tag.label": "tag",
+  "forms.fields.power.label": "power",
+  "forms.fields.type.label": "type",
+  "forms.fields.publicity.label": "publicity",
+  "forms.fields.publicity.disable.label": "disable",
+  "forms.fields.publicity.private.label": "private",
+  "forms.fields.publicity.public.label": "public",
+  "forms.fields.teacher.label": "teacher",
+  "forms.fields.studentsassistant.label": "students / assistant",
+  "forms.fields.student.label": "student",
+  "forms.fields.assistant.label": "assistant",
+  "forms.fields.lesson.label": "lesson",
+  "forms.fields.note.label": "note",
+  "forms.fields.confidence.label": "confidence",
+  "forms.fields.confidence.0.label": "0",
+  "forms.fields.confidence.25.label": "25",
+  "forms.fields.confidence.50.label": "50",
+  "forms.fields.confidence.75.label": "75",
+  "forms.fields.confidence.100.label": "100",
+  "forms.fields.upload.texture": "upload cover",
+  "forms.fields.markdown.label": "markdown preview",
+  "forms.fields.role.label": "role",
+  "forms.fields.name.label": "name",
+  "forms.fields.meaning.label": "meaning",
   "forms.fields.meaning.tooltip": "最长为 256个字符",
   "forms.fields.meaning.tooltip": "最长为 256个字符",
-  "forms.message.meaning.required": "请输入意思",
-  "forms.fields.factors.label": "组份",
+  "forms.message.meaning.required": "meaning is required",
+  "forms.fields.factors.label": "factors",
   "forms.fields.factors.tooltip": "最长为 256个字符",
   "forms.fields.factors.tooltip": "最长为 256个字符",
-  "forms.fields.factor.meaning.label": "组份意思",
+  "forms.fields.factor.meaning.label": "factor meaning",
   "forms.fields.factor.meaning.tooltip": "最长为 256个字符",
   "forms.fields.factor.meaning.tooltip": "最长为 256个字符",
   "forms.fields.parent.label": "词典原型",
   "forms.fields.parent.label": "词典原型",
   "forms.fields.parent.tooltip": "最长为 256个字符",
   "forms.fields.parent.tooltip": "最长为 256个字符",
-  "forms.fields.case.label": "格位",
+  "forms.fields.case.label": "case",
   "forms.fields.case.tooltip": "语法信息参见……",
   "forms.fields.case.tooltip": "语法信息参见……",
-  "forms.fields.user.label": "用户",
-  "forms.message.user.required": "请选择用户",
+  "forms.fields.user.label": "user",
+  "forms.message.user.required": "user is required",
   "forms.message.user.delete": "删除用户吗?此操作无法恢复。",
   "forms.message.user.delete": "删除用户吗?此操作无法恢复。",
   "forms.message.member.remove": "移除此成员吗?此操作无法恢复。",
   "forms.message.member.remove": "移除此成员吗?此操作无法恢复。",
-  "forms.fields.description.label": "简介",
-  "forms.fields.textbook.label": "课本",
-  "forms.fields.status.label": "状态",
-  "forms.fields.ending.label": "语尾",
-  "forms.fields.relation.label": "关系",
-  "forms.fields.from.label": "",
-  "forms.fields.to.label": "连接到",
-  "forms.fields.count.label": "计数",
-  "forms.fields.owner.label": "拥有者",
+  "forms.fields.description.label": "description",
+  "forms.fields.textbook.label": "textbook",
+  "forms.fields.status.label": "status",
+  "forms.fields.ending.label": "ending",
+  "forms.fields.relation.label": "relation",
+  "forms.fields.from.label": "from",
+  "forms.fields.to.label": "to",
+  "forms.fields.count.label": "count",
+  "forms.fields.owner.label": "owner",
   "forms.message.res.remove": "将此此资源从群中移除吗?",
   "forms.message.res.remove": "将此此资源从群中移除吗?",
   "forms.fields.parent2.label": "衍生原型",
   "forms.fields.parent2.label": "衍生原型",
   "forms.fields.parent2.tooltip": "最长为 256个字符",
   "forms.fields.parent2.tooltip": "最长为 256个字符",
-  "forms.fields.username.label": "用户名(登录名)",
-  "forms.fields.nickname.label": "昵称",
-  "forms.fields.editor.label": "编辑者",
-  "forms.fields.category.label": "分类",
-  "forms.fields.match.label": "匹配方式",
-  "forms.fields.dict.name.label": "字典名",
-  "forms.fields.dict.shortname.label": "字典名",
+  "forms.fields.username.label": "username",
+  "forms.fields.nickname.label": "nickname",
+  "forms.fields.editor.label": "editor",
+  "forms.fields.category.label": "category",
+  "forms.fields.match.label": "match",
+  "forms.fields.dict.name.label": "name",
+  "forms.fields.dict.shortname.label": "shortname",
   "forms.fields.url.label": "url",
   "forms.fields.url.label": "url",
-  "forms.fields.fail.label": "失败",
-  "forms.fields.success.label": "成功",
-  "forms.fields.receiver.label": "接收",
-  "forms.fields.event.label": "事件",
-  "forms.message.question.required": "请输入您的问题(必填)",
-  "forms.message.question.description.option": "问题详细描述(选填)",
-  "forms.fields.replay.label": "回复",
-  "forms.status.transferred.label": "等待处理",
-  "forms.status.accept.label": "已经接受",
-  "forms.status.refuse.label": "已经拒绝",
-  "forms.status.cancel.label": "已经撤回",
+  "forms.fields.fail.label": "fail",
+  "forms.fields.success.label": "success",
+  "forms.fields.receiver.label": "receiver",
+  "forms.fields.event.label": "event",
+  "forms.message.question.required": "question is required",
+  "forms.message.question.description.option": "description(option)",
+  "forms.fields.replay.label": "replay",
+  "forms.status.transferred.label": "transferred",
+  "forms.status.accept.label": "accepted",
+  "forms.status.refuse.label": "refused",
+  "forms.status.cancel.label": "canceled",
 };
 };
 
 
 export default items;
 export default items;

+ 4 - 4
dashboard/src/locales/en-US/group/index.ts

@@ -1,8 +1,8 @@
 const items = {
 const items = {
-  "group": "群组",
-  "group.fields.name.label": "群组名",
-  "group.files": "群文档",
-  "group.member": "群成员",
+  group: "group",
+  "group.fields.name.label": "group name",
+  "group.files": "files",
+  "group.member": "members",
 };
 };
 
 
 export default items;
 export default items;

+ 5 - 6
dashboard/src/locales/en-US/message.ts

@@ -1,10 +1,9 @@
 const items = {
 const items = {
-  "flashes.success": "操作成功",
-  "message.irrevocable": "此操作不可撤销",
-  "message.delete.confirm": "确定删除吗?",
-  "message.auth.guest.alert":
-    "您尚未登录,只能查看公开数据,其他功能无法使用。",
-  "message.channel.empty.alert": "没有版本风格被选择,仅显示原文。",
+  "flashes.success": "success",
+  "message.irrevocable": "irrevocable",
+  "message.delete.confirm": "confirm delete",
+  "message.auth.guest.alert": "guest read public resource only.",
+  "message.channel.empty.alert": "channel is empty,only original text",
 };
 };
 
 
 export default items;
 export default items;

+ 26 - 26
dashboard/src/locales/en-US/setting/index.ts

@@ -1,37 +1,37 @@
 const items = {
 const items = {
-  "setting.display.original.label": "显示原文",
-  "setting.display.original.description": "是否显示原文(仅阅读模式)",
-  "setting.layout.direction.label": "排版方向",
+  "setting.display.original.label": "original",
+  "setting.display.original.description": "original(read mode)",
+  "setting.layout.direction.label": "direction",
   "setting.layout.direction.description": "横向或者纵向排版",
   "setting.layout.direction.description": "横向或者纵向排版",
-  "setting.layout.direction.col.label": "纵向排版",
-  "setting.layout.direction.row.label": "横向排版",
+  "setting.layout.direction.col.label": "colum",
+  "setting.layout.direction.row.label": "row",
   "setting.layout.paragraph.label": "对照方式",
   "setting.layout.paragraph.label": "对照方式",
   "setting.layout.paragraph.description": "逐段或逐句对照(仅阅读模式)",
   "setting.layout.paragraph.description": "逐段或逐句对照(仅阅读模式)",
   "setting.layout.paragraph.paragraph.label": "逐段",
   "setting.layout.paragraph.paragraph.label": "逐段",
   "setting.layout.paragraph.sentence.label": "逐句",
   "setting.layout.paragraph.sentence.label": "逐句",
-  "setting.pali.script.primary.label": "巴利脚本",
-  "setting.pali.script.primary.description": "首要的巴利语脚本",
-  "setting.pali.script.secondary.label": "第二巴利脚本",
-  "setting.pali.script.secondary.description": "第二个巴利语脚本",
-  "setting.pali.script.rome.label": "罗马巴利",
-  "setting.pali.script.my.label": "缅文字母",
-  "setting.pali.script.si.label": "新哈拉字母",
-  "setting.pali.script.thai.label": "泰文字母",
+  "setting.pali.script.primary.label": "pali script",
+  "setting.pali.script.primary.description": "primary",
+  "setting.pali.script.secondary.label": "pali script",
+  "setting.pali.script.secondary.description": "secondary",
+  "setting.pali.script.rome.label": "rome",
+  "setting.pali.script.my.label": "myanmar",
+  "setting.pali.script.si.label": "sinhala",
+  "setting.pali.script.thai.label": "thai",
   "setting.pali.script.tai.label": "傣仂文字母",
   "setting.pali.script.tai.label": "傣仂文字母",
-  "setting.pali.script.none.label": "不显示",
-  "setting.search.match.label": "单词匹配",
-  "setting.search.match.complete.label": "精确",
-  "setting.search.match.case.label": "变格",
-  "setting.search.match.similar.label": "形似",
-  "setting.search.orderby.label": "排序",
-  "setting.search.orderby.rank.label": "相关度",
-  "setting.search.orderby.paragraph.label": "段落",
-  "setting.dict.lang.label": "字典语言",
+  "setting.pali.script.none.label": "none",
+  "setting.search.match.label": "match",
+  "setting.search.match.complete.label": "complete",
+  "setting.search.match.case.label": "declension",
+  "setting.search.match.similar.label": "similar",
+  "setting.search.orderby.label": "order by",
+  "setting.search.orderby.rank.label": "rank",
+  "setting.search.orderby.paragraph.label": "paragraph",
+  "setting.dict.lang.label": "language",
   "setting.dict.lang.description": "字典查询结果的语言排序",
   "setting.dict.lang.description": "字典查询结果的语言排序",
-  "setting.nissaya.layout.read.label": "阅读排版方式",
-  "setting.nissaya.layout.edit.label": "阅读排版方式",
-  "setting.nissaya.layout.inline.label": "连续",
-  "setting.nissaya.layout.list.label": "列表",
+  "setting.nissaya.layout.read.label": "layout(read)",
+  "setting.nissaya.layout.edit.label": "layout(edit)",
+  "setting.nissaya.layout.inline.label": "inline",
+  "setting.nissaya.layout.list.label": "list",
 };
 };
 
 
 export default items;
 export default items;

+ 11 - 11
dashboard/src/locales/en-US/tables.ts

@@ -1,16 +1,16 @@
 const items = {
 const items = {
-  "tables.publicity.all": "全部",
-  "tables.publicity.disable": "禁用",
-  "tables.publicity.private": "私有",
+  "tables.publicity.all": "all",
+  "tables.publicity.disable": "disable",
+  "tables.publicity.private": "private",
   "tables.publicity.public.bylink": "链接公开",
   "tables.publicity.public.bylink": "链接公开",
-  "tables.publicity.public": "公开",
-  "tables.publicity.public.edit": "公开可编辑",
-  "tables.role.all": "全部",
-  "tables.role.owner": "拥有者",
-  "tables.role.manager": "管理员",
-  "tables.role.editor": "编辑",
-  "tables.role.member": "成员",
-  "tables.progress.label": "进度",
+  "tables.publicity.public": "public",
+  "tables.publicity.public.edit": "public editable",
+  "tables.role.all": "all",
+  "tables.role.owner": "owner",
+  "tables.role.manager": "manager",
+  "tables.role.editor": "editor",
+  "tables.role.member": "member",
+  "tables.progress.label": "progress",
 };
 };
 
 
 export default items;
 export default items;

+ 7 - 7
dashboard/src/locales/en-US/term/index.ts

@@ -1,16 +1,16 @@
 const items = {
 const items = {
-  "term.fields.sn.label": "序号",
-  "term.fields.word.label": "词头",
-  "term.fields.description.label": "标签",
+  "term.fields.sn.label": "serial",
+  "term.fields.word.label": "word",
+  "term.fields.description.label": "tags",
   "term.fields.description.tooltip":
   "term.fields.description.tooltip":
     "单词说明,可以用来区分相同拼写的不同单词。",
     "单词说明,可以用来区分相同拼写的不同单词。",
-  "term.fields.channel.label": "所属版本",
+  "term.fields.channel.label": "channel",
   "term.fields.channel.tooltip": "该术语仅仅用于某个版本",
   "term.fields.channel.tooltip": "该术语仅仅用于某个版本",
-  "term.fields.meaning.label": "意思",
+  "term.fields.meaning.label": "meaning",
   "term.fields.meaning.tooltip": "单词的首选意思",
   "term.fields.meaning.tooltip": "单词的首选意思",
-  "term.fields.meaning2.label": "其他意思",
+  "term.fields.meaning2.label": "other meanings",
   "term.fields.meaning2.tooltip": "其他意思将出现在后面的括号里",
   "term.fields.meaning2.tooltip": "其他意思将出现在后面的括号里",
-  "term.fields.note.label": "注释",
+  "term.fields.note.label": "note",
 };
 };
 
 
 export default items;
 export default items;

+ 9 - 9
dashboard/src/locales/en-US/utilities.ts

@@ -1,13 +1,13 @@
 const items = {
 const items = {
-  "utilities.time.now": "现在",
-  "utilities.time.secs_ago": "秒之前",
-  "utilities.time.mins_ago": "分钟之前",
-  "utilities.time.hs_ago": "小时之前",
-  "utilities.time.days_ago": "天之前",
-  "utilities.time.weeks_ago": "周之前",
-  "utilities.time.months_ago": "月之前",
-  "utilities.time.year_ago": "年之前",
-  "utilities.time.years_ago": "年之前",
+  "utilities.time.now": "now",
+  "utilities.time.secs_ago": "secs ago",
+  "utilities.time.mins_ago": "mins ago",
+  "utilities.time.hs_ago": "hs ago",
+  "utilities.time.days_ago": "days ago",
+  "utilities.time.weeks_ago": "weeks ago",
+  "utilities.time.months_ago": "months ago",
+  "utilities.time.year_ago": "year ago",
+  "utilities.time.years_ago": "years ago",
 };
 };
 
 
 export default items;
 export default items;

+ 14 - 0
dashboard/src/pages/library/search/search.tsx

@@ -130,6 +130,19 @@ const Widget = () => {
                           setSearchParams(searchParams);
                           setSearchParams(searchParams);
                         }}
                         }}
                       />
                       />
+                      <Select
+                        defaultValue="default"
+                        bordered={false}
+                        options={[
+                          { value: "default", label: "全部单词" },
+                          { value: "on", label: "黑体" },
+                          { value: "off", label: "非黑体" },
+                        ]}
+                        onSelect={(value: string) => {
+                          searchParams.set("bold", value);
+                          setSearchParams(searchParams);
+                        }}
+                      />
                     </Space>
                     </Space>
                   }
                   }
                   items={[
                   items={[
@@ -159,6 +172,7 @@ const Widget = () => {
                   bookId={searchParams.get("book")}
                   bookId={searchParams.get("book")}
                   orderBy={searchParams.get("orderby")}
                   orderBy={searchParams.get("orderby")}
                   match={searchParams.get("match")}
                   match={searchParams.get("match")}
+                  bold={searchParams.get("bold")}
                 />
                 />
               </Space>
               </Space>
             </Col>
             </Col>