Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 13011d6e
由
LN
编写于
2021-12-10 17:29:19 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
资源上传下载功能。语言设置功能
1 个父辈
917b02b8
隐藏空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
483 行增加
和
110 行删除
src/main/java/com/neotel/smfcore/common/utils/Constants.java
src/main/java/com/neotel/smfcore/core/language/rest/LanguageMsgController.java
src/main/java/com/neotel/smfcore/core/language/rest/LanguageSetController.java
src/main/java/com/neotel/smfcore/core/language/rest/bean/dto/LanguageResourceDto.java
src/main/java/com/neotel/smfcore/core/language/service/nanager/impl/LanguageMsgManagerImpl.java
src/main/java/com/neotel/smfcore/core/language/util/MessageUtils.java
src/main/resources/messages.properties
src/main/resources/messages_en_US.properties
src/main/resources/messages_ja_JP.properties
src/main/resources/messages_zh_CN.properties
src/main/resources/messages_zh_TW.properties
src/main/java/com/neotel/smfcore/common/utils/Constants.java
查看文件 @
13011d6
...
@@ -109,7 +109,15 @@ public class Constants {
...
@@ -109,7 +109,15 @@ public class Constants {
*/
*/
public
static
final
String
CACHE_msdSetting
=
"msdSetting"
;
public
static
final
String
CACHE_msdSetting
=
"msdSetting"
;
/**
* 客户端自定义配置
*/
public
static
final
String
CACHE_clientSetting
=
"clientSetting"
;
public
static
final
String
CACHE_clientSetting
=
"clientSetting"
;
/**
* 语言列表配置
*/
public
static
final
String
CACHE_languageType
=
"CACHE_languageType"
;
}
}
src/main/java/com/neotel/smfcore/core/language/rest/LanguageMsgController.java
查看文件 @
13011d6
package
com
.
neotel
.
smfcore
.
core
.
language
.
rest
;
package
com
.
neotel
.
smfcore
.
core
.
language
.
rest
;
import
c
om.alibaba.fastjson.JSONObject
;
import
c
n.hutool.core.util.ObjectUtil
;
import
com.neotel.smfcore.common.bean.PageData
;
import
com.neotel.smfcore.common.bean.PageData
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.utils.Constants
;
import
com.neotel.smfcore.common.utils.FileUtil
;
import
com.neotel.smfcore.common.utils.FileUtil
;
import
com.neotel.smfcore.common.utils.QueryHelp
;
import
com.neotel.smfcore.common.utils.QueryHelp
;
import
com.neotel.smfcore.core.device.util.DataCache
;
import
com.neotel.smfcore.core.language.rest.bean.dto.LanguageMsgDto
;
import
com.neotel.smfcore.core.language.rest.bean.dto.LanguageMsgDto
;
import
com.neotel.smfcore.core.language.rest.bean.dto.LanguageResourceDto
;
import
com.neotel.smfcore.core.language.rest.bean.mapstruct.LanguageMsgMapper
;
import
com.neotel.smfcore.core.language.rest.bean.mapstruct.LanguageMsgMapper
;
import
com.neotel.smfcore.core.language.rest.bean.query.LanguageMsgCriteria
;
import
com.neotel.smfcore.core.language.rest.bean.query.LanguageMsgCriteria
;
import
com.neotel.smfcore.core.language.service.bean.Content
;
import
com.neotel.smfcore.core.language.service.bean.Content
;
import
com.neotel.smfcore.core.language.service.nanager.ILanguageMsgManager
;
import
com.neotel.smfcore.core.language.service.nanager.ILanguageMsgManager
;
import
com.neotel.smfcore.core.language.service.po.LanguageMsg
;
import
com.neotel.smfcore.core.language.service.po.LanguageMsg
;
import
com.neotel.smfcore.core.language.util.MessageUtils
;
import
com.neotel.smfcore.core.language.util.MessageUtils
;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
import
com.neotel.smfcore.security.bean.FileProperties
;
import
com.neotel.smfcore.security.bean.FileProperties
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
...
@@ -25,7 +29,6 @@ import org.springframework.data.mongodb.core.query.Query;
...
@@ -25,7 +29,6 @@ import org.springframework.data.mongodb.core.query.Query;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
...
@@ -47,20 +50,72 @@ public class LanguageMsgController {
...
@@ -47,20 +50,72 @@ public class LanguageMsgController {
LanguageMsgMapper
languageMsgMapper
;
LanguageMsgMapper
languageMsgMapper
;
@Autowired
@Autowired
private
final
FileProperties
properties
;
private
final
FileProperties
properties
;
@ApiOperation
(
"导出数据"
)
@Autowired
DataCache
dataCache
;
public
List
<
String
>
getAllLanList
()
{
List
<
String
>
lanList
=
dataCache
.
getCache
(
Constants
.
CACHE_languageType
);
if
(
lanList
==
null
||
lanList
.
size
()
<=
0
)
{
lanList
=
new
ArrayList
<>();
lanList
.
add
(
MessageUtils
.
ZH_CN
);
lanList
.
add
(
MessageUtils
.
ZH_TW
);
lanList
.
add
(
MessageUtils
.
EN_US
);
lanList
.
add
(
MessageUtils
.
JA_JP
);
dataCache
.
updateCache
(
Constants
.
CACHE_languageType
,
lanList
);
}
return
lanList
;
}
@ApiOperation
(
"导入资源文件"
)
@PostMapping
(
value
=
"/upload"
)
public
ResultBean
upload
(
@RequestParam
MultipartFile
uploadFile
)
throws
Exception
{
// 验证文件上传的格式
String
smfcodeType
=
"properties"
;
String
smfclientType
=
"js"
;
String
fileType
=
FileUtil
.
getExtensionName
(
uploadFile
.
getOriginalFilename
());
if
(
fileType
==
null
)
{
throw
new
ValidateException
(
"smfcode.feleFormatError"
,
"文件格式错误!, 仅支持{0}格式"
,
new
String
[]{
smfclientType
+
"/"
+
smfcodeType
});
}
if
((!
smfclientType
.
contains
(
fileType
))
&&
!
smfcodeType
.
contains
(
fileType
))
{
throw
new
ValidateException
(
"smfcode.feleFormatError"
,
"文件格式错误!, 仅支持{0}格式"
,
new
String
[]{
smfclientType
+
"/"
+
smfcodeType
});
}
File
folder
=
new
File
(
properties
.
getPath
(),
"resource"
);
File
file
=
FileUtil
.
upload
(
uploadFile
,
folder
.
getAbsolutePath
());
String
resultMsg
=
""
;
//只能新增不能修改
String
lanType
=
getLanTypeByFileName
(
uploadFile
.
getOriginalFilename
());
if
(
smfclientType
.
contains
(
fileType
))
{
//客户端js文件处理
Map
<
String
,
String
>
proMap
=
readJsFile
(
file
);
resultMsg
=
ResourceUpload
(
uploadFile
.
getOriginalFilename
(),
proMap
,
lanType
,
"smfclient"
);
}
else
if
(
smfcodeType
.
contains
(
fileType
))
{
Map
<
String
,
String
>
proMap
=
MessageUtils
.
ReadPropertiesFile
(
file
);
resultMsg
=
ResourceUpload
(
uploadFile
.
getOriginalFilename
(),
proMap
,
lanType
,
""
);
}
return
ResultBean
.
newOkResult
(
resultMsg
);
}
@ApiOperation
(
"导出资源文件"
)
@GetMapping
(
value
=
"/download"
)
@GetMapping
(
value
=
"/download"
)
public
void
download
(
HttpServletResponse
response
,
LanguageMsgCriteria
criteria
)
throws
Exception
{
public
void
download
(
HttpServletResponse
response
,
LanguageMsgCriteria
criteria
)
throws
Exception
{
Query
query
=
QueryHelp
.
getQuery
(
criteria
);
Query
query
=
QueryHelp
.
getQuery
(
criteria
);
int
languageSize
=
getAllLanList
().
size
();
if
(
criteria
.
getTranslationState
()
!=
null
)
{
if
(
criteria
.
getTranslationState
()
!=
null
)
{
if
(
criteria
.
getTranslationState
()
==
1
)
{
if
(
criteria
.
getTranslationState
()
==
1
)
{
// db.getCollection('languageMsg').find({contentList:{$elemMatch:{lanCode:"en-US"}}})
// db.getCollection('languageMsg').find({contentList:{$elemMatch:{lanCode:"en-US"}}})
// query.addCriteria(Criteria.where("contentList").elemMatch(Criteria.where("lanCode").is(MessageUtils.EN_US)));
// query.addCriteria(Criteria.where("contentList").elemMatch(Criteria.where("lanCode").is(MessageUtils.EN_US)));
// db.getCollection('languageMsg').find({contentList:{"$size":4}})
// db.getCollection('languageMsg').find({contentList:{"$size":4}})
query
.
addCriteria
(
Criteria
.
where
(
"contentList"
).
size
(
4
));
query
.
addCriteria
(
Criteria
.
where
(
"contentList"
).
size
(
languageSize
));
}
else
if
(
criteria
.
getTranslationState
()
==
2
)
{
}
else
if
(
criteria
.
getTranslationState
()
==
2
)
{
// db.getCollection("Array").find({ $where: "this.vendor.length <= 0" })//数组length<= 0
// db.getCollection("Array").find({ $where: "this.vendor.length <= 0" })//数组length<= 0
query
.
addCriteria
(
Criteria
.
where
(
"this.contentList.length"
).
lt
(
4
));
String
proName
=
"contentList."
+(
languageSize
-
1
);
query
.
addCriteria
(
Criteria
.
where
(
proName
).
exists
(
false
));
}
}
}
}
List
<
LanguageMsg
>
list
=
languageMsgManager
.
findByQuery
(
query
);
List
<
LanguageMsg
>
list
=
languageMsgManager
.
findByQuery
(
query
);
...
@@ -72,14 +127,18 @@ public class LanguageMsgController {
...
@@ -72,14 +127,18 @@ public class LanguageMsgController {
@GetMapping
@GetMapping
@PreAuthorize
(
"@el.check('translation')"
)
@PreAuthorize
(
"@el.check('translation')"
)
public
PageData
<
LanguageMsgDto
>
query
(
LanguageMsgCriteria
criteria
,
Pageable
pageable
){
public
PageData
<
LanguageMsgDto
>
query
(
LanguageMsgCriteria
criteria
,
Pageable
pageable
){
List
<
String
>
typeList
=
languageMsgManager
.
findTypeList
();
List
<
String
>
typeList
=
languageMsgManager
.
findTypeList
();
int
languageSize
=
getAllLanList
().
size
();
Query
query
=
QueryHelp
.
getQuery
(
criteria
);
Query
query
=
QueryHelp
.
getQuery
(
criteria
);
if
(
criteria
.
getTranslationState
()
!=
null
)
{
if
(
criteria
.
getTranslationState
()
!=
null
)
{
if
(
criteria
.
getTranslationState
()
==
1
)
{
if
(
criteria
.
getTranslationState
()
==
1
)
{
query
.
addCriteria
(
Criteria
.
where
(
"contentList"
).
size
(
4
));
query
.
addCriteria
(
Criteria
.
where
(
"contentList"
).
size
(
languageSize
));
}
else
if
(
criteria
.
getTranslationState
()
==
2
)
{
}
else
if
(
criteria
.
getTranslationState
()
==
2
)
{
query
.
addCriteria
(
Criteria
.
where
(
"this.contentList.length"
).
lte
(
3
));
// db.getCollection('languageMsg').find({ "contentList.3" : { "$exists" : 0 } })
String
proName
=
"contentList."
+(
languageSize
-
1
);
query
.
addCriteria
(
Criteria
.
where
(
proName
).
exists
(
false
));
}
}
}
}
PageData
<
LanguageMsg
>
barcodes
=
languageMsgManager
.
findByPage
(
query
,
pageable
);
PageData
<
LanguageMsg
>
barcodes
=
languageMsgManager
.
findByPage
(
query
,
pageable
);
...
@@ -89,7 +148,7 @@ public class LanguageMsgController {
...
@@ -89,7 +148,7 @@ public class LanguageMsgController {
@ApiOperation
(
"新增资源"
)
@ApiOperation
(
"新增资源"
)
@PostMapping
@PostMapping
@PreAuthorize
(
"@el.check('translation')"
)
@PreAuthorize
(
"@el.check('translation')"
)
public
ResponseEntity
<
Object
>
create
(
@Validated
@RequestBody
LanguageMsgDto
resources
)
{
public
ResponseEntity
<
Object
>
create
(
@RequestBody
LanguageMsgDto
resources
)
{
LanguageMsg
msg
=
languageMsgMapper
.
toEntity
(
resources
);
LanguageMsg
msg
=
languageMsgMapper
.
toEntity
(
resources
);
languageMsgManager
.
saveMsg
(
msg
);
languageMsgManager
.
saveMsg
(
msg
);
return
new
ResponseEntity
<>(
HttpStatus
.
CREATED
);
return
new
ResponseEntity
<>(
HttpStatus
.
CREATED
);
...
@@ -98,7 +157,7 @@ public class LanguageMsgController {
...
@@ -98,7 +157,7 @@ public class LanguageMsgController {
@ApiOperation
(
"修改资源"
)
@ApiOperation
(
"修改资源"
)
@PutMapping
@PutMapping
@PreAuthorize
(
"@el.check('translation')"
)
@PreAuthorize
(
"@el.check('translation')"
)
public
ResponseEntity
<
Object
>
update
(
@Validated
@RequestBody
LanguageMsgDto
resources
)
{
public
ResponseEntity
<
Object
>
update
(
@RequestBody
LanguageMsgDto
resources
)
{
LanguageMsg
msg
=
languageMsgMapper
.
toEntity
(
resources
);
LanguageMsg
msg
=
languageMsgMapper
.
toEntity
(
resources
);
if
(
msg
.
getId
()
==
null
)
{
if
(
msg
.
getId
()
==
null
)
{
throw
new
ValidateException
(
"smfcode.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
});
throw
new
ValidateException
(
"smfcode.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
});
...
@@ -120,6 +179,106 @@ public class LanguageMsgController {
...
@@ -120,6 +179,106 @@ public class LanguageMsgController {
return
new
ResponseEntity
<>(
HttpStatus
.
OK
);
return
new
ResponseEntity
<>(
HttpStatus
.
OK
);
}
}
@ApiOperation
(
"客户端获取资源列表"
)
@GetMapping
(
value
=
"/resource"
)
@AnonymousAccess
public
List
<
LanguageResourceDto
>
resourceDownload
(
String
type
,
String
lanCode
)
{
lanCode
=
lanCode
.
replace
(
"_"
,
"-"
);
List
<
LanguageMsg
>
msgList
=
MessageUtils
.
getLanMsgByType
(
type
);
Map
<
String
,
Map
<
String
,
String
>>
resourceMap
=
new
HashMap
<>();
List
<
String
>
allLantypeList
=
getAllLanList
();
for
(
LanguageMsg
msg
:
msgList
)
{
for
(
Content
con
:
msg
.
getContentList
())
{
if
(
ObjectUtil
.
isEmpty
(
con
.
getLanCode
())
||
ObjectUtil
.
isEmpty
(
con
.
getMsg
()))
{
continue
;
}
if
(
ObjectUtil
.
isNotEmpty
(
lanCode
)
&&
(!
lanCode
.
equals
(
con
.
getLanCode
())))
{
continue
;
}
if
(!
allLantypeList
.
contains
(
con
.
getLanCode
())){
continue
;
}
Map
<
String
,
String
>
valueMap
=
resourceMap
.
get
(
con
.
getLanCode
());
if
(
valueMap
==
null
)
{
valueMap
=
new
HashMap
<>();
}
valueMap
.
put
(
msg
.
getCode
(),
con
.
getMsg
());
resourceMap
.
put
(
con
.
getLanCode
(),
valueMap
);
}
}
List
<
LanguageResourceDto
>
list
=
new
ArrayList
<>();
for
(
String
key
:
resourceMap
.
keySet
())
{
Map
<
String
,
String
>
valueMap
=
resourceMap
.
get
(
key
);
if
(
valueMap
!=
null
&&
valueMap
.
size
()>
0
){
LanguageResourceDto
dto
=
new
LanguageResourceDto
(
key
,
valueMap
);
list
.
add
(
dto
);
}
}
return
list
;
}
@ApiOperation
(
"客户端提交资源列表:只增加不修改"
)
@PostMapping
(
value
=
"/resource"
)
@AnonymousAccess
public
ResultBean
resourceUpload
(
@RequestBody
Map
<
String
,
Object
>
paramsMap
)
{
String
type
=
paramsMap
.
get
(
"type"
).
toString
();
List
<
String
>
lanList
=
getAllLanList
();
for
(
String
key
:
paramsMap
.
keySet
())
{
if
(
key
.
toString
().
equals
(
"type"
))
{
continue
;
}
Object
value
=
paramsMap
.
get
(
key
);
// log.info("收到客户端上传资源类型[" + type + "],语言[" + key + "],值[" + value.toString() + "]");
String
lanType
=
key
.
replace
(
"_"
,
"-"
);
if
(!
lanList
.
contains
(
lanType
))
{
log
.
info
(
"收到客户端上传资源,未找到指定语言:类型["
+
type
+
"],语言["
+
key
+
"] "
);
continue
;
}
log
.
info
(
"收到客户端上传资源类型["
+
type
+
"],语言["
+
key
+
"]"
);
Map
<
String
,
String
>
lanResourceMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
reMap
=
(
Map
<
String
,
Object
>)
value
;
for
(
String
resKey
:
reMap
.
keySet
())
{
Object
resValue
=
reMap
.
get
(
resKey
);
if
(
resValue
instanceof
Map
){
processResourceMap
(
resKey
,
resValue
,
lanResourceMap
);
}
else
{
lanResourceMap
.
put
(
resKey
,
resValue
.
toString
());
}
}
ResourceUpload
(
"接口上传"
,
lanResourceMap
,
lanType
,
type
);
}
return
ResultBean
.
newOkResult
(
"ok"
);
}
private
void
processResourceMap
(
String
codeKey
,
Object
value
,
Map
<
String
,
String
>
lanResourceMap
){
if
(
value
instanceof
Map
){
Map
<
String
,
Object
>
valueMap
=(
Map
<
String
,
Object
>)
value
;
for
(
String
vkey
:
valueMap
.
keySet
())
{
Object
vValue
=
valueMap
.
get
(
vkey
);
String
code
=
codeKey
+
"."
+
vkey
;
processResourceMap
(
code
,
vValue
,
lanResourceMap
);
}
}
else
{
lanResourceMap
.
put
(
codeKey
,
value
.
toString
());
}
}
@ApiOperation
(
"获取资源类型集合"
)
@ApiOperation
(
"获取资源类型集合"
)
@GetMapping
(
value
=
"/typeList"
)
@GetMapping
(
value
=
"/typeList"
)
@PreAuthorize
(
"@el.check('translation')"
)
@PreAuthorize
(
"@el.check('translation')"
)
...
@@ -128,45 +287,13 @@ public class LanguageMsgController {
...
@@ -128,45 +287,13 @@ public class LanguageMsgController {
List
<
String
>
typeList
=
languageMsgManager
.
findTypeList
();
List
<
String
>
typeList
=
languageMsgManager
.
findTypeList
();
return
typeList
;
return
typeList
;
}
}
@ApiOperation
(
"上传资源列表"
)
@PostMapping
(
value
=
"/upload"
)
public
ResultBean
upload
(
@RequestParam
MultipartFile
uploadFile
)
throws
Exception
{
// 验证文件上传的格式
String
smfcodeType
=
"properties"
;
String
smfclientType
=
"js"
;
String
fileType
=
FileUtil
.
getExtensionName
(
uploadFile
.
getOriginalFilename
());
if
(
fileType
==
null
)
{
throw
new
ValidateException
(
"smfcode.feleFormatError"
,
"文件格式错误!, 仅支持{0}格式"
,
new
String
[]{
smfclientType
+
"/"
+
smfcodeType
});
}
if
((!
smfclientType
.
contains
(
fileType
))
&&
!
smfcodeType
.
contains
(
fileType
))
{
throw
new
ValidateException
(
"smfcode.feleFormatError"
,
"文件格式错误!, 仅支持{0}格式"
,
new
String
[]{
smfclientType
+
"/"
+
smfcodeType
});
}
File
folder
=
new
File
(
properties
.
getPath
(),
"resource"
);
File
file
=
FileUtil
.
upload
(
uploadFile
,
folder
.
getAbsolutePath
());
String
resultMsg
=
""
;
String
lanType
=
getLanTypeByFileName
(
uploadFile
.
getOriginalFilename
());
if
(
smfclientType
.
contains
(
fileType
))
{
//客户端js文件处理
Map
<
String
,
String
>
proMap
=
readJsFile
(
file
);
resultMsg
=
ResourceUpload
(
uploadFile
.
getOriginalFilename
(),
proMap
,
lanType
,
"smfclient"
);
}
else
if
(
smfcodeType
.
contains
(
fileType
))
{
Map
<
String
,
String
>
proMap
=
MessageUtils
.
ReadPropertiesFile
(
file
);
resultMsg
=
ResourceUpload
(
uploadFile
.
getOriginalFilename
(),
proMap
,
lanType
,
""
);
}
return
ResultBean
.
newOkResult
(
resultMsg
);
}
private
String
getLanTypeByFileName
(
String
orgFilename
)
{
private
String
getLanTypeByFileName
(
String
orgFilename
)
{
String
tname
=
orgFilename
.
replace
(
'_'
,
'-'
);
String
tname
=
orgFilename
.
replace
(
'_'
,
'-'
);
if
(
tname
.
contains
(
MessageUtils
.
EN_US
))
{
for
(
String
lanType
:
return
MessageUtils
.
EN_US
;
getAllLanList
())
{
}
else
if
(
tname
.
contains
(
MessageUtils
.
JA_JP
))
{
if
(
tname
.
contains
(
lanType
)){
return
MessageUtils
.
JA_JP
;
return
lanType
;
}
else
if
(
tname
.
contains
(
MessageUtils
.
ZH_CH
))
{
}
return
MessageUtils
.
ZH_CH
;
}
else
if
(
tname
.
contains
(
MessageUtils
.
ZH_TW
))
{
return
MessageUtils
.
ZH_TW
;
}
}
return
""
;
return
""
;
...
@@ -183,13 +310,15 @@ public class LanguageMsgController {
...
@@ -183,13 +310,15 @@ public class LanguageMsgController {
String
msgStr
=
proMap
.
get
(
key
);
String
msgStr
=
proMap
.
get
(
key
);
LanguageMsg
msg
=
MessageUtils
.
getMsg
(
key
);
LanguageMsg
msg
=
MessageUtils
.
getMsg
(
key
);
//导入时只能新增不能修改
if
(
msg
==
null
)
{
if
(
msg
==
null
)
{
msg
=
new
LanguageMsg
(
key
,
msgStr
,
"smfclient"
);
msg
=
new
LanguageMsg
(
key
,
msgStr
,
"smfclient"
);
msg
.
setContent
(
lanCode
,
msgStr
);
msg
.
setContent
(
lanCode
,
msgStr
);
newLanguageList
.
add
(
msg
);
newLanguageList
.
add
(
msg
);
}
else
{
}
else
{
String
oldMsg
=
msg
.
getContent
(
lanCode
);
String
oldMsg
=
msg
.
getContent
(
lanCode
);
if
(!
oldMsg
.
equals
(
msgStr
))
{
// if (!oldMsg.equals(msgStr)) {
if
(
ObjectUtil
.
isEmpty
(
oldMsg
)){
msg
.
setContent
(
lanCode
,
msgStr
);
msg
.
setContent
(
lanCode
,
msgStr
);
updateLanguageList
.
add
(
msg
);
updateLanguageList
.
add
(
msg
);
languageMsgManager
.
save
(
msg
);
languageMsgManager
.
save
(
msg
);
...
@@ -206,29 +335,13 @@ public class LanguageMsgController {
...
@@ -206,29 +335,13 @@ public class LanguageMsgController {
MessageUtils
.
updateMsg
(
msg
);
MessageUtils
.
updateMsg
(
msg
);
}
}
}
}
log
.
info
(
"导入资源
文件["
+
orgFileName
+
"]共更新["
+
updateLanguageList
.
size
()
+
"]条资源,新增["
+
newLanguageList
.
size
()
+
"]条资源"
);
log
.
info
(
"导入资源
["
+
orgFileName
+
"]["
+
type
+
"]["
+
lanCode
+
"]共更新["
+
updateLanguageList
.
size
()
+
"]条资源,新增["
+
newLanguageList
.
size
()
+
"]条资源"
);
return
"ok"
;
return
"ok"
;
}
}
private
Map
<
String
,
String
>
readJsFile
(
File
file
){
Map
<
String
,
String
>
map
=
new
HashMap
<>();
// Long fileLengthLong = file.length();
private
Map
<
String
,
String
>
readJsFile
(
File
file
){
// byte[] fileContent = new byte[fileLengthLong.intValue()];
Map
<
String
,
String
>
map
=
new
HashMap
<>();
// try {
// FileInputStream inputStream = new FileInputStream(file);
// inputStream.read(fileContent);
// inputStream.close();
// String string = new String(fileContent);
// JSONObject jsonObject= JSONObject.parseObject(string);
// for (Map.Entry<String, Object> entry : jsonObject.entrySet()) {
// System.out.println("key值="+entry.getKey());
// System.out.println("对应key值的value="+entry.getValue());
// }
// } catch (Exception e) {
// log.error("readJsFile 出错:"+e.toString());
// e.printStackTrace();
// }
try
(
FileInputStream
fis
=
new
FileInputStream
(
file
.
getPath
());
try
(
FileInputStream
fis
=
new
FileInputStream
(
file
.
getPath
());
InputStreamReader
isr
=
new
InputStreamReader
(
fis
,
"UTF-8"
);
InputStreamReader
isr
=
new
InputStreamReader
(
fis
,
"UTF-8"
);
...
@@ -236,19 +349,55 @@ public class LanguageMsgController {
...
@@ -236,19 +349,55 @@ public class LanguageMsgController {
)
{
)
{
String
line
;
String
line
;
//网友推荐更加简洁的写法
//网友推荐更加简洁的写法
int
lineIndex
=
0
;
int
lineIndex
=-
1
;
String
currNodeName
=
""
;
while
((
line
=
br
.
readLine
())
!=
null
)
{
while
((
line
=
br
.
readLine
())
!=
null
)
{
if
(
lineIndex
==
0
){
lineIndex
++;
// if(lineIndex==0){
// continue;
// }
if
(
ObjectUtil
.
isEmpty
(
line
)){
continue
;
continue
;
}
}
if
(
line
.
contains
(
"{"
)){
if
(
line
.
contains
(
"="
)){
currNodeName
=
""
;
}
else
{
int
dendIndex
=
line
.
indexOf
(
':'
);
String
lineNode
=
line
.
substring
(
0
,
dendIndex
).
trim
();
if
(
ObjectUtil
.
isEmpty
(
currNodeName
)){
currNodeName
=
lineNode
;
}
else
{
//节点名称+
currNodeName
=
currNodeName
+
"."
+
lineNode
;
}
}
}
else
if
(
line
.
contains
(
"}"
)){
//节点名称-
if
(
currNodeName
.
contains
(
"."
)){
int
endIndex
=
currNodeName
.
lastIndexOf
(
"."
);
currNodeName
=
currNodeName
.
substring
(
0
,
endIndex
);
}
else
{
currNodeName
=
""
;
}
}
else
if
(
line
.
contains
(
":"
)){
if
(
line
.
endsWith
(
","
)){
line
=
line
.
substring
(
0
,
line
.
length
()-
1
);
}
String
[]
array
=
line
.
replace
(
"'"
,
""
).
replace
(
"\""
,
""
).
split
(
":"
);
if
(
array
.
length
==
2
){
String
linekey
=
array
[
0
].
trim
();
String
lineValue
=
array
[
1
].
trim
();
map
.
put
(
currNodeName
+
"."
+
linekey
,
lineValue
);
}
}
}
}
// JSONObject jsonObject= JSONObject.parseObject(br.toString());
// for (Map.Entry<String, Object> entry : jsonObject.entrySet()) {
// System.out.println("key值="+entry.getKey());
// System.out.println("对应key值的value="+entry.getValue());
// }
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
log
.
error
(
"readJsFile 出错:"
+
e
.
toString
());
log
.
error
(
"readJsFile 出错:"
+
e
.
toString
());
...
@@ -256,36 +405,58 @@ public class LanguageMsgController {
...
@@ -256,36 +405,58 @@ public class LanguageMsgController {
}
}
return
map
;
return
map
;
}
}
// //服务端properties文件处理
// private String propertiesResourceUpload(String orgFileName,File file) {
// private void msgListUpload(String type, List<LanguageMsg> msgList) {
//
//
// String lanType = getLanTypeByFileName(orgFileName);
// List<LanguageMsg> newLanguageList = new ArrayList<>();
// List<LanguageMsg> newLanguageList = new ArrayList<>();
// List<LanguageMsg> updateLanguageList = new ArrayList<>();
// List<LanguageMsg> updateLanguageList = new ArrayList<>();
// for (LanguageMsg msg :
// msgList) {
// msg.setType(type);
// if(ObjectUtil.isEmpty(msg.getCode())) {
// //code不能为空
// continue;
// }
// if(ObjectUtil.isEmpty(msg.getMsg())){
// //内容不能为空
// continue;
// }
//
//
// Map<String, String> proMap = MessageUtils.ReadPropertiesFile(file);
// List<Content> contentList = new ArrayList<>();
// if (proMap != null && proMap.size() > 0) {
// for (Content con :
// for (String key :
// msg.getContentList()) {
// proMap.keySet()) {
// if (ObjectUtil.isEmpty(con.getLanCode()) || ObjectUtil.isEmpty(con.getMsg())) {
// String msgStr = proMap.get(key);
// continue;
// }
// contentList.add(con);
// }
//
//
// LanguageMsg msg = MessageUtils.getMsg(key);
//
// if (msg == null) {
// //判断是否是新增
// msg = new LanguageMsg(key, msgStr,"");
// LanguageMsg oldMsg=MessageUtils.getMsg(msg.getCode());
// msg.setContent(lanType, msgStr);
// if(oldMsg==null){
// newLanguageList.add(msg);
// newLanguageList.add(msg);
// } else {
// }
// String oldMsg = msg.getContent(lanType);
// else{
// if (!oldMsg.equals(msgStr)) {
// //只新增不修改
// msg.setContent(lanType, msgStr);
// List<String> allLanList=getAllLanList();
// updateLanguageList.add(msg);
// for (String lanType :
// languageMsgManager.save(msg);
// allLanList) {
// MessageUtils.updateMsg(msg);
// String oldValue= oldMsg.getContent(lanType);
// if(ObjectUtil.isEmpty(oldValue)){
// oldMsg.setContent(lanType,msg.getContent(lanType));
// }
// }
// }
// }
// updateLanguageList.add(oldMsg);
// languageMsgManager.save(oldMsg);
// MessageUtils.updateMsg(oldMsg);
// }
// }
//
// }
// }
//
//
//
//
// if (newLanguageList.size() > 0) {
// if (newLanguageList.size() > 0) {
// languageMsgManager.insertAll(newLanguageList);
// languageMsgManager.insertAll(newLanguageList);
// for (LanguageMsg msg :
// for (LanguageMsg msg :
...
@@ -293,7 +464,9 @@ public class LanguageMsgController {
...
@@ -293,7 +464,9 @@ public class LanguageMsgController {
// MessageUtils.updateMsg(msg);
// MessageUtils.updateMsg(msg);
// }
// }
// }
// }
// log.info("导入
资源文件[" + orgFileName + "]
共更新[" + updateLanguageList.size() + "]条资源,新增[" + newLanguageList.size() + "]条资源");
// log.info("导入
[" + type + "]类型的资源列表,
共更新[" + updateLanguageList.size() + "]条资源,新增[" + newLanguageList.size() + "]条资源");
//
return "ok";
//
// }
// }
}
}
src/main/java/com/neotel/smfcore/core/language/rest/LanguageSetController.java
0 → 100644
查看文件 @
13011d6
package
com
.
neotel
.
smfcore
.
core
.
language
.
rest
;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.utils.Constants
;
import
com.neotel.smfcore.common.utils.SecurityUtils
;
import
com.neotel.smfcore.core.device.util.DataCache
;
import
com.neotel.smfcore.core.language.util.MessageUtils
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Set
;
@Slf4j
@RestController
@RequiredArgsConstructor
@Api
(
tags
=
"设置:语言设置"
)
@RequestMapping
(
"api/language"
)
public
class
LanguageSetController
{
@Autowired
DataCache
dataCache
;
public
List
<
String
>
getAllLanList
()
{
List
<
String
>
lanList
=
dataCache
.
getCache
(
Constants
.
CACHE_languageType
);
if
(
lanList
==
null
||
lanList
.
size
()
<=
0
)
{
lanList
=
new
ArrayList
<>();
lanList
.
add
(
MessageUtils
.
ZH_CN
);
lanList
.
add
(
MessageUtils
.
ZH_TW
);
lanList
.
add
(
MessageUtils
.
EN_US
);
lanList
.
add
(
MessageUtils
.
JA_JP
);
dataCache
.
updateCache
(
Constants
.
CACHE_languageType
,
lanList
);
}
return
lanList
;
}
@ApiOperation
(
"获取语言列表"
)
@GetMapping
@PreAuthorize
(
"@el.check('translation')"
)
public
List
<
String
>
getList
(){
return
getAllLanList
();
}
@ApiOperation
(
"新增语言"
)
@PostMapping
@PreAuthorize
(
"@el.check('translation')"
)
public
ResponseEntity
<
Object
>
create
(
@RequestBody
String
languageType
)
{
//判断是否是admin
String
userName
=
SecurityUtils
.
getCurrentUsername
();
if
(!
userName
.
equals
(
Constants
.
SUPER_USERNAME
)){
throw
new
ValidateException
(
"smfcode.noLanguageSetAccess"
,
"没有编辑语言的权限"
);
}
if
(
languageType
==
null
){
throw
new
ValidateException
(
"smfcode.languageCanotNull"
,
"语言类型不能为空"
);
}
List
<
String
>
languageTypeList
=
getAllLanList
();
if
(!
languageTypeList
.
contains
(
languageType
)){
log
.
info
(
"用户["
+
SecurityUtils
.
getCurrentUsername
()+
"] 新增语言:"
+
languageType
);
languageTypeList
.
add
(
languageType
);
dataCache
.
updateCache
(
Constants
.
CACHE_languageType
,
languageTypeList
);
}
return
new
ResponseEntity
<>(
HttpStatus
.
CREATED
);
}
@ApiOperation
(
"删除指定语言"
)
@DeleteMapping
@PreAuthorize
(
"@el.check('translation')"
)
public
ResponseEntity
<
Object
>
delete
(
@RequestBody
Set
<
String
>
languageTypes
)
{
//判断是否是admin
String
userName
=
SecurityUtils
.
getCurrentUsername
();
if
(!
userName
.
equals
(
Constants
.
SUPER_USERNAME
))
{
throw
new
ValidateException
(
"smfcode.noLanguageSetAccess"
,
"没有编辑语言的权限"
);
}
List
<
String
>
languageTypeList
=
getAllLanList
();
for
(
String
type
:
languageTypes
)
{
if
(
type
==
null
)
{
throw
new
ValidateException
(
"smfcode.languageCanotNull"
,
"语言类型不能为空"
);
}
languageTypeList
.
remove
(
type
);
log
.
info
(
"用户["
+
SecurityUtils
.
getCurrentUsername
()+
"] 删除语言:"
+
type
);
}
if
(
languageTypeList
==
null
||
languageTypeList
.
size
()
<=
0
)
{
throw
new
ValidateException
(
"smfcode.languageCanotRemoveAll"
,
"不能删除所有语言"
);
}
dataCache
.
updateCache
(
Constants
.
CACHE_languageType
,
languageTypeList
);
return
new
ResponseEntity
<>(
HttpStatus
.
OK
);
}
// @ApiOperation("修改语言列表")
// @PostMapping
// @PreAuthorize("@el.check('translation')")
// public ResultBean create(@RequestBody List<String> languageTypeList) {
// if(languageTypeList==null||languageTypeList.size()<=0){
// throw new ValidateException("smfcode.languageCanotNull","语言类型不能为空" );
// }
//
// //判断是否是admin
// String userName= SecurityUtils.getCurrentUsername();
// if(!userName.equals(Constants.SUPER_USERNAME)){
// throw new ValidateException("smfcode.noLanguageSetAccess","没有修改语言的权限");
// }
// dataCache.updateCache(Constants.CACHE_languageType, languageTypeList);
//
// return ResultBean.newOkResult("ok");
// }
}
src/main/java/com/neotel/smfcore/core/language/rest/bean/dto/LanguageResourceDto.java
0 → 100644
查看文件 @
13011d6
package
com
.
neotel
.
smfcore
.
core
.
language
.
rest
.
bean
.
dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.HashMap
;
import
java.util.Map
;
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
LanguageResourceDto
{
@ApiModelProperty
(
"语言类型"
)
private
String
lanCode
;
@ApiModelProperty
(
"资源集合,key=code"
)
private
Map
<
String
,
String
>
resourceMap
=
new
HashMap
<>();
}
src/main/java/com/neotel/smfcore/core/language/service/nanager/impl/LanguageMsgManagerImpl.java
查看文件 @
13011d6
...
@@ -3,9 +3,11 @@ package com.neotel.smfcore.core.language.service.nanager.impl;
...
@@ -3,9 +3,11 @@ package com.neotel.smfcore.core.language.service.nanager.impl;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.neotel.smfcore.common.bean.PageData
;
import
com.neotel.smfcore.common.bean.PageData
;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.utils.Constants
;
import
com.neotel.smfcore.common.utils.FileUtil
;
import
com.neotel.smfcore.common.utils.FileUtil
;
import
com.neotel.smfcore.core.barcode.bean.PlateSizeBean
;
import
com.neotel.smfcore.core.barcode.bean.PlateSizeBean
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.device.util.DataCache
;
import
com.neotel.smfcore.core.language.service.bean.Content
;
import
com.neotel.smfcore.core.language.service.bean.Content
;
import
com.neotel.smfcore.core.language.service.dao.ILanguageMsgDao
;
import
com.neotel.smfcore.core.language.service.dao.ILanguageMsgDao
;
import
com.neotel.smfcore.core.language.service.nanager.ILanguageMsgManager
;
import
com.neotel.smfcore.core.language.service.nanager.ILanguageMsgManager
;
...
@@ -59,7 +61,21 @@ public class LanguageMsgManagerImpl implements ILanguageMsgManager {
...
@@ -59,7 +61,21 @@ public class LanguageMsgManagerImpl implements ILanguageMsgManager {
public
List
<
LanguageMsg
>
findByQuery
(
Query
query
)
{
public
List
<
LanguageMsg
>
findByQuery
(
Query
query
)
{
return
languageMsgDao
.
findByQuery
(
query
);
return
languageMsgDao
.
findByQuery
(
query
);
}
}
@Autowired
DataCache
dataCache
;
public
List
<
String
>
getAllLanList
(){
List
<
String
>
lanList
=
dataCache
.
getCache
(
Constants
.
CACHE_languageType
);
if
(
lanList
==
null
||
lanList
.
size
()<=
0
){
lanList
.
add
(
MessageUtils
.
ZH_CN
);
lanList
.
add
(
MessageUtils
.
ZH_TW
);
lanList
.
add
(
MessageUtils
.
EN_US
);
lanList
.
add
(
MessageUtils
.
JA_JP
);
dataCache
.
updateCache
(
Constants
.
CACHE_languageType
,
lanList
);
}
return
lanList
;
}
@Override
@Override
public
void
download
(
List
<
LanguageMsg
>
msgList
,
HttpServletResponse
response
)
throws
IOException
{
public
void
download
(
List
<
LanguageMsg
>
msgList
,
HttpServletResponse
response
)
throws
IOException
{
List
<
Map
<
String
,
Object
>>
list
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
list
=
new
ArrayList
<>();
...
@@ -68,10 +84,15 @@ public class LanguageMsgManagerImpl implements ILanguageMsgManager {
...
@@ -68,10 +84,15 @@ public class LanguageMsgManagerImpl implements ILanguageMsgManager {
map
.
put
(
"编号"
,
msg
.
getCode
());
map
.
put
(
"编号"
,
msg
.
getCode
());
map
.
put
(
"类型"
,
msg
.
getType
());
map
.
put
(
"类型"
,
msg
.
getType
());
map
.
put
(
"默认值"
,
msg
.
getMsg
());
map
.
put
(
"默认值"
,
msg
.
getMsg
());
map
.
put
(
"简体中文"
,
msg
.
getContent
(
MessageUtils
.
ZH_CH
));
List
<
String
>
lanList
=
getAllLanList
();
map
.
put
(
"繁体中文"
,
msg
.
getContent
(
MessageUtils
.
ZH_TW
));
for
(
String
lanType
:
map
.
put
(
"英文"
,
msg
.
getContent
(
MessageUtils
.
EN_US
));
lanList
)
{
map
.
put
(
"日文"
,
msg
.
getContent
(
MessageUtils
.
JA_JP
));
map
.
put
(
lanType
,
msg
.
getContent
(
lanType
));
}
// map.put("简体中文", msg.getContent(MessageUtils.ZH_CN));
// map.put("繁体中文", msg.getContent(MessageUtils.ZH_TW));
// map.put("英文", msg.getContent(MessageUtils.EN_US));
// map.put("日文", msg.getContent(MessageUtils.JA_JP));
list
.
add
(
map
);
list
.
add
(
map
);
}
}
FileUtil
.
downloadExcel
(
list
,
response
);
FileUtil
.
downloadExcel
(
list
,
response
);
...
...
src/main/java/com/neotel/smfcore/core/language/util/MessageUtils.java
查看文件 @
13011d6
...
@@ -3,19 +3,15 @@ package com.neotel.smfcore.core.language.util;
...
@@ -3,19 +3,15 @@ package com.neotel.smfcore.core.language.util;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.neotel.smfcore.core.language.service.bean.Content
;
import
com.neotel.smfcore.core.language.service.bean.Content
;
import
com.neotel.smfcore.core.language.service.nanager.ILanguageMsgManager
;
import
com.neotel.smfcore.core.language.service.nanager.ILanguageMsgManager
;
import
com.neotel.smfcore.core.language.service.nanager.impl.LanguageMsgManagerImpl
;
import
com.neotel.smfcore.core.language.service.po.LanguageMsg
;
import
com.neotel.smfcore.core.language.service.po.LanguageMsg
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.tomcat.jni.Directory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.MessageSource
;
import
org.springframework.context.MessageSource
;
import
org.springframework.data.mongodb.core.query.Query
;
import
org.springframework.data.mongodb.core.query.Query
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Repository
;
import
javax.annotation.PostConstruct
;
import
javax.annotation.PostConstruct
;
import
java.io.*
;
import
java.io.*
;
import
java.text.MessageFormat
;
import
java.util.*
;
import
java.util.*
;
/**
/**
...
@@ -67,16 +63,28 @@ public class MessageUtils {
...
@@ -67,16 +63,28 @@ public class MessageUtils {
@Autowired
@Autowired
ILanguageMsgManager
languageMsgManager
;
ILanguageMsgManager
languageMsgManager
;
public
static
final
String
ZH_C
H
=
"zh-CH
"
;
public
static
final
String
ZH_C
N
=
"zh-CN
"
;
public
static
final
String
ZH_TW
=
"zh-TW"
;
public
static
final
String
ZH_TW
=
"zh-TW"
;
public
static
final
String
EN_US
=
"en-US"
;
public
static
final
String
EN_US
=
"en-US"
;
public
static
final
String
JA_JP
=
"ja-JP"
;
public
static
final
String
JA_JP
=
"ja-JP"
;
@PostConstruct
@PostConstruct
public
void
initialize
()
{
public
void
initialize
()
{
initLanguageMsgList
();
initLanguageMsgList
();
}
}
// public static List<String> getAllLanList(){
//
//
// List<String> lanList=new ArrayList<>();
// lanList.add(ZH_CN);
// lanList.add(ZH_TW);
// lanList.add(EN_US);
// lanList.add(JA_JP);
// return lanList;
// }
// public static Locale getDefaultLocal(){
// public static Locale getDefaultLocal(){
// return new Locale("zh-CH");
// return new Locale("zh-CH");
...
@@ -134,6 +142,16 @@ public class MessageUtils {
...
@@ -134,6 +142,16 @@ public class MessageUtils {
return
msgMap
.
get
(
code
);
return
msgMap
.
get
(
code
);
}
}
public
static
List
<
LanguageMsg
>
getLanMsgByType
(
String
type
)
{
List
<
LanguageMsg
>
msgList
=
new
ArrayList
<>();
for
(
LanguageMsg
msg
:
msgMap
.
values
())
{
if
(
msg
.
getType
().
equals
(
type
)){
msgList
.
add
(
msg
);
}
}
return
msgList
;
}
private
Map
<
String
,
LanguageMsg
>
loadMsgMap
()
{
private
Map
<
String
,
LanguageMsg
>
loadMsgMap
()
{
Map
<
String
,
LanguageMsg
>
msgMap
=
new
HashMap
<>();
Map
<
String
,
LanguageMsg
>
msgMap
=
new
HashMap
<>();
List
<
LanguageMsg
>
msgs
=
languageMsgManager
.
findByQuery
(
new
Query
());
List
<
LanguageMsg
>
msgs
=
languageMsgManager
.
findByQuery
(
new
Query
());
...
...
src/main/resources/messages.properties
查看文件 @
13011d6
...
@@ -139,5 +139,7 @@ smfcore.msd=MSD\u7BA1\u7406
...
@@ -139,5 +139,7 @@ smfcore.msd=MSD\u7BA1\u7406
smfcore.msdManage
=
MSD
\u
5E93
\u
5B58
smfcore.msdManage
=
MSD
\u
5E93
\u
5B58
smfcore.msdData
=
MSD
\u
8FFD
\u
6EAF
\u6027
smfcore.msdData
=
MSD
\u
8FFD
\u
6EAF
\u6027
smfcore.msdSetting
=
MSD
\u
8BBE
\u
7F6E
smfcore.msdSetting
=
MSD
\u
8BBE
\u
7F6E
smfcore.translation
=
\u
8D44
\u
6E90
\u
7FFB
\u
8BD1
smfcode.languageCanotNull
=
\u
8BED
\u
8A00
\u
7C7B
\u
578B
\u
4E0D
\u
80FD
\u
4E3A
\u
7A7A
smfcode.noLanguageSetAccess
=
\u
6CA1
\u6709\u
7F16
\u
8F91
\u
8BED
\u
8A00
\u7684\u6743\u9650
smfcode.languageCanotRemoveAll
=
\u
4E0D
\u
80FD
\u5220\u9664\u6240\u6709\u
8BED
\u
8A00
\ No newline at end of file
\ No newline at end of file
src/main/resources/messages_en_US.properties
查看文件 @
13011d6
...
@@ -139,3 +139,7 @@ smfcore.msd=MSD Management
...
@@ -139,3 +139,7 @@ smfcore.msd=MSD Management
smfcore.msdManage
=
MSD Inventory
smfcore.msdManage
=
MSD Inventory
smfcore.msdData
=
MSD Traceability
smfcore.msdData
=
MSD Traceability
smfcore.msdSetting
=
MSD Setting
smfcore.msdSetting
=
MSD Setting
smfcore.translation
=
Resource Translation
smfcode.languageCanotNull
=
Language type cannot be empty
smfcode.noLanguageSetAccess
=
No permission to edit the language
smfcode.languageCanotRemoveAll
=
Cannot delete all languages
src/main/resources/messages_ja_JP.properties
查看文件 @
13011d6
...
@@ -138,4 +138,8 @@ smfcode.label.noReel=\u6750\u6599\u304C\u898B\u3064\u304B\u3089\u306A\u3044
...
@@ -138,4 +138,8 @@ smfcode.label.noReel=\u6750\u6599\u304C\u898B\u3064\u304B\u3089\u306A\u3044
smfcore.msd
=
MSD
\u
7BA1
\u7406
smfcore.msd
=
MSD
\u
7BA1
\u7406
smfcore.msdManage
=
MSD
\u
5E93
\u
5B58
smfcore.msdManage
=
MSD
\u
5E93
\u
5B58
smfcore.msdData
=
MSD
\u
8FFD
\u
6EAF
\u6027
smfcore.msdData
=
MSD
\u
8FFD
\u
6EAF
\u6027
smfcore.msdSetting
=
MSD
\u
8BBE
\u
7F6E
\ No newline at end of file
\ No newline at end of file
smfcore.msdSetting
=
MSD
\u
8BBE
\u
7F6E
smfcore.translation
=
\u
30EA
\u
30BD
\u
30FC
\u
30B9
\u
306E
\u
7FFB
\u
8A33
smfcode.languageCanotNull
=
\u
8A00
\u
8A9E
\u
30BF
\u
30A4
\u
30D7
\u
306F
\u
7A7A
\u3067\u
306F
\u3042\u
308A
\u
307E
\u
305B
\u3093
smfcode.noLanguageSetAccess
=
\u
8A00
\u
8A9E
\u3092\u
7DE8
\u
96C6
\u3059\u
308B
\u
6A29
\u9650\u
304C
\u
306A
\u3044
smfcode.languageCanotRemoveAll
=
\u3059\u3079\u3066\u
306E
\u
8A00
\u
8A9E
\u3092\u
524A
\u9664\u3067\u
304D
\u
306A
\u3044
\ No newline at end of file
\ No newline at end of file
src/main/resources/messages_zh_CN.properties
查看文件 @
13011d6
...
@@ -138,4 +138,8 @@ smfcode.label.noReel=\u672A\u627E\u5230\u53EF\u51FA\u5E93\u7684\u7269\u6599
...
@@ -138,4 +138,8 @@ smfcode.label.noReel=\u672A\u627E\u5230\u53EF\u51FA\u5E93\u7684\u7269\u6599
smfcore.msd
=
MSD
\u
7BA1
\u7406
smfcore.msd
=
MSD
\u
7BA1
\u7406
smfcore.msdManage
=
MSD
\u
5E93
\u
5B58
smfcore.msdManage
=
MSD
\u
5E93
\u
5B58
smfcore.msdData
=
MSD
\u
8FFD
\u
6EAF
\u6027
smfcore.msdData
=
MSD
\u
8FFD
\u
6EAF
\u6027
smfcore.msdSetting
=
MSD
\u
8BBE
\u
7F6E
\ No newline at end of file
\ No newline at end of file
smfcore.msdSetting
=
MSD
\u
8BBE
\u
7F6E
smfcore.translation
=
\u
8D44
\u
6E90
\u
7FFB
\u
8BD1
smfcode.languageCanotNull
=
\u
8BED
\u
8A00
\u
7C7B
\u
578B
\u
4E0D
\u
80FD
\u
4E3A
\u
7A7A
smfcode.noLanguageSetAccess
=
\u
6CA1
\u6709\u
7F16
\u
8F91
\u
8BED
\u
8A00
\u7684\u6743\u9650
smfcode.languageCanotRemoveAll
=
\u
4E0D
\u
80FD
\u5220\u9664\u6240\u6709\u
8BED
\u
8A00
\ No newline at end of file
\ No newline at end of file
src/main/resources/messages_zh_TW.properties
查看文件 @
13011d6
...
@@ -138,4 +138,8 @@ smfcode.label.noReel=\u672A\u627E\u5230\u53EF\u51FA\u5EAB\u7684\u7269\u6599
...
@@ -138,4 +138,8 @@ smfcode.label.noReel=\u672A\u627E\u5230\u53EF\u51FA\u5EAB\u7684\u7269\u6599
smfcore.msd
=
MSD
\u
7BA1
\u7406
smfcore.msd
=
MSD
\u
7BA1
\u7406
smfcore.msdManage
=
MSD
\u
5E93
\u
5B58
smfcore.msdManage
=
MSD
\u
5E93
\u
5B58
smfcore.msdData
=
MSD
\u
8FFD
\u
6EAF
\u6027
smfcore.msdData
=
MSD
\u
8FFD
\u
6EAF
\u6027
smfcore.msdSetting
=
MSD
\u
8A2D
\u
7F6E
\ No newline at end of file
\ No newline at end of file
smfcore.msdSetting
=
MSD
\u
8A2D
\u
7F6E
smfcore.translation
=
\u
8CC7
\u
6E90
\u
7FFB
\u
8B6F
smfcode.languageCanotNull
=
\u
8A9E
\u
8A00
\u
985E
\u
578B
\u
4E0D
\u
80FD
\u
70BA
\u
7A7A
smfcode.noLanguageSetAccess
=
\u
6C92
\u6709\u
7DE8
\u
8F2F
\u
8A9E
\u
8A00
\u7684\u
6B0A
\u9650
smfcode.languageCanotRemoveAll
=
\u
4E0D
\u
80FD
\u
522A
\u9664\u6240\u6709\u
8A9E
\u
8A00
\ No newline at end of file
\ No newline at end of file
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论