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

:globe_with_meridians: publicity and channel type

visuddhinanda 3 лет назад
Родитель
Сommit
69d6f570ab

+ 2 - 0
dashboard/src/locales/zh-Hans/buttons.ts

@@ -5,6 +5,8 @@ const items = {
 	"buttons.delete": "删除",
 	"buttons.delete.all": "批量删除",
 	"buttons.selected": "已经选择",
+	"buttons.unselect": "取消选择",
+	"buttons.option": "操作",
 };
 
 export default items;

+ 14 - 11
dashboard/src/locales/zh-Hans/channel/index.ts

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

+ 8 - 1
dashboard/src/locales/zh-Hans/tables.ts

@@ -1,3 +1,10 @@
-const items = {};
+const items = {
+	"tables.publicity.all": "全部",
+	"tables.publicity.disable": "禁用",
+	"tables.publicity.private": "私有",
+	"tables.publicity.public.bylink": "链接公开",
+	"tables.publicity.public": "公开",
+	"tables.publicity.public.edit": "公开可编辑",
+};
 
 export default items;

+ 2 - 2
dashboard/src/pages/studio/anthology/list.tsx

@@ -122,7 +122,7 @@ const Widget = () => {
 						sorter: (a, b) => a.createdAt - b.createdAt,
 					},
 					{
-						title: "操作",
+						title: intl.formatMessage({ id: "buttons.option" }),
 						key: "option",
 						width: 120,
 						valueType: "option",
@@ -158,7 +158,7 @@ const Widget = () => {
 								style={{ marginInlineStart: 8 }}
 								onClick={onCleanSelected}
 							>
-								取消选择
+								{intl.formatMessage({ id: "buttons.unselect" })}
 							</Button>
 						</span>
 					</Space>

+ 75 - 17
dashboard/src/pages/studio/channel/list.tsx

@@ -100,12 +100,42 @@ const Widget = () => {
 						filters: true,
 						onFilter: true,
 						valueEnum: {
-							all: { text: "全部", status: "Default" },
-							translation: { text: "译文", status: "Success" },
-							nissaya: { text: "逐词解析", status: "Processing" },
-							commentary: { text: "注疏", status: "Default" },
-							original: { text: "原文", status: "Default" },
-							general: { text: "通用", status: "Default" },
+							all: {
+								text: intl.formatMessage({
+									id: "channel.type.all.title",
+								}),
+								status: "Default",
+							},
+							translation: {
+								text: intl.formatMessage({
+									id: "channel.type.translation.title",
+								}),
+								status: "Success",
+							},
+							nissaya: {
+								text: intl.formatMessage({
+									id: "channel.type.nissaya.title",
+								}),
+								status: "Processing",
+							},
+							commentary: {
+								text: intl.formatMessage({
+									id: "channel.type.commentary.title",
+								}),
+								status: "Default",
+							},
+							original: {
+								text: intl.formatMessage({
+									id: "channel.type.original.title",
+								}),
+								status: "Default",
+							},
+							general: {
+								text: intl.formatMessage({
+									id: "channel.type.general.title",
+								}),
+								status: "Default",
+							},
 						},
 					},
 					{
@@ -119,12 +149,42 @@ const Widget = () => {
 						filters: true,
 						onFilter: true,
 						valueEnum: {
-							all: { text: "全部", status: "Default" },
-							0: { text: "禁用", status: "Success" },
-							10: { text: "私有", status: "Processing" },
-							20: { text: "链接阅读", status: "Default" },
-							30: { text: "公开阅读", status: "Default" },
-							40: { text: "公开可编辑", status: "Default" },
+							all: {
+								text: intl.formatMessage({
+									id: "tables.publicity.all",
+								}),
+								status: "Default",
+							},
+							0: {
+								text: intl.formatMessage({
+									id: "tables.publicity.disable",
+								}),
+								status: "Default",
+							},
+							10: {
+								text: intl.formatMessage({
+									id: "tables.publicity.private",
+								}),
+								status: "Processing",
+							},
+							20: {
+								text: intl.formatMessage({
+									id: "tables.publicity.public.bylink",
+								}),
+								status: "Processing",
+							},
+							30: {
+								text: intl.formatMessage({
+									id: "tables.publicity.public",
+								}),
+								status: "Success",
+							},
+							40: {
+								text: intl.formatMessage({
+									id: "tables.publicity.public.edit",
+								}),
+								status: "Success",
+							},
 						},
 					},
 					{
@@ -139,7 +199,7 @@ const Widget = () => {
 						//sorter: (a, b) => a.createdAt - b.createdAt,
 					},
 					{
-						title: "操作",
+						title: intl.formatMessage({ id: "buttons.option" }),
 						key: "option",
 						width: 120,
 						valueType: "option",
@@ -168,16 +228,14 @@ const Widget = () => {
 				}) => (
 					<Space size={24}>
 						<span>
-							{intl.formatMessage({
-								id: "buttons.selected",
-							})}
+							{intl.formatMessage({ id: "buttons.selected" })}
 							{selectedRowKeys.length}
 							<Button
 								type="link"
 								style={{ marginInlineStart: 8 }}
 								onClick={onCleanSelected}
 							>
-								取消选择
+								{intl.formatMessage({ id: "buttons.unselect" })}
 							</Button>
 						</span>
 					</Space>

+ 1 - 1
dashboard/src/pages/studio/dict/list.tsx

@@ -147,7 +147,7 @@ const Widget = () => {
 								style={{ marginInlineStart: 8 }}
 								onClick={onCleanSelected}
 							>
-								取消选择
+								{intl.formatMessage({ id: "buttons.unselect" })}
 							</Button>
 						</span>
 					</Space>

+ 4 - 2
dashboard/src/pages/studio/recent/index.tsx

@@ -118,7 +118,7 @@ const Widget = () => {
 							sorter: (a, b) => a.createdAt - b.createdAt,
 						},
 						{
-							title: "操作",
+							title: intl.formatMessage({ id: "buttons.option" }),
 							key: "option",
 							width: 120,
 							valueType: "option",
@@ -155,7 +155,9 @@ const Widget = () => {
 									style={{ marginInlineStart: 8 }}
 									onClick={onCleanSelected}
 								>
-									取消选择
+									{intl.formatMessage({
+										id: "buttons.unselect",
+									})}
 								</Button>
 							</span>
 						</Space>

+ 1 - 1
dashboard/src/pages/studio/term/list.tsx

@@ -134,7 +134,7 @@ const Widget = () => {
 								style={{ marginInlineStart: 8 }}
 								onClick={onCleanSelected}
 							>
-								取消选择
+								{intl.formatMessage({ id: "buttons.unselect" })}
 							</Button>
 						</span>
 					</Space>