sea-chart 0.0.98-1 → 0.0.98-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -6,6 +6,7 @@ import { eventStopPropagation } from '../../utils';
|
|
|
6
6
|
import context from '../../context';
|
|
7
7
|
import intl from '../../intl';
|
|
8
8
|
import Icon from '../icon';
|
|
9
|
+
import useForceUpdate from './use-force-update';
|
|
9
10
|
import './index.css';
|
|
10
11
|
const TypesDialog = _ref => {
|
|
11
12
|
let {
|
|
@@ -17,12 +18,16 @@ const TypesDialog = _ref => {
|
|
|
17
18
|
const [currentCatIndex, setCurrentCatIndex] = useState(0);
|
|
18
19
|
const [selectedType, setType] = useState(type);
|
|
19
20
|
const seaChartTypeContainerRef = useRef(null);
|
|
21
|
+
const forceUpdate = useForceUpdate();
|
|
20
22
|
const notSupportStatisticTypes = useMemo(() => {
|
|
21
23
|
const lang = context.getSetting('lang');
|
|
22
24
|
return lang !== 'zh-cn' ? ZH_CN_SUPPORT_CHARTS : [];
|
|
23
25
|
}, []);
|
|
24
26
|
useEffect(() => {
|
|
25
|
-
|
|
27
|
+
if (lang) {
|
|
28
|
+
intl.setLang(lang);
|
|
29
|
+
forceUpdate();
|
|
30
|
+
}
|
|
26
31
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
27
32
|
}, []);
|
|
28
33
|
useEffect(() => {
|
package/dist/intl.js
CHANGED
|
@@ -9,7 +9,6 @@ class Intl {
|
|
|
9
9
|
} = _ref;
|
|
10
10
|
this.setLang = function () {
|
|
11
11
|
let lang = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DEFAULT_LANG;
|
|
12
|
-
console.log(lang);
|
|
13
12
|
const validLang = lang.toLowerCase();
|
|
14
13
|
setLocale(validLang);
|
|
15
14
|
if (validLang === _this.lang) return;
|