Skip to content

Commit

Permalink
+ Add translation for "sys_params.go" in server module.
Browse files Browse the repository at this point in the history
+ Update translation for "server.go" in server module.
+ Fix some typo in translation files.
  • Loading branch information
MohamedHassanNasr committed Oct 25, 2024
1 parent 29d2951 commit 01295f0
Show file tree
Hide file tree
Showing 21 changed files with 125 additions and 73 deletions.
4 changes: 2 additions & 2 deletions server/api/v1/example/exa_customer.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func (e *CustomerApi) CreateExaCustomer(c *gin.Context) {
response.FailWithMessage(global.Translate("general.creationFailErr"), c)
return
}
response.OkWithMessage(global.Translate("general.createSuccss"), c)
response.OkWithMessage(global.Translate("general.createSuccess"), c)
}

// DeleteExaCustomer
Expand All @@ -69,7 +69,7 @@ func (e *CustomerApi) DeleteExaCustomer(c *gin.Context) {
err = customerService.DeleteExaCustomer(customer)
if err != nil {
global.GVA_LOG.Error(global.Translate("general.deleteFail"), zap.Error(err))
response.FailWithMessage(global.Translate("general.deletFailErr"), c)
response.FailWithMessage(global.Translate("general.deleteFailErr"), c)
return
}
response.OkWithMessage(global.Translate("general.deleteSuccess"), c)
Expand Down
2 changes: 1 addition & 1 deletion server/api/v1/example/exa_file_upload_download.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func (b *FileUploadAndDownloadApi) DeleteFile(c *gin.Context) {
}
if err := fileUploadAndDownloadService.DeleteFile(file); err != nil {
global.GVA_LOG.Error(global.Translate("general.deleteFail"), zap.Error(err))
response.FailWithMessage("general.deletFailErr", c)
response.FailWithMessage("general.deleteFailErr", c)
return
}
response.OkWithMessage("general.deleteSuccess", c)
Expand Down
2 changes: 1 addition & 1 deletion server/api/v1/system/auto_code_history.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (a *AutoCodeHistoryApi) Delete(c *gin.Context) {
err = autoCodeHistoryService.Delete(c.Request.Context(), info)
if err != nil {
global.GVA_LOG.Error(global.Translate("general.deleteFail"), zap.Error(err))
response.FailWithMessage(global.Translate("general.deletFailErr"), c)
response.FailWithMessage(global.Translate("general.deleteFailErr"), c)
return
}
response.OkWithMessage(global.Translate("general.deleteSuccess"), c)
Expand Down
9 changes: 5 additions & 4 deletions server/api/v1/system/auto_code_package.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package system

import (
"strings"

"github.com/flipped-aurora/gin-vue-admin/server/global"
common "github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
"github.com/flipped-aurora/gin-vue-admin/server/model/system/request"
"github.com/flipped-aurora/gin-vue-admin/server/utils"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
"strings"
)

type AutoCodePackageApi struct{}
Expand Down Expand Up @@ -39,7 +40,7 @@ func (a *AutoCodePackageApi) Create(c *gin.Context) {
response.FailWithMessage(global.Translate("general.creationFail"), c)
return
}
response.OkWithMessage(global.Translate("general.createSuccss"), c)
response.OkWithMessage(global.Translate("general.createSuccess"), c)
}

// Delete
Expand All @@ -56,8 +57,8 @@ func (a *AutoCodePackageApi) Delete(c *gin.Context) {
_ = c.ShouldBindJSON(&info)
err := autoCodePackageService.Delete(c.Request.Context(), info)
if err != nil {
global.GVA_LOG.Error(global.Translate("general.deletFailErr"), zap.Error(err))
response.FailWithMessage(global.Translate("general.deletFailErr"), c)
global.GVA_LOG.Error(global.Translate("general.deleteFailErr"), zap.Error(err))
response.FailWithMessage(global.Translate("general.deleteFailErr"), c)
return
}
response.OkWithMessage(global.Translate("general.deleteSuccess"), c)
Expand Down
2 changes: 1 addition & 1 deletion server/api/v1/system/auto_code_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func (a *AutoCodeTemplateApi) Create(c *gin.Context) {
global.GVA_LOG.Error(global.Translate("general.creationFail"), zap.Error(err))
response.FailWithMessage(err.Error(), c)
} else {
response.OkWithMessage(global.Translate("general.createSuccss"), c)
response.OkWithMessage(global.Translate("general.createSuccess"), c)
}
}

Expand Down
6 changes: 3 additions & 3 deletions server/api/v1/system/sys_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func (s *SystemApiApi) CreateApi(c *gin.Context) {
response.FailWithMessage(global.Translate("general.creationFailErr"), c)
return
}
response.OkWithMessage(global.Translate("general.createSuccss"), c)
response.OkWithMessage(global.Translate("general.createSuccess"), c)
}

