[ISSUE #11706] Fix the Chinese description in announcement under English console. (#11729)

This commit is contained in:
lcmarvin 2024-02-27 10:28:58 +08:00 committed by GitHub
parent a275356c10
commit 889a78a82b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 13 additions and 9 deletions

View File

@ -15,7 +15,7 @@
*/
import request from '../utils/request';
import { GET_STATE, LOGINPAGE_ENABLED, GET_NOTICE, SERVER_GUIDE } from '../constants';
import { GET_STATE, LOGINPAGE_ENABLED, GET_NOTICE, SERVER_GUIDE, LANGUAGE_KEY } from '../constants';
const initialState = {
version: null,
@ -78,7 +78,7 @@ const getState = () => dispatch =>
const getNotice = () => dispatch =>
request
.get('v1/console/server/announcement')
.get('v1/console/server/announcement?language=' + localStorage.getItem(LANGUAGE_KEY))
.then(res => {
dispatch({
type: GET_NOTICE,

View File

@ -27,6 +27,7 @@ import com.alibaba.nacos.sys.utils.DiskUtils;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.io.File;
@ -62,8 +63,10 @@ public class ServerStateController {
}
@GetMapping("/announcement")
public RestResult<String> getAnnouncement() {
File announcementFile = new File(EnvUtil.getConfPath(), ANNOUNCEMENT_FILE);
public RestResult<String> getAnnouncement(
@RequestParam(required = false, name = "language", defaultValue = "zh-CN") String language) {
String file = ANNOUNCEMENT_FILE.substring(0, ANNOUNCEMENT_FILE.length() - 5) + "_" + language + ".conf";
File announcementFile = new File(EnvUtil.getConfPath(), file);
String announcement = null;
if (announcementFile.exists() && announcementFile.isFile()) {
announcement = DiskUtils.readFile(announcementFile);

View File

@ -35,7 +35,7 @@
<link rel="stylesheet" type="text/css" href="console-ui/public/css/icon.css">
<link rel="stylesheet" type="text/css" href="console-ui/public/css/font-awesome.css">
<!-- 第三方css结束 -->
<link href="./css/main.css?95cd0f64829dcbfb990e" rel="stylesheet"></head>
<link href="./css/main.css?8aafb58c7f29949ac658" rel="stylesheet"></head>
<body>
<div id="root" style="overflow:hidden"></div>
@ -56,6 +56,6 @@
<script src="console-ui/public/js/merge.js"></script>
<script src="console-ui/public/js/loader.js"></script>
<!-- 第三方js结束 -->
<script type="text/javascript" src="./js/main.js?95cd0f64829dcbfb990e"></script></body>
<script type="text/javascript" src="./js/main.js?8aafb58c7f29949ac658"></script></body>
</html>

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
Authentication has not been enabled in cluster, please refer to <a href="https://nacos.io/en-us/docs/v2/guide/user/auth.html">Documentation</a> to enable~

View File

@ -348,7 +348,7 @@
<exclude>**/any.proto</exclude>
<exclude>src/main/java/com/alibaba/nacos/common/packagescan/classreading/**</exclude>
<exclude>.flattened-pom.xml</exclude>
<exclude>**/announcement.conf</exclude>
<exclude>**/announcement*.conf</exclude>
<exclude>**/console-guide.conf</exclude>
<exclude>**/reflect-config.json</exclude>
<exclude>**/resource-config.json</exclude>