Skip to content

Commit 5978d57

Browse files
committed
feat: 修补自动化代码中丢失的中文翻译和生成自动化模板中的自动化翻译。
1 parent f73b68d commit 5978d57

File tree

10 files changed

+74
-26
lines changed

10 files changed

+74
-26
lines changed

server/api/v1/system/sys_dictionary.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ func (s *DictionaryApi) FindSysDictionary(c *gin.Context) {
107107
response.FailWithMessage(global.Translate("general.queryFailErr"), c)
108108
return
109109
}
110+
sysDictionary.Desc = global.Translate(sysDictionary.Desc)
111+
sysDictionary.Name = global.Translate(sysDictionary.Name)
110112
for i := range sysDictionary.SysDictionaryDetails {
111113
sysDictionary.SysDictionaryDetails[i].Label = global.Translate(sysDictionary.SysDictionaryDetails[i].Label)
112114
}

server/resource/package/web/view/form.vue.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<el-form :model="formData" ref="elFormRef" label-position="right" :rules="rule" label-width="80px">
77
{{- range .Fields}}
88
{{- if .Form }}
9-
<el-form-item label="{{.FieldDesc}}:" prop="{{.FieldJson}}">
9+
<el-form-item :label="t('{{$top.Package}}.{{$top.StructName}}.{{.FieldName}}')" prop="{{.FieldJson}}" >
1010
{{- if .CheckDataSource}}
1111
<el-select {{if eq .DataSource.Association 2}} multiple {{ end }} v-model="formData.{{.FieldJson}}" :placeholder="t('{{$top.Package}}.{{$top.StructName}}.{{.FieldName}}')" style="width:100%" :clearable="{{.Clearable}}" >
1212
<el-option v-for="(item,key) in dataSource.{{.FieldJson}}" :key="key" :label="item.label" :value="item.value" />

