|
@@ -2,6 +2,7 @@ import React, { Component } from "react";
|
2
|
2
|
import PropTypes from "prop-types";
|
3
|
3
|
import { message } from "antd";
|
4
|
4
|
import axios from "axios";
|
|
5
|
+import Cookies from "js-cookie";
|
5
|
6
|
import intl from "react-intl-universal";
|
6
|
7
|
import { ERROR_DEFAULT, LIMIT, COMMENT_TYPE, LANGUAGE_LINK } from "./constant";
|
7
|
8
|
import { CommentContext } from "./Comment";
|
|
@@ -65,10 +66,13 @@ class App extends Component {
|
65
|
66
|
*/
|
66
|
67
|
loadLocales() {
|
67
|
68
|
let { locales: currentLocale } = this.props;
|
|
69
|
+ const cookieLang = Cookies.get("lnk_lang");
|
68
|
70
|
if (!currentLocale) {
|
69
|
|
- currentLocale = intl.determineLocale({
|
70
|
|
- urlLocaleKey: "lang"
|
71
|
|
- });
|
|
71
|
+ currentLocale =
|
|
72
|
+ cookieLang ||
|
|
73
|
+ intl.determineLocale({
|
|
74
|
+ urlLocaleKey: "lang"
|
|
75
|
+ });
|
72
|
76
|
}
|
73
|
77
|
currentLocale = SUPPORT_LOCALES.find(item => item.value === currentLocale)
|
74
|
78
|
? currentLocale
|