// SyncApi
Expand Down Expand Up @@ -160,7 +160,7 @@ func (s *SystemApiApi) DeleteApi(c *gin.Context) {
err = apiService.DeleteApi(api)
if err != nil {
global.GVA_LOG.Error(global.Translate("general.deleteFail"), zap.Error(err))
response.FailWithMessage(global.Translate("general.deletFailErr"), c)
response.FailWithMessage(global.Translate("general.deleteFailErr"), c)
return
}
response.OkWithMessage(global.Translate("general.deleteSuccess"), c)
Expand Down Expand Up @@ -298,7 +298,7 @@ func (s *SystemApiApi) DeleteApisByIds(c *gin.Context) {
err = apiService.DeleteApisByIds(ids)
if err != nil {
global.GVA_LOG.Error(global.Translate("general.deleteFail"), zap.Error(err))
response.FailWithMessage(global.Translate("general.deletFailErr"), c)
response.FailWithMessage(global.Translate("general.deleteFailErr"), c)
return
}
response.OkWithMessage(global.Translate("general.deleteSuccess"), c)
Expand Down
4 changes: 2 additions & 2 deletions server/api/v1/system/sys_authority.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func (a *AuthorityApi) CreateAuthority(c *gin.Context) {
response.FailWithMessage(global.Translate("system.authority.permissionRefreshFailed")+" "+err.Error(), c)
return
}
response.OkWithDetailed(systemRes.SysAuthorityResponse{Authority: authBack}, global.Translate("general.createSuccss"), c)
response.OkWithDetailed(systemRes.SysAuthorityResponse{Authority: authBack}, global.Translate("general.createSuccess"), c)
}

// CopyAuthority
Expand Down Expand Up @@ -113,7 +113,7 @@ func (a *AuthorityApi) DeleteAuthority(c *gin.Context) {
// 删除角色之前需要判断是否有用户正在使用此角色
if err = authorityService.DeleteAuthority(&authority); err != nil {
global.GVA_LOG.Error(global.Translate("general.deleteFail"), zap.Error(err))
response.FailWithMessage(global.Translate("general.deletFailErr")+" "+err.Error(), c)
response.FailWithMessage(global.Translate("general.deleteFailErr")+" "+err.Error(), c)
return
}
_ = casbinService.FreshCasbin()
Expand Down
4 changes: 2 additions & 2 deletions server/api/v1/system/sys_dictionary.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (s *DictionaryApi) CreateSysDictionary(c *gin.Context) {
response.FailWithMessage(global.Translate("general.creationFailErr"), c)
return
}
response.OkWithMessage(global.Translate("general.createSuccss"), c)
response.OkWithMessage(global.Translate("general.createSuccess"), c)
}

// DeleteSysDictionary
Expand All @@ -54,7 +54,7 @@ func (s *DictionaryApi) DeleteSysDictionary(c *gin.Context) {
err = dictionaryService.DeleteSysDictionary(dictionary)
if err != nil {
global.GVA_LOG.Error(global.Translate("general.deleteFail"), zap.Error(err))
response.FailWithMessage(global.Translate("general.deletFailErr"), c)
response.FailWithMessage(global.Translate("general.deleteFailErr"), c)
return
}
response.OkWithMessage(global.Translate("general.deleteSuccess"), c)
Expand Down
4 changes: 2 additions & 2 deletions server/api/v1/system/sys_dictionary_detail.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func (s *DictionaryDetailApi) CreateSysDictionaryDetail(c *gin.Context) {
response.FailWithMessage(global.Translate("general.creationFailErr"), c)
return
}
response.OkWithMessage(global.Translate("general.createSuccss"), c)
response.OkWithMessage(global.Translate("general.createSuccess"), c)
}

// DeleteSysDictionaryDetail
Expand All @@ -56,7 +56,7 @@ func (s *DictionaryDetailApi) DeleteSysDictionaryDetail(c *gin.Context) {
err = dictionaryDetailService.DeleteSysDictionaryDetail(detail)
if err != nil {
global.GVA_LOG.Error(global.Translate("general.deleteFail"), zap.Error(err))
response.FailWithMessage(global.Translate("general.deletFailErr"), c)
response.FailWithMessage(global.Translate("general.deleteFailErr"), c)
return
}
response.OkWithMessage(global.Translate("general.deleteSuccess"), c)
Expand Down
6 changes: 3 additions & 3 deletions server/api/v1/system/sys_export_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func (sysExportTemplateApi *SysExportTemplateApi) CreateSysExportTemplate(c *gin
global.GVA_LOG.Error(global.Translate("general.creationFail"), zap.Error(err))
response.FailWithMessage(global.Translate("general.creationFail"), c)
} else {
response.OkWithMessage(global.Translate("general.createSuccss"), c)
response.OkWithMessage(global.Translate("general.createSuccess"), c)
}
}

Expand All @@ -68,8 +68,8 @@ func (sysExportTemplateApi *SysExportTemplateApi) DeleteSysExportTemplate(c *gin
return
}
if err := sysExportTemplateService.DeleteSysExportTemplate(sysExportTemplate); err != nil {
global.GVA_LOG.Error(global.Translate("general.deletFailErr"), zap.Error(err))
response.FailWithMessage(global.Translate("general.deletFailErr"), c)
global.GVA_LOG.Error(global.Translate("general.deleteFailErr"), zap.Error(err))
response.FailWithMessage(global.Translate("general.deleteFailErr"), c)
} else {
response.OkWithMessage(global.Translate("general.deleteSuccess"), c)
}
Expand Down
2 changes: 1 addition & 1 deletion server/api/v1/system/sys_menu.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ func (a *AuthorityMenuApi) DeleteBaseMenu(c *gin.Context) {
err = baseMenuService.DeleteBaseMenu(menu.ID)
if err != nil {
global.GVA_LOG.Error(global.Translate("general.deleteFail"), zap.Error(err))
response.FailWithMessage(global.Translate("general.deletFailErr"), c)
response.FailWithMessage(global.Translate("general.deleteFailErr"), c)
return
}
response.OkWithMessage(global.Translate("general.deleteSuccess"), c)
Expand Down
4 changes: 2 additions & 2 deletions server/api/v1/system/sys_operation_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func (s *OperationRecordApi) CreateSysOperationRecord(c *gin.Context) {
response.FailWithMessage(global.Translate("general.creationFailErr"), c)
return
}
response.OkWithMessage(global.Translate("general.createSuccss"), c)
response.OkWithMessage(global.Translate("general.createSuccess"), c)
}

// DeleteSysOperationRecord
Expand All @@ -57,7 +57,7 @@ func (s *OperationRecordApi) DeleteSysOperationRecord(c *gin.Context) {
err = operationRecordService.DeleteSysOperationRecord(sysOperationRecord)
if err != nil {
global.GVA_LOG.Error(global.Translate("general.deleteFail"), zap.Error(err))
response.FailWithMessage(global.Translate("general.deletFailErr"), c)
response.FailWithMessage(global.Translate("general.deleteFailErr"), c)
return
}
response.OkWithMessage(global.Translate("general.deleteSuccess"), c)
Expand Down
40 changes: 20 additions & 20 deletions server/api/v1/system/sys_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ func (sysParamsApi *SysParamsApi) CreateSysParams(c *gin.Context) {
}
err = sysParamsService.CreateSysParams(&sysParams)
if err != nil {
global.GVA_LOG.Error("创建失败!", zap.Error(err))
response.FailWithMessage("创建失败:"+err.Error(), c)
global.GVA_LOG.Error(global.Translate("general.creationFail"), zap.Error(err))
response.FailWithMessage(global.Translate("general.creationFailErr")+": "+err.Error(), c)
return
}
response.OkWithMessage("创建成功", c)
response.OkWithMessage(global.Translate("general.createSuccess"), c)
}

// DeleteSysParams 删除参数
Expand All @@ -49,11 +49,11 @@ func (sysParamsApi *SysParamsApi) DeleteSysParams(c *gin.Context) {
ID := c.Query("ID")
err := sysParamsService.DeleteSysParams(ID)
if err != nil {
global.GVA_LOG.Error("删除失败!", zap.Error(err))
response.FailWithMessage("删除失败:"+err.Error(), c)
global.GVA_LOG.Error(global.Translate("general.deleteFail"), zap.Error(err))
response.FailWithMessage(global.Translate("general.deleteFailErr")+": "+err.Error(), c)
return
}
response.OkWithMessage("删除成功", c)
response.OkWithMessage(global.Translate("general.deleteSuccess"), c)
}

// DeleteSysParamsByIds 批量删除参数
Expand All @@ -68,11 +68,11 @@ func (sysParamsApi *SysParamsApi) DeleteSysParamsByIds(c *gin.Context) {
IDs := c.QueryArray("IDs[]")
err := sysParamsService.DeleteSysParamsByIds(IDs)
if err != nil {
global.GVA_LOG.Error("批量删除失败!", zap.Error(err))
response.FailWithMessage("批量删除失败:"+err.Error(), c)
global.GVA_LOG.Error(global.Translate("system.sys_operation_record.batchDeleteFail"), zap.Error(err))
response.FailWithMessage(global.Translate("system.sys_operation_record.batchDeleteFailErr")+": "+err.Error(), c)
return
}
response.OkWithMessage("批量删除成功", c)
response.OkWithMessage(global.Translate("system.sys_operation_record.batchDeleteSuccess"), c)
}

// UpdateSysParams 更新参数
Expand All @@ -93,11 +93,11 @@ func (sysParamsApi *SysParamsApi) UpdateSysParams(c *gin.Context) {
}
err = sysParamsService.UpdateSysParams(sysParams)
if err != nil {
global.GVA_LOG.Error("更新失败!", zap.Error(err))
response.FailWithMessage("更新失败:"+err.Error(), c)
global.GVA_LOG.Error(global.Translate("general.updateFailErr"), zap.Error(err))
response.FailWithMessage(global.Translate("general.updateFailErr")+": "+err.Error(), c)
return
}
response.OkWithMessage("更新成功", c)
response.OkWithMessage(global.Translate("general.updateSuccess"), c)
}

