Skip to content

Commit

Permalink
feat: turbo后台信息国际化 TencentBlueKing#86
Browse files Browse the repository at this point in the history
  • Loading branch information
eazence committed Jul 5, 2023
1 parent 463364f commit 6bf0225
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,17 @@ class TurboRecordService @Autowired constructor(
// 根据配置的变量值拼接url
turboEngineConfigEntity.displayFields!!.forEach {
// 显示的值要看配置的枚举中是否包含,如果包含的话需要从枚举中取名字,显示名字
val displayFieldValue = (paramConfigMap[it.fieldKey]?.get(displayRange[it.fieldKey].toString())) ?: displayRange[it.fieldKey]
// val displayFieldValue = (paramConfigMap[it.fieldKey]?.get(displayRange[it.fieldKey].toString())) ?: displayRange[it.fieldKey]
val paramEnumMap = paramConfigMap[it.fieldKey]
val displayFieldValue = if (null != paramEnumMap) {
logger.info("paramEnumMap: ${JsonUtil.toJson(paramEnumMap)} \n i18n key: ${turboEngineConfigEntity
.engineCode}.paramConfig.${it.fieldKey}.paramEnum.${displayRange[it.fieldKey].toString()}")
I18NUtil.getMessage("${turboEngineConfigEntity.engineCode}.paramConfig.${it.fieldKey
}.paramEnum.${displayRange[it.fieldKey].toString()}") ?: displayRange[it.fieldKey]
} else {
displayRange[it.fieldKey]
}

displayFields.add(
TurboDisplayFieldVO(
fieldName = I18NUtil.getMessage("displayFields.${it.fieldKey}.fieldName") ?: it.fieldName,
Expand Down

0 comments on commit 6bf0225

Please sign in to comment.