server/resource/package/web/view/table.vue.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@
372372
<el-descriptions :column="1" border>
373373
{{- range .Fields}}
374374
{{- if .Desc }}
375-
<el-descriptions-item label="{{ .FieldDesc }}">
375+
<el-descriptions-item :label="t('{{$top.Package}}.{{$top.StructName}}.{{.FieldName}}')">
376376
{{- if and (ne .FieldType "picture" ) (ne .FieldType "pictures" ) (ne .FieldType "file" ) (ne .FieldType "array" ) }}
377377
{{"{{"}} detailFrom.{{.FieldJson}} {{"}}"}}
378378
{{- else }}
@@ -723,7 +723,7 @@ const onDelete = async() => {
723723
if (res.code === 0) {
724724
ElMessage({
725725
type: 'success',
726-
message: '删除成功'
726+
message: t('general.deleteSuccess')
727727
})
728728
if (tableData.value.length === {{.PrimaryField.FieldJson}}s.length && page.value > 1) {
729729
page.value--

server/resource/plugin/web/view/view.vue.template

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,8 +368,6 @@
368368
</el-form>
369369
</el-drawer>
370370

371-
372-
373371
<el-drawer destroy-on-close size="800" v-model="detailShow" :show-close="true" :before-close="closeDetailShow">
374372
<el-descriptions column="1" border>
375373
{{- range .Fields}}

web/src/locales/ar.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,19 @@
928928
"selectDataToDisplay": "يرجى اختيار البيانات التي تريد عرضها أولاً",
929929
"display": "العرض: ",
930930
"enumValueValidationError": "خطأ في التحقق من قيمة التعداد",
931-
"oneToManyNote": "في وضع الترابط واحد لعدة، سيتغير نوع البيانات إلى مصفوفة، سيتم تمثيل الخلفية كـ JSON، تحديدًا كـ وضع المصفوفة، هل تريد المتابعة؟"
931+
"oneToManyNote": "في وضع الترابط واحد لعدة، سيتغير نوع البيانات إلى مصفوفة، سيتم تمثيل الخلفية كـ JSON، تحديدًا كـ وضع المصفوفة، هل تريد المتابعة؟",
932+
"string": "نص",
933+
"richText": "نص غني",
934+
"integer": "عدد صحيح",
935+
"boolean": "منطقي",
936+
"float": "عدد عشري",
937+
"time": "وقت",
938+
"enum": "تعداد",
939+
"singleImage": "صورة واحدة",
940+
"multipleImages": "صور متعددة",
941+
"video": "فيديو",
942+
"file": "ملف",
943+
"array": "مصفوفة"
932944
}
933945
},
934946
"exportTemplate": {

web/src/locales/en.json

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,7 @@
799799
"codeGenMoveSuccess": "Automated code creation successful, automatic move successful",
800800
"codePreview": "Preview Code",
801801
"columnName": "Database Field",
802-
"comment": "Database Field Description",
802+
"comment": "Field Description",
803803
"componentContent": "Component Content",
804804
"confirmDelete": "Are you sure you want to delete?",
805805
"copy": "Copy",
@@ -925,7 +925,7 @@
925925
"canBeCleared": "Can be Cleared",
926926
"hideSearch": "Hide Search Condition",
927927
"verificationError": "Verification Error Message",
928-
"dataSourceConfigNote": "Data Source Configuration (This is an advanced configuration, if your programming foundation is not strong, it may cause the automated code to be unusable)",
928+
"dataSourceConfigNote": "Data Source Configuration (If your programming foundation is not strong, it may cause the automated code to be unusable)",
929929
"associationMode": "Association Mode",
930930
"oneToOne": "One-to-One",
931931
"oneToMany": "One-to-Many",
@@ -937,7 +937,19 @@
937937
"selectDataToDisplay": "Please select the data to be displayed first",
938938
"display": "Display: ",
939939
"enumValueValidationError": "Enum Value Validation Error",
940-
"oneToManyNote": "In one-to-many association mode, the data type will change to an array, the backend will be represented as JSON, specifically as an array mode, do you want to continue?"
940+
"oneToManyNote": "In one-to-many association mode, the data type will change to an array, the backend will be represented as JSON, specifically as an array mode, do you want to continue?",
941+
"string": "String",
942+
"richText": "Rich Text",
943+
"integer": "Integer",
944+
"boolean": "Boolean",
945+
"float": "Float",
946+
"time": "Time",
947+
"enum": "Enum",
948+
"singleImage": "Single Image",
949+
"multipleImages": "Multiple Images",
950+
"video": "Video",
951+
"file": "File",
952+
"array": "Array"
941953
}
942954
},
943955
"exportTemplate": {

web/src/locales/zh-TW.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,19 @@
815815
"selectDataToDisplay": "請先選擇需要展示的數據",
816816
"display": "展示: ",
817817
"enumValueValidationError": "枚舉值校驗錯誤",
818-
"oneToManyNote": "一对多關聯模式下,數據類型會改變為數組,後端表現為json,具體表現為數組模式,是否繼續?"
818+
"oneToManyNote": "一对多關聯模式下,數據類型會改變為數組,後端表現為json,具體表現為數組模式,是否繼續?",
819+
"string": "字串",
820+
"richText": "富文本",
821+
"integer": "整數",
822+
"boolean": "布林",
823+
"float": "浮點數",
824+
"time": "時間",
825+
"enum": "列舉",
826+
"singleImage": "單圖",
827+
"multipleImages": "多圖",
828+
"video": "視頻",
829+
"file": "文件",
830+
"array": "數組"
819831
}
820832
},
821833
"autoPkg": {

web/src/locales/zh.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,19 @@
922922
"selectDataToDisplay": "请先选择需要展示的数据",
923923
"display": "展示: ",
924924
"enumValueValidationError": "枚举值校验错误",
925-
"oneToManyNote": "一对多关联模式下,数据类型会改变为数组,后端表现为json,具体表现为数组模式,是否继续?"
925+
"oneToManyNote": "一对多关联模式下,数据类型会改变为数组,后端表现为json,具体表现为数组模式,是否继续?",
926+
"string": "字符串",
927+
"richText": "富文本",
928+
"integer": "整数",
929+
"boolean": "布尔",
930+
"float": "浮点数",
931+
"time": "时间",
932+
"enum": "枚举",
933+
"singleImage": "单图",
934+
"multipleImages": "多图",
935+
"video": "视频",
936+
"file": "文件",
937+
"array": "数组"
926938
}
927939
},
928940
"autoPkg": {

web/src/view/login/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ const loginVerify = async() => {
203203
rules.captcha.push({
204204
max: ele.data.captchaLength,
205205
min: ele.data.captchaLength,
206-
message: `t('login.pleaseEnter') ${ele.data.captchaLength} t('login.verificationCode')`,
206+
message: `${t('general.pleaseEnter')} ${ele.data.captchaLength} ${t('login.verificationCode')}`,
207207
trigger: 'blur',
208208
})
209209
picPath.value = ele.data.picPath

web/src/view/systemTools/autoCode/index.vue

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -938,55 +938,55 @@ const dataModelList = ['created_by', 'updated_by', 'deleted_by']
938938
939939
const typeOptions = ref([
940940
{
941-
label: t('fieldDialog.string'),
941+
label: t('view.systemTools.autoCode.fieldDialog.string'),
942942
value: 'string'
943943
},
944944
{
945-
label: t('fieldDialog.richText'),
945+
label: t('view.systemTools.autoCode.fieldDialog.richText'),
946946
value: 'richtext'
947947
},
948948
{
949-
label: t('fieldDialog.integer'),
949+
label: t('view.systemTools.autoCode.fieldDialog.integer'),
950950
value: 'int'
951951
},
952952
{
953-
label: t('fieldDialog.boolean'),
953+
label: t('view.systemTools.autoCode.fieldDialog.boolean'),
954954
value: 'bool'
955955
},
956956
{
957-
label: t('fieldDialog.float'),
957+
label: t('view.systemTools.autoCode.fieldDialog.float'),
958958
value: 'float64'
959959
},
960960
{
961-
label: t('fieldDialog.time'),
961+
label: t('view.systemTools.autoCode.fieldDialog.time'),
962962
value: 'time.Time'
963963
},
964964
{
965-
label: t('fieldDialog.enum'),
965+
label: t('view.systemTools.autoCode.fieldDialog.enum'),
966966
value: 'enum'
967967
},
968968
{
969-
label: t('fieldDialog.singleImage'),
969+
label: t('view.systemTools.autoCode.fieldDialog.singleImage'),
970970
value: 'picture',
971971
},
972972
{
973-
label: t('fieldDialog.multipleImages'),
973+
label: t('view.systemTools.autoCode.fieldDialog.multipleImages'),
974974
value: 'pictures',
975975
},
976976
{
977-
label: t('fieldDialog.video'),
977+
label: t('view.systemTools.autoCode.fieldDialog.video'),
978978
value: 'video',
979979
},
980980
{
981-
label: t('fieldDialog.file'),
981+
label: t('view.systemTools.autoCode.fieldDialog.file'),
982982
value: 'file',
983983
},
984984
{
985985
label: 'JSON',
986986
value: 'json',
987987
},
988988
{
989-
label: t('fieldDialog.array'),
989+
label: t('view.systemTools.autoCode.fieldDialog.array'),
990990
value: 'array',
991991
}
992992
])
@@ -1120,8 +1120,8 @@ const previewFlag = ref(false)
11201120
const useGva = (e) => {
11211121
if (e && form.value.fields.length) {
11221122
ElMessageBox.confirm(
1123-
t('view.systemTools.gvaStructureNote'),
1124-
t('view.systemTools.note'),
1123+
t('view.systemTools.autoCode.gvaStructureNote'),
1124+
t('view.systemTools.autoCode.note'),
11251125
{
11261126
confirmButtonText: t('general.continue'),
11271127
cancelButtonText: t('general.cancel'),

0 commit comments

Comments
 (0)