// FindSysParams 用id查询参数
Expand All @@ -113,8 +113,8 @@ func (sysParamsApi *SysParamsApi) FindSysParams(c *gin.Context) {
ID := c.Query("ID")
resysParams, err := sysParamsService.GetSysParams(ID)
if err != nil {
global.GVA_LOG.Error("查询失败!", zap.Error(err))
response.FailWithMessage("查询失败:"+err.Error(), c)
global.GVA_LOG.Error(global.Translate("general.queryFail"), zap.Error(err))
response.FailWithMessage(global.Translate("general.queryFailErr")+": "+err.Error(), c)
return
}
response.OkWithData(resysParams, c)
Expand All @@ -138,16 +138,16 @@ func (sysParamsApi *SysParamsApi) GetSysParamsList(c *gin.Context) {
}
list, total, err := sysParamsService.GetSysParamsInfoList(pageInfo)
if err != nil {
global.GVA_LOG.Error("获取失败!", zap.Error(err))
response.FailWithMessage("获取失败:"+err.Error(), c)
global.GVA_LOG.Error(global.Translate("general.getDataFail"), zap.Error(err))
response.FailWithMessage(global.Translate("general.getDataFailErr")+": "+err.Error(), c)
return
}
response.OkWithDetailed(response.PageResult{
List: list,
Total: total,
Page: pageInfo.Page,
PageSize: pageInfo.PageSize,
}, "获取成功", c)
}, global.Translate("general.getDataSuccess"), c)
}

