Skip to content

Commit

Permalink
translate more
Browse files Browse the repository at this point in the history
  • Loading branch information
Haitao committed Jun 13, 2023
1 parent 43ab68e commit aee1427
Show file tree
Hide file tree
Showing 23 changed files with 178 additions and 140 deletions.
4 changes: 3 additions & 1 deletion src/layout/components/NavBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
</span>
</div>
<div class="tabs-close-item" style="float:right" @click="closeAllTab">
CloseAll
{{$t("Public.closeAll")}}
</div>
</div>
</div>
Expand Down Expand Up @@ -128,6 +128,8 @@ export default {
//把语言保存在localStorage中
localStorage.setItem("lang", 'en');
}
//刷新
window.location.reload();
}
},
Expand Down
18 changes: 18 additions & 0 deletions src/locales/en.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
export default {
Public:{
"add":"Add",
"edit":"Edit",
"delete":"Delete",
"cancel":"Cancel",
"confirm":"Confirm",
"search":"Search",
"pass":"Pass",
"check":"Check",
"open":"Open",
"close":"Close",
"closeAll":"CloseAll",
"state":"State",
"public":"Public",
"private":"Private",
"top":"Top",
"publish":"Publish",
},
Home: {
"translate":"Chinese",
"user":"User",
Expand Down
18 changes: 18 additions & 0 deletions src/locales/zh.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
export default {
Public:{
"add":"添加",
"edit":"编辑",
"delete":"删除",
"cancel":"取消",
"confirm":"确认",
"search":"搜索",
"pass":"通过",
"check":"查看",
"open":"开启",
"close":"关闭",
"closeAll":"全部关闭",
"state":"状态",
"public":"公开",
"private":"私密",
"top":"置顶",
"publish":"发布",
},
Home: {
"translate":"英语",
"user":"用户",
Expand Down
2 changes: 1 addition & 1 deletion src/views/about/About.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
class="edit-btn"
@click="updateAbout"
>
修改
{{$t("Public.edit")}}
</el-button>
</el-card>
</template>
Expand Down
18 changes: 9 additions & 9 deletions src/views/album/Album.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
style="margin-left:1rem"
@click="searchAlbums"
>
搜索
{{$t("Public.search")}}
</el-button>
</div>
</div>
Expand All @@ -52,10 +52,10 @@
<i class="el-icon-more" style="color:#fff" />
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="'update' + JSON.stringify(item)">
<i class="el-icon-edit" />编辑
<i class="el-icon-edit" />{{$t("Public.edit")}}
</el-dropdown-item>
<el-dropdown-item :command="'delete' + item.id">
<i class="el-icon-delete" />删除
<i class="el-icon-delete" />{{$t("Public.delete")}}
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
Expand Down Expand Up @@ -114,15 +114,15 @@
</el-form-item>
<el-form-item label="发布形式">
<el-radio-group v-model="albumForum.status">
<el-radio :label="1">公开</el-radio>
<el-radio :label="2">私密</el-radio>
<el-radio :label="1">{{$t("Public.public")}}</el-radio>
<el-radio :label="2">{{$t("Public.private")}}</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<div slot="footer">
<el-button @click="addOrEdit = false">取 消</el-button>
<el-button @click="addOrEdit = false">{{$t("Public.cancel")}}</el-button>
<el-button type="primary" @click="addOrEditAlbum">
确 定
{{$t("Public.confirm")}}
</el-button>
</div>
</el-dialog>
Expand All @@ -133,9 +133,9 @@
</div>
<div style="font-size:1rem">是否删除该相册?</div>
<div slot="footer">
<el-button @click="isdelete = false">取 消</el-button>
<el-button @click="isdelete = false">{{$t("Public.cancel")}}</el-button>
<el-button type="primary" @click="deleteAlbum">
确 定
{{$t("Public.confirm")}}
</el-button>
</div>
</el-dialog>
Expand Down
6 changes: 3 additions & 3 deletions src/views/album/Delete.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
size="small"
icon="el-icon-deleteItem"
>
批量删除
{{$t("Public.delete")}}
</el-button>
</div>
<!-- 照片列表 -->
Expand Down Expand Up @@ -74,9 +74,9 @@
</div>
<div style="font-size:1rem">是否删除选中照片?</div>
<div slot="footer">
<el-button @click="batchDeletePhoto = false">取 消</el-button>
<el-button @click="batchDeletePhoto = false">{{$t("Public.cancel")}}</el-button>
<el-button type="primary" @click="deletePhotos">
确 定
{{$t("Public.confirm")}}
</el-button>
</div>
</el-dialog>
Expand Down
20 changes: 10 additions & 10 deletions src/views/album/Photo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
size="small"
icon="el-icon-deleteItem"
>
批量删除
{{$t("Public.delete")}}
</el-button>
</div>
</div>
Expand All @@ -73,7 +73,7 @@
<i class="el-icon-more" style="color:#fff" />
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="JSON.stringify(item)">
<i class="el-icon-edit" />编辑
<i class="el-icon-edit" />{{$t("Public.edit")}}
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
Expand Down Expand Up @@ -144,7 +144,7 @@
<div class="upload-footer">
<div class="upload-count">共上传{{ uploadList.length }}张照片</div>
<div style="margin-left:auto">
<el-button @click="uploadPhoto = false">取 消</el-button>
<el-button @click="uploadPhoto = false">{{$t("Public.cancel")}}</el-button>
<el-button
@click="savePhotos"
type="primary"
Expand All @@ -159,7 +159,7 @@
<!-- 编辑对话框 -->
<el-dialog :visible.sync="editPhoto" width="30%">
<div class="dialog-title-container" slot="title">
修改信息
{{$t("Public.edit")}}
</div>
<el-form label-width="80px" size="medium" :model="photoForm">
<el-form-item label="照片名称">
Expand All @@ -170,9 +170,9 @@
</el-form-item>
</el-form>
<div slot="footer">
<el-button @click="editPhoto = false">取 消</el-button>
<el-button @click="editPhoto = false">{{$t("Public.cancel")}}</el-button>
<el-button type="primary" @click="updatePhoto">
确 定
{{$t("Public.confirm")}}
</el-button>
</div>
</el-dialog>
Expand All @@ -183,9 +183,9 @@
</div>
<div style="font-size:1rem">是否删除选中照片?</div>
<div slot="footer">
<el-button @click="batchDeletePhoto = false">取 消</el-button>
<el-button @click="batchDeletePhoto = false">{{$t("Public.cancel")}}</el-button>
<el-button type="primary" @click="updatePhotoDelete(null)">
确 定
{{$t("Public.confirm")}}
</el-button>
</div>
</el-dialog>
Expand Down Expand Up @@ -219,13 +219,13 @@
</el-radio-group>
</el-form>
<div slot="footer">
<el-button @click="movePhoto = false">取 消</el-button>
<el-button @click="movePhoto = false">{{$t("Public.cancel")}}</el-button>
<el-button
:disabled="albumId == null"
type="primary"
@click="updatePhotoAlbum"
>
确 定
{{$t("Public.confirm")}}
</el-button>
</div>
</el-dialog>
Expand Down
18 changes: 9 additions & 9 deletions src/views/category/Category.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
icon="el-icon-plus"
@click="openModel(null)"
>
新增
{{$t("Public.add")}}
</el-button>
<el-button
type="danger"
Expand All @@ -18,7 +18,7 @@
:disabled="this.categoryIdList.length == 0"
@click="isDelete = true"
>
批量删除
{{$t("Public.delete")}}
</el-button>
<div style="margin-left:auto">
<el-input
Expand All @@ -36,7 +36,7 @@
style="margin-left:1rem"
@click="searchCategories"
>
搜索
{{$t("Public.search")}}
</el-button>
</div>
</div>
Expand Down Expand Up @@ -64,15 +64,15 @@
<el-table-column label="操作" width="160" align="center">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="openModel(scope.row)">
编辑
{{$t("Public.edit")}}
</el-button>
<el-popconfirm
title="确定删除吗?"
style="margin-left:1rem"
@confirm="deleteCategory(scope.row.id)"
>
<el-button size="mini" type="danger" slot="reference">
删除
{{$t("Public.delete")}}
</el-button>
</el-popconfirm>
</template>
Expand All @@ -97,9 +97,9 @@
</div>
<div style="font-size:1rem">是否删除选中项?</div>
<div slot="footer">
<el-button @click="isDelete = false">取 消</el-button>
<el-button @click="isDelete = false">{{$t("Public.cancel")}}</el-button>
<el-button type="primary" @click="deleteCategory(null)">
确 定
{{$t("Public.confirm")}}
</el-button>
</div>
</el-dialog>
Expand All @@ -112,9 +112,9 @@
</el-form-item>
</el-form>
<div slot="footer">
<el-button @click="addOrEdit = false">取 消</el-button>
<el-button @click="addOrEdit = false">{{$t("Public.cancel")}}</el-button>
<el-button type="primary" @click="addOrEditCategory">
确 定
{{$t("Public.confirm")}}
</el-button>
</div>
</el-dialog>
Expand Down
16 changes: 8 additions & 8 deletions src/views/comment/Comment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<el-card class="main-card">
<div class="title">{{ this.$route.name }}</div>
<div class="review-menu">
<span>状态</span>
<span>{{$t("Public.state")}}</span>
<span
@click="changeReview(null)"
:class="isReview == null ? 'active-review' : 'review'"
Expand Down Expand Up @@ -31,7 +31,7 @@
:disabled="commentIdList.length == 0"
@click="remove = true"
>
批量删除
{{$t("Public.delete")}}
</el-button>
<el-button
type="success"
Expand All @@ -40,7 +40,7 @@
:disabled="commentIdList.length == 0"
@click="updateCommentReview(null)"
>
批量通过
{{$t("Public.pass")}}
</el-button>
<!-- 数据筛选 -->
<div style="margin-left:auto">
Expand Down Expand Up @@ -73,7 +73,7 @@
style="margin-left:1rem"
@click="searchComments"
>
搜索
{{$t("Public.search")}}
</el-button>
</div>
</div>
Expand Down Expand Up @@ -164,15 +164,15 @@
slot="reference"
@click="updateCommentReview(scope.row.id)"
>
通过
{{$t("Public.pass")}}
</el-button>
<el-popconfirm
style="margin-left:10px"
title="确定删除吗?"
@confirm="deleteComments(scope.row.id)"
>
<el-button size="mini" type="danger" slot="reference">
删除
{{$t("Public.delete")}}
</el-button>
</el-popconfirm>
</template>
Expand All @@ -197,9 +197,9 @@
</div>
<div style="font-size:1rem">是否彻底删除选中项?</div>
<div slot="footer">
<el-button @click="remove = false">取 消</el-button>
<el-button @click="remove = false">{{$t("Public.cancel")}}</el-button>
<el-button type="primary" @click="deleteComments(null)">
确 定
{{$t("Public.confirm")}}
</el-button>
</div>
</el-dialog>
Expand Down
Loading

0 comments on commit aee1427

Please sign in to comment.