Skip to content

Commit

Permalink
🪁 feat: project publish status i18n (#264)
Browse files Browse the repository at this point in the history
  • Loading branch information
pdsuwwz authored Sep 29, 2023
1 parent a7bdcb2 commit d65f877
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
4 changes: 3 additions & 1 deletion src/locales/lang/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ export default {
createDate: 'Create date',
state: 'State',
publish: 'Publish',
stop: 'Stop'
stop: 'Stop',
publishedSuccessfully: 'Published Successfully',
publishingStop: 'Stop Publishing'
},
result: {
title: 'Project details'
Expand Down
4 changes: 3 additions & 1 deletion src/locales/lang/zh-hans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ export default {
createDate: '创建日期',
state: '状态',
publish: '发布',
stop: '停止'
stop: '停止',
publishedSuccessfully: '发布成功',
publishingStop: '停止发布'
},
result: {
title: '项目详情'
Expand Down
15 changes: 11 additions & 4 deletions src/modules/Project/components/ProjectItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ import { Loading } from '@element-plus/icons-vue'
import { sleep } from '@/utils/request'
import useCurrentInstance from '@/hooks/useCurrentInstance'
import { ElMessage } from 'element-plus'
import { useLocale, ElMessage } from 'element-plus'
import type { ProjectDetailProps } from '../store'
Expand All @@ -97,6 +97,7 @@ export default defineComponent({
}
},
setup (props) {
const localeInject = useLocale()
const { proxy } = useCurrentInstance()
const isLoading = ref(false)
const getActionIcon = computed(() => {
Expand Down Expand Up @@ -125,9 +126,15 @@ export default defineComponent({
// TODO: Hide it temporarily
// if (error) return
ElMessage.success({
message: 'Successful!'
})
if (props.dataset.isPublished) {
ElMessage.info(
localeInject.t('project.publishingStop')
)
} else {
ElMessage.success(
localeInject.t('project.publishedSuccessfully')
)
}
props.dataset.isPublished = !props.dataset.isPublished
}
Expand Down

0 comments on commit d65f877

Please sign in to comment.