// GetSysParam 根据key获取参数value
Expand All @@ -163,9 +163,9 @@ func (sysParamsApi *SysParamsApi) GetSysParam(c *gin.Context) {
k := c.Query("key")
params, err := sysParamsService.GetSysParam(k)
if err != nil {
global.GVA_LOG.Error("获取失败!", zap.Error(err))
response.FailWithMessage("获取失败:"+err.Error(), c)
global.GVA_LOG.Error(global.Translate("general.getDataFail"), zap.Error(err))
response.FailWithMessage(global.Translate("general.getDataFailErr")+": "+err.Error(), c)
return
}
response.OkWithDetailed(params, "获取成功", c)
response.OkWithDetailed(params, global.Translate("general.getDataSuccess"), c)
}
2 changes: 1 addition & 1 deletion server/api/v1/system/sys_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ func (b *BaseApi) DeleteUser(c *gin.Context) {
err = userService.DeleteUser(reqId.ID)
if err != nil {
global.GVA_LOG.Error(global.Translate("general.deleteFail"), zap.Error(err))
response.FailWithMessage(global.Translate("general.deletFailErr"), c)
response.FailWithMessage(global.Translate("general.deleteFailErr"), c)
return
}
response.OkWithMessage(global.Translate("general.deleteSuccess"), c)
Expand Down
37 changes: 24 additions & 13 deletions server/core/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,31 @@ func RunWindowsServer() {

fmt.Printf(`
%s gin-vue-admin
%s:v2.7.6
加群方式:微信号:shouzi_1994 QQ群:470239250
项目地址:https://github.com/flipped-aurora/gin-vue-admin
插件市场:https://plugin.gin-vue-admin.com
GVA讨论社区:https://support.qq.com/products/371961
默认自动化文档地址:http://127.0.0.1%s/swagger/index.html
默认前端文件运行地址:http://127.0.0.1:8080
--------------------------------------版权声明--------------------------------------
** 版权所有方:flipped-aurora开源团队 **
** 版权持有公司:北京翻转极光科技有限责任公司 **
** 剔除授权标识需购买商用授权:https://gin-vue-admin.com/empower/index.html **
`,
%s: v2.7.6
%s
%s: https://github.com/flipped-aurora/gin-vue-admin
%s: https://plugin.gin-vue-admin.com
%s: https://support.qq.com/products/371961
%s: http://127.0.0.1%s/swagger/index.html
%s: http://127.0.0.1:8080
%s
%s
%s
%s
`,
global.Translate("core.server.welcomeTo"),
global.Translate("core.server.currentVersion"),
address)
global.Translate("core.server.joinGroup"),
global.Translate("core.server.website"),
global.Translate("core.server.pluginMarket"),
global.Translate("core.server.community"),
global.Translate("core.server.swagger"),
address,
global.Translate("core.server.frontend"),
global.Translate("core.server.copyright1"),
global.Translate("core.server.copyright2"),
global.Translate("core.server.copyright3"),
global.Translate("core.server.copyright4"),
)
global.GVA_LOG.Error(s.ListenAndServe().Error())
}
2 changes: 1 addition & 1 deletion server/plugin/announcement/api/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func (a *info) CreateInfo(c *gin.Context) {
response.FailWithMessage(global.Translate("general.creationFail"), c)
return
}
response.OkWithMessage(global.Translate("general.createSuccss"), c)
response.OkWithMessage(global.Translate("general.createSuccess"), c)
}

// DeleteInfo 删除公告
Expand Down
Loading

0 comments on commit 01295f0

Please sign in to comment.