@eohjsc/react-native-smart-city 0.2.19 → 0.2.23
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.
- package/assets/images/Add.svg +5 -0
- package/assets/images/AddLocationMaps/Point.svg +3 -0
- package/assets/images/CheckCircle.svg +4 -0
- package/assets/images/Close.svg +3 -0
- package/assets/images/Event.svg +9 -0
- package/assets/images/HowToStart.svg +14 -0
- package/assets/images/OneTap.svg +14 -0
- package/assets/images/Rearrange.svg +3 -0
- package/assets/images/Schedule.svg +39 -0
- package/assets/images/WeatherChange.svg +49 -0
- package/index.js +2 -0
- package/package.json +7 -4
- package/src/Images/Common/ActiveButton.png +0 -0
- package/src/Images/Common/ActiveButton@2x.png +0 -0
- package/src/Images/Common/ActiveButton@3x.png +0 -0
- package/src/Images/Common/file@2x.png +0 -0
- package/src/Images/Common/file@3x.png +0 -0
- package/src/Images/Common/fullscreen@2x.png +0 -0
- package/src/Images/Common/fullscreen@3x.png +0 -0
- package/src/commons/ActionGroup/OptionsDropdownActionTemplate.js +6 -3
- package/src/commons/ActionGroup/StatesGridActionTemplate.js +10 -1
- package/src/commons/ActionGroup/ThreeButtonTemplate.js +13 -6
- package/src/commons/ActionGroup/ThreeButtonTemplateStyle.js +1 -1
- package/src/commons/ActionGroup/TimerActionTemplate.js +158 -33
- package/src/commons/ActionGroup/__test__/OptionsDropdownTemplate.test.js +2 -1
- package/src/commons/ActionGroup/hooks/useDropdownAction.js +2 -1
- package/src/commons/Automate/ItemAddNewScriptAction.js +30 -0
- package/src/commons/Automate/ItemAddNewScriptActionStyles.js +38 -0
- package/src/commons/Automate/ItemAutomate.js +63 -0
- package/src/commons/Automate/ItemAutomateStyles.js +30 -0
- package/src/commons/Automate/ItemScriptAction.js +41 -0
- package/src/commons/Automate/ItemScriptActionStyles.js +38 -0
- package/src/commons/BottomScrollPicker/index.js +58 -0
- package/src/commons/BottomScrollPicker/styles.js +13 -0
- package/src/commons/BottomSheet/index.js +36 -0
- package/src/commons/BottomSheet/styles.js +37 -0
- package/src/commons/Button/index.js +6 -1
- package/src/commons/CameraDevice/index.js +22 -10
- package/src/commons/ChartLoading/index.js +2 -1
- package/src/commons/DateTimeRangeChange/index.js +2 -1
- package/src/commons/Device/ConnectedViewHeader.js +3 -1
- package/src/commons/Device/DeviceAlertStatus.js +2 -1
- package/src/commons/Device/DisconnectedView.js +34 -26
- package/src/commons/Device/Emergency/EmergencyButton.js +2 -1
- package/src/commons/Device/Emergency/EmergencyDetail.js +2 -1
- package/src/commons/Device/FlatListItems.js +2 -1
- package/src/commons/Device/FooterInfo.js +2 -1
- package/src/commons/Device/HistoryChart.js +2 -1
- package/src/commons/Device/HorizontalBarChart.js +3 -3
- package/src/commons/Device/PMSensor/PMSensorIndicatior.js +7 -2
- package/src/commons/Device/PMSensor/PMSensorIndicatorStyles.js +3 -1
- package/src/commons/Device/RainningSensor/CurrentRainSensor.js +3 -1
- package/src/commons/Device/SensorConnectedStatus.js +2 -1
- package/src/commons/Device/WindDirection/Compass/index.js +1 -1
- package/src/commons/Device/WindSpeed/LinearChart/index.js +2 -1
- package/src/commons/Device/__test__/DeviceAlertStatus.test.js +2 -1
- package/src/commons/EmergencyButton/AlertSendConfirm.js +2 -1
- package/src/commons/EmergencyButton/AlertSent.js +3 -2
- package/src/commons/Explore/CityItem/index.js +2 -1
- package/src/commons/Explore/HeaderExplore/index.js +2 -1
- package/src/commons/Explore/HeaderLabel/index.js +2 -1
- package/src/commons/Explore/SearchBox/index.js +2 -1
- package/src/commons/Header/HeaderCustom.js +36 -10
- package/src/commons/Header/Styles/HeaderCustomStyles.js +8 -3
- package/src/commons/HeaderAni/index.js +6 -3
- package/src/commons/IconComponent/index.js +18 -3
- package/src/commons/ImagePicker/index.js +3 -1
- package/src/commons/MediaPlayer/index.js +118 -62
- package/src/commons/MediaPlayer/styles.js +56 -0
- package/src/commons/MediaPlayerDetail/MediaPlayerDetailStyles.js +15 -0
- package/src/commons/MediaPlayerDetail/index.js +149 -64
- package/src/commons/MenuActionAddnew/index.js +2 -1
- package/src/commons/Modal/ModalCustom.js +22 -0
- package/src/commons/Modal/ModalFullVideo.js +48 -0
- package/src/commons/Modal/Styles/ModalFullVideoStyles.js +26 -0
- package/src/commons/Modal/index.js +4 -0
- package/src/commons/NavBar/index.js +2 -2
- package/src/commons/Sharing/DevicePermissionsCheckbox.js +2 -1
- package/src/commons/Sharing/MemberList.js +3 -1
- package/src/commons/Sharing/RowMember.js +3 -2
- package/src/commons/Sharing/StationDevicePermissions.js +2 -1
- package/src/commons/SubUnit/OneTap/ItemOneTap.js +86 -0
- package/src/commons/SubUnit/OneTap/ItemOneTapStyles.js +41 -0
- package/src/commons/SubUnit/OneTap/OneTapStyles.js +36 -0
- package/src/commons/SubUnit/OneTap/index.js +29 -0
- package/src/commons/SubUnit/ShortDetail.js +3 -1
- package/src/commons/Today/index.js +2 -1
- package/src/commons/Unit/SharedUnit.js +2 -1
- package/src/commons/UnitSummary/AirQuality/SegmentedRoundDisplay/index.js +1 -2
- package/src/commons/UnitSummary/AirQuality/index.js +5 -120
- package/src/commons/UnitSummary/AirQuality/styles.js +112 -0
- package/src/commons/UnitSummary/TotalPowerConsumption/index.js +2 -1
- package/src/commons/WheelDateTimePicker/Picker.js +57 -0
- package/src/commons/WheelDateTimePicker/index.js +160 -0
- package/src/commons/WheelDateTimePicker/styles.js +21 -0
- package/src/configs/API.js +25 -3
- package/src/configs/Colors.js +1 -0
- package/src/configs/Constants.js +4 -0
- package/src/configs/Images.js +4 -0
- package/src/configs/SCConfig.js +94 -0
- package/src/context/SCContext.tsx +5 -11
- package/src/context/reducer.ts +2 -0
- package/src/hooks/Common/useStatusBar.js +3 -0
- package/src/hooks/Common/useTranslations.ts +34 -0
- package/src/iot/Monitor.js +2 -1
- package/src/iot/RemoteControl/Bluetooth.js +2 -6
- package/src/iot/RemoteControl/GoogleHome.js +1 -1
- package/src/iot/RemoteControl/Internet.js +1 -1
- package/src/iot/RemoteControl/LG.js +57 -15
- package/src/iot/RemoteControl/__test__/Bluetooth.test.js +2 -1
- package/src/iot/RemoteControl/__test__/GoogleHome.test.js +2 -1
- package/src/iot/RemoteControl/__test__/Internet.test.js +2 -1
- package/src/iot/RemoteControl/__test__/index.test.js +2 -1
- package/src/iot/RemoteControl/index.js +1 -1
- package/src/iot/states.js +1 -0
- package/src/navigations/AddGatewayStack.js +5 -0
- package/src/navigations/AddNewActionStack.js +23 -0
- package/src/navigations/SharedStack.js +2 -1
- package/src/navigations/UnitStack.js +72 -1
- package/src/screens/AQIGuide/index.js +2 -2
- package/src/screens/ActivityLog/hooks/index.js +1 -1
- package/src/screens/ActivityLog/index.js +2 -1
- package/src/screens/AddCommon/SelectSubUnit.js +143 -0
- package/src/screens/AddCommon/SelectSubUnitStyles.js +55 -0
- package/src/screens/AddCommon/SelectUnit.js +3 -2
- package/src/screens/AddLocationMaps/index.js +2 -1
- package/src/screens/AddNewAction/Device/DeviceStyles.js +43 -0
- package/src/screens/AddNewAction/Device/index.js +33 -0
- package/src/screens/AddNewAction/SelectDevice.js +106 -0
- package/src/screens/AddNewAction/Styles/SelectDeviceStyles.js +36 -0
- package/src/screens/AddNewDevice/ConnectDevices.js +2 -1
- package/src/screens/AddNewDevice/ConnectingDevices.js +2 -1
- package/src/screens/AddNewDevice/__test__/AddNewDevice.test.js +2 -1
- package/src/screens/AddNewDevice/__test__/ConnectDevices.test.js +2 -1
- package/src/screens/AddNewDevice/__test__/ConnectingDevices.test.js +2 -1
- package/src/screens/AddNewDevice/hooks/useStateAlertRename.js +2 -1
- package/src/screens/AddNewDevice/index.js +23 -4
- package/src/screens/AddNewGateway/AddNewGatewayStyles.js +29 -0
- package/src/screens/AddNewGateway/ConnectedGateway.js +2 -1
- package/src/screens/AddNewGateway/ConnectingGateway.js +100 -25
- package/src/screens/AddNewGateway/ConnectingGatewayStyles.js +92 -0
- package/src/screens/AddNewGateway/SetupGatewayWifi.js +25 -3
- package/src/screens/AddNewGateway/SetupGatewayWifiStyles.js +6 -1
- package/src/screens/AddNewGateway/__test__/AddNewGateway.test.js +2 -1
- package/src/screens/AddNewGateway/__test__/ConnectedGateway.test.js +2 -1
- package/src/screens/AddNewGateway/__test__/ConnectingGateway.test.js +2 -1
- package/src/screens/AddNewGateway/hooks/useStateAlertRename.js +2 -1
- package/src/screens/AddNewGateway/index.js +28 -110
- package/src/screens/AddNewOneTap/AddNewOneTapStyles.js +43 -0
- package/src/screens/AddNewOneTap/index.js +67 -0
- package/src/screens/AddNewScriptAction/AddNewScriptActionStyles.js +27 -0
- package/src/screens/AddNewScriptAction/index.js +92 -0
- package/src/screens/AllCamera/Styles/index.js +101 -0
- package/src/screens/AllCamera/index.js +208 -0
- package/src/screens/Device/HeaderDevice/styles.js +2 -2
- package/src/screens/Device/__test__/detail.test.js +2 -1
- package/src/screens/Device/detail.js +66 -23
- package/src/screens/Device/hooks/useEmergencyButton.js +7 -6
- package/src/screens/Device/styles.js +3 -0
- package/src/screens/DeviceInfo/index.js +3 -2
- package/src/screens/EditActionsList/Styles/indexStyles.js +73 -0
- package/src/screens/EditActionsList/index.js +122 -0
- package/src/screens/EmergencyContacts/EmergencyContactsAddNew.js +3 -2
- package/src/screens/EmergencyContacts/EmergencyContactsList.js +9 -2
- package/src/screens/EmergencyContacts/EmergencyContactsSelectContacts.js +2 -1
- package/src/screens/EmergencyContacts/__test__/EmergencyContactAddNew.test.js +2 -1
- package/src/screens/EmergencyContacts/__test__/EmergencyContactList.test.js +2 -1
- package/src/screens/EmergencyContacts/hook.js +3 -2
- package/src/screens/Explore/index.js +3 -2
- package/src/screens/GuestInfo/components/AccessScheduleItem.js +27 -0
- package/src/screens/GuestInfo/components/AccessScheduleSheet.js +193 -0
- package/src/screens/GuestInfo/components/HeaderGuestInfo.js +31 -0
- package/src/screens/GuestInfo/components/RecurringDetail.js +99 -0
- package/src/screens/GuestInfo/components/RowGuestInfo.js +31 -0
- package/src/screens/GuestInfo/components/TemporaryDetail.js +46 -0
- package/src/screens/GuestInfo/constant.js +59 -0
- package/src/screens/GuestInfo/index.js +151 -0
- package/src/screens/GuestInfo/styles/AccessScheduleDetailStyles.js +31 -0
- package/src/screens/GuestInfo/styles/AccessScheduleItemStyles.js +22 -0
- package/src/screens/GuestInfo/styles/HeaderGuestInfoStyles.js +31 -0
- package/src/screens/GuestInfo/styles/indexStyles.js +38 -0
- package/src/screens/ManageAccess/__test__/ManageAccess.test.js +82 -0
- package/src/screens/ManageAccess/hooks/index.js +32 -0
- package/src/screens/ManageAccess/index.js +126 -0
- package/src/screens/ManageAccess/styles/ManageAccessStyles.js +72 -0
- package/src/screens/PlayBackCamera/Styles/TimerStyles.js +22 -0
- package/src/screens/PlayBackCamera/Styles/index.js +81 -0
- package/src/screens/PlayBackCamera/Timer.js +127 -0
- package/src/screens/PlayBackCamera/index.js +233 -0
- package/src/screens/ScanChipQR/components/QRScan/index.js +2 -1
- package/src/screens/ScanChipQR/hooks/index.js +4 -11
- package/src/screens/ScriptDetail/Styles/indexStyles.js +140 -0
- package/src/screens/ScriptDetail/index.js +241 -0
- package/src/screens/SharedUnit/TabHeader.js +2 -1
- package/src/screens/SharedUnit/index.js +3 -2
- package/src/screens/Sharing/MemberList.js +2 -1
- package/src/screens/Sharing/SelectPermission.js +2 -1
- package/src/screens/Sharing/SelectUser.js +3 -2
- package/src/screens/Sharing/__test__/MemberList.test.js +2 -1
- package/src/screens/Sharing/__test__/SelectUser.test.js +2 -1
- package/src/screens/Sharing/hooks/index.js +22 -17
- package/src/screens/SubUnit/AddSubUnit.js +14 -72
- package/src/screens/SubUnit/AddSubUnitStyles.js +66 -0
- package/src/screens/SubUnit/Detail.js +5 -63
- package/src/screens/SubUnit/DetailStyles.js +46 -0
- package/src/screens/SubUnit/ManageSubUnit.js +5 -4
- package/src/screens/SubUnit/__test__/AddSubUnit.test.js +2 -1
- package/src/screens/SubUnit/__test__/ManageSubUnit.test.js +2 -1
- package/src/screens/SyncLGDevice/AddLGDevice.js +3 -2
- package/src/screens/SyncLGDevice/__test__/AddLGDevice.test.js +2 -1
- package/src/screens/TDSGuide/index.js +2 -1
- package/src/screens/UVIndexGuide/index.js +2 -1
- package/src/screens/Unit/AddMenu.js +3 -2
- package/src/screens/Unit/Detail.js +75 -20
- package/src/screens/Unit/ManageUnit/index.js +4 -3
- package/src/screens/Unit/ManageUnit.js +4 -3
- package/src/screens/Unit/MoreMenu.js +3 -2
- package/src/screens/Unit/SelectLocation.js +10 -2
- package/src/screens/Unit/SelectLocationStyles.js +11 -0
- package/src/screens/Unit/components/Header/index.js +2 -1
- package/src/screens/Unit/components/ListMyAllUnit/index.js +2 -1
- package/src/screens/Unit/components/MyUnit/index.js +2 -1
- package/src/screens/Unit/components/SearchLocation/index.js +2 -1
- package/src/screens/Unit/components/SharedUnit/index.js +2 -1
- package/src/screens/Unit/styles.js +4 -0
- package/src/screens/UnitSummary/components/3PPowerConsumption/index.js +2 -1
- package/src/screens/UnitSummary/components/PowerConsumption/index.js +2 -1
- package/src/screens/UnitSummary/components/Temperature/index.js +2 -1
- package/src/screens/UnitSummary/components/TotalPowerConsumption/index.js +2 -1
- package/src/screens/UnitSummary/components/UvIndex/index.js +2 -1
- package/src/screens/UnitSummary/components/WaterQuality/index.js +2 -1
- package/src/screens/UnitSummary/index.js +2 -1
- package/src/screens/WaterQualityGuide/index.js +2 -1
- package/src/utils/Converter/__test__/time.test.js +3 -1
- package/src/utils/Converter/array.js +4 -0
- package/src/utils/Converter/time.js +29 -4
- package/src/utils/I18n/index.ts +6 -0
- package/src/utils/I18n/translations/en.json +51 -2
- package/src/utils/I18n/translations/vi.json +48 -1
- package/src/utils/I18n/translations.ts +45 -0
- package/src/utils/Route/index.js +11 -0
- package/src/utils/I18n/index.js +0 -19
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
2
|
import { View, Image, StyleSheet, Animated, ScrollView } from 'react-native';
|
|
3
3
|
import { IconOutline } from '@ant-design/icons-react-native';
|
|
4
|
-
import {
|
|
4
|
+
import { useTranslations } from '../../../../hooks/Common/useTranslations';
|
|
5
5
|
|
|
6
6
|
import { Colors, Images } from '../../../../configs';
|
|
7
7
|
import Text from '../../../../commons/Text';
|
|
@@ -11,6 +11,7 @@ import { colorOpacity } from '../../../../utils/Converter/color';
|
|
|
11
11
|
const AnimatedScrollView = Animated.createAnimatedComponent(ScrollView);
|
|
12
12
|
|
|
13
13
|
const ListMyAllUnit = ({ unitItems }) => {
|
|
14
|
+
const t = useTranslations();
|
|
14
15
|
// eslint-disable-next-line no-unused-vars
|
|
15
16
|
const [scrollY, setScrollY] = useState(new Animated.Value(0));
|
|
16
17
|
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from 'react-native';
|
|
9
9
|
import Carousel from 'react-native-snap-carousel';
|
|
10
10
|
import { useNavigation } from '@react-navigation/native';
|
|
11
|
-
import {
|
|
11
|
+
import { useTranslations } from '../../../../hooks/Common/useTranslations';
|
|
12
12
|
|
|
13
13
|
import { Colors, Images } from '../../../../configs';
|
|
14
14
|
import { TESTID } from '../../../../configs/Constants';
|
|
@@ -20,6 +20,7 @@ import { colorOpacity } from '../../../../utils/Converter/color';
|
|
|
20
20
|
let screenWidth = Dimensions.get('window').width;
|
|
21
21
|
|
|
22
22
|
const MyUnit = ({ myUnits }) => {
|
|
23
|
+
const t = useTranslations();
|
|
23
24
|
const navigation = useNavigation();
|
|
24
25
|
const carouselItems = useMemo(() => myUnits, [myUnits]);
|
|
25
26
|
const goToDetail = useCallback(
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import React, { memo } from 'react';
|
|
2
2
|
import { View, TextInput } from 'react-native';
|
|
3
3
|
import { IconOutline } from '@ant-design/icons-react-native';
|
|
4
|
-
import {
|
|
4
|
+
import { useTranslations } from '../../../../hooks/Common/useTranslations';
|
|
5
5
|
|
|
6
6
|
import { Colors } from '../../../../configs';
|
|
7
7
|
import styles from './SearchBarLocationStyles';
|
|
8
8
|
|
|
9
9
|
const SearchBarLocation = memo(({ input, onTextInput }) => {
|
|
10
|
+
const t = useTranslations();
|
|
10
11
|
return (
|
|
11
12
|
<View style={styles.container}>
|
|
12
13
|
<IconOutline
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { Fragment, useCallback } from 'react';
|
|
2
2
|
import { View, Image, TouchableOpacity } from 'react-native';
|
|
3
|
-
import {
|
|
3
|
+
import { useTranslations } from '../../../../hooks/Common/useTranslations';
|
|
4
4
|
import { IconOutline, IconFill } from '@ant-design/icons-react-native';
|
|
5
5
|
|
|
6
6
|
import { API, Colors, Images } from '../../../../configs';
|
|
@@ -18,6 +18,7 @@ const SharedUnit = ({
|
|
|
18
18
|
index,
|
|
19
19
|
isOptions = true,
|
|
20
20
|
}) => {
|
|
21
|
+
const t = useTranslations();
|
|
21
22
|
const { unit } = item;
|
|
22
23
|
const goToDetail = useCallback(() => {
|
|
23
24
|
navigation.navigate(Routes.UnitStack, {
|
|
@@ -7,12 +7,13 @@ import { Section, Today } from '../../../../commons';
|
|
|
7
7
|
import ListQualityIndicator from '../../../../commons/Device/WaterQualitySensor/ListQualityIndicator';
|
|
8
8
|
import PMSensorIndicatior from '../../../../commons/Device/PMSensor/PMSensorIndicatior';
|
|
9
9
|
import ConfigHistoryChart from '../../../../commons/UnitSummary/ConfigHistoryChart';
|
|
10
|
-
import {
|
|
10
|
+
import { useTranslations } from '../../../../hooks/Common/useTranslations';
|
|
11
11
|
import HistoryChart from '../../../../commons/Device/HistoryChart';
|
|
12
12
|
import { axiosGet } from '../../../../utils/Apis/axios';
|
|
13
13
|
import { TESTID } from '../../../../configs/Constants';
|
|
14
14
|
|
|
15
15
|
const ThreePhasePowerConsumption = memo(({ unit, summary, summaryDetail }) => {
|
|
16
|
+
const t = useTranslations();
|
|
16
17
|
const {
|
|
17
18
|
volt1Value,
|
|
18
19
|
volt2Value,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { memo, useMemo, useEffect, useState } from 'react';
|
|
2
2
|
import { View, StyleSheet } from 'react-native';
|
|
3
|
-
import {
|
|
3
|
+
import { useTranslations } from '../../../../hooks/Common/useTranslations';
|
|
4
4
|
import moment from 'moment';
|
|
5
5
|
import { API, Colors } from '../../../../configs';
|
|
6
6
|
import Text from '../../../../commons/Text';
|
|
@@ -14,6 +14,7 @@ import { TESTID } from '../../../../configs/Constants';
|
|
|
14
14
|
import { axiosGet } from '../../../../utils/Apis/axios';
|
|
15
15
|
|
|
16
16
|
const PowerConsumption = memo(({ summaryDetail }) => {
|
|
17
|
+
const t = useTranslations();
|
|
17
18
|
const {
|
|
18
19
|
voltValue,
|
|
19
20
|
currentValue,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { memo, useMemo } from 'react';
|
|
2
2
|
import { StyleSheet, View } from 'react-native';
|
|
3
|
-
import {
|
|
3
|
+
import t, { useTranslations } from '../../../../hooks/Common/useTranslations';
|
|
4
4
|
|
|
5
5
|
import { Colors } from '../../../../configs';
|
|
6
6
|
import { Section, Today } from '../../../../commons';
|
|
@@ -44,6 +44,7 @@ const getDataTemperature = (summaryDetail) => {
|
|
|
44
44
|
};
|
|
45
45
|
|
|
46
46
|
const Temperature = memo(({ summaryDetail }) => {
|
|
47
|
+
const t = useTranslations();
|
|
47
48
|
const { listConfigs } = summaryDetail;
|
|
48
49
|
|
|
49
50
|
const showBoxHistory = useMemo(() => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { memo } from 'react';
|
|
2
2
|
import { View, StyleSheet } from 'react-native';
|
|
3
|
-
import {
|
|
3
|
+
import { useTranslations } from '../../../../hooks/Common/useTranslations';
|
|
4
4
|
|
|
5
5
|
import { Colors } from '../../../../configs';
|
|
6
6
|
import Text from '../../../../commons/Text';
|
|
@@ -8,6 +8,7 @@ import TotalPowerBox from '../TotalPowerBox';
|
|
|
8
8
|
import { TESTID } from '../../../../configs/Constants';
|
|
9
9
|
|
|
10
10
|
const TotalPowerConsumption = memo(({ time, total }) => {
|
|
11
|
+
const t = useTranslations();
|
|
11
12
|
return (
|
|
12
13
|
<View style={styles.container}>
|
|
13
14
|
<Text color={Colors.Gray9} size={16} style={styles.txtCurrent}>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { memo, useMemo } from 'react';
|
|
2
2
|
import { StyleSheet, View } from 'react-native';
|
|
3
3
|
import { IconOutline } from '@ant-design/icons-react-native';
|
|
4
|
-
import {
|
|
4
|
+
import { useTranslations } from '../../../../hooks/Common/useTranslations';
|
|
5
5
|
|
|
6
6
|
import { Colors } from '../../../../configs';
|
|
7
7
|
import Text from '../../../../commons/Text';
|
|
@@ -10,6 +10,7 @@ import ConfigHistoryChart from '../../../../commons/UnitSummary/ConfigHistoryCha
|
|
|
10
10
|
import SegmentedRoundDisplay from '../../../../commons/UnitSummary/AirQuality/SegmentedRoundDisplay';
|
|
11
11
|
|
|
12
12
|
const UvIndex = memo(({ summaryDetail }) => {
|
|
13
|
+
const t = useTranslations();
|
|
13
14
|
const { uv_id } = summaryDetail;
|
|
14
15
|
const showBoxHistory = useMemo(() => {
|
|
15
16
|
return !!uv_id;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import React, { memo, useMemo } from 'react';
|
|
2
2
|
import { StyleSheet, View } from 'react-native';
|
|
3
|
-
import {
|
|
3
|
+
import { useTranslations } from '../../../../hooks/Common/useTranslations';
|
|
4
4
|
import { Today, Section } from '../../../../commons';
|
|
5
5
|
import Text from '../../../../commons/Text';
|
|
6
6
|
import ConfigHistoryChart from '../../../../commons/UnitSummary/ConfigHistoryChart';
|
|
7
7
|
import Item from './Item';
|
|
8
8
|
|
|
9
9
|
const WaterQuality = memo(({ summaryDetail }) => {
|
|
10
|
+
const t = useTranslations();
|
|
10
11
|
const { ph_id, tur_id, clo_id } = summaryDetail;
|
|
11
12
|
const showBoxHistory = useMemo(() => {
|
|
12
13
|
return ph_id || tur_id || clo_id ? true : false;
|
|
@@ -3,7 +3,7 @@ import { View, StyleSheet } from 'react-native';
|
|
|
3
3
|
import { useNavigation } from '@react-navigation/native';
|
|
4
4
|
import { TouchableOpacity } from 'react-native';
|
|
5
5
|
import { IconOutline } from '@ant-design/icons-react-native';
|
|
6
|
-
import {
|
|
6
|
+
import { useTranslations } from '../../hooks/Common/useTranslations';
|
|
7
7
|
|
|
8
8
|
import { API, Colors } from '../../configs';
|
|
9
9
|
import Routes from '../../utils/Route';
|
|
@@ -20,6 +20,7 @@ import WaterQuality from './components/WaterQuality';
|
|
|
20
20
|
import { TESTID } from '../../configs/Constants';
|
|
21
21
|
|
|
22
22
|
const UnitSummary = memo(({ route }) => {
|
|
23
|
+
const t = useTranslations();
|
|
23
24
|
const { unit, summary } = route.params;
|
|
24
25
|
const [summaryDetail, setSummaryDetail] = useState({});
|
|
25
26
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { memo, useCallback, useMemo } from 'react';
|
|
2
2
|
import { View, ScrollView, StyleSheet, SafeAreaView } from 'react-native';
|
|
3
|
-
import {
|
|
3
|
+
import { useTranslations } from '../../hooks/Common/useTranslations';
|
|
4
4
|
|
|
5
5
|
import Text from '../../commons/Text';
|
|
6
6
|
import { Colors, Theme } from '../../configs';
|
|
@@ -9,6 +9,7 @@ import { TESTID } from '../../configs/Constants';
|
|
|
9
9
|
import { useSCContextSelector } from '../../context';
|
|
10
10
|
|
|
11
11
|
const WaterQualityGuide = memo(({ route }) => {
|
|
12
|
+
const t = useTranslations();
|
|
12
13
|
const { waterType } = route.params;
|
|
13
14
|
const language = useSCContextSelector((state) => state.language);
|
|
14
15
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import moment from 'moment';
|
|
2
|
-
import {
|
|
2
|
+
import { useTranslations } from '../../../hooks/Common/useTranslations';
|
|
3
3
|
|
|
4
4
|
const {
|
|
5
5
|
transformDatetime,
|
|
@@ -42,6 +42,7 @@ describe('test time utils, transformDatetime', () => {
|
|
|
42
42
|
});
|
|
43
43
|
|
|
44
44
|
describe('test time utils, timeDifference', () => {
|
|
45
|
+
const t = useTranslations();
|
|
45
46
|
const _testTime = (current, lastUpdated, result) => {
|
|
46
47
|
const timeString = timeDifference(new Date(current), new Date(lastUpdated));
|
|
47
48
|
expect(timeString).toEqual(result);
|
|
@@ -98,6 +99,7 @@ describe('test time utils, timeDifference', () => {
|
|
|
98
99
|
});
|
|
99
100
|
|
|
100
101
|
describe('test time utils, getTitleFromTime', () => {
|
|
102
|
+
const t = useTranslations();
|
|
101
103
|
const _testTime = (time, current, result) => {
|
|
102
104
|
const timeString = getTitleFromTime(new Date(time), new Date(current));
|
|
103
105
|
expect(timeString).toEqual(result);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import t from '../../hooks/Common/useTranslations';
|
|
2
2
|
import moment from 'moment';
|
|
3
3
|
|
|
4
4
|
export const transformDatetime = (data = {}, listFieldName = []) => {
|
|
@@ -19,7 +19,7 @@ export const transformDatetime = (data = {}, listFieldName = []) => {
|
|
|
19
19
|
});
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
-
export const timeDifference = (current, previous) => {
|
|
22
|
+
export const timeDifference = (current, previous, symbol = false) => {
|
|
23
23
|
let msPerMinute = 60 * 1000;
|
|
24
24
|
let msPerHour = msPerMinute * 60;
|
|
25
25
|
let msPerDay = msPerHour * 24;
|
|
@@ -33,9 +33,11 @@ export const timeDifference = (current, previous) => {
|
|
|
33
33
|
if (second < 0) {
|
|
34
34
|
second = 0;
|
|
35
35
|
}
|
|
36
|
-
return `${second} ${t('seconds_ago')}`;
|
|
36
|
+
return `${second} ${symbol ? t('secs_ago') : t('seconds_ago')}`;
|
|
37
37
|
} else if (elapsed < msPerHour) {
|
|
38
|
-
return `${Math.round(elapsed / msPerMinute)} ${
|
|
38
|
+
return `${Math.round(elapsed / msPerMinute)} ${
|
|
39
|
+
symbol ? t('mins_ago') : t('minutes_ago')
|
|
40
|
+
}`;
|
|
39
41
|
} else if (elapsed < msPerDay) {
|
|
40
42
|
return `${Math.round(elapsed / msPerHour)} ${t('hours_ago')}`;
|
|
41
43
|
} else if (elapsed < msPerMonth) {
|
|
@@ -62,3 +64,26 @@ export const getTitleFromTime = (time, current) => {
|
|
|
62
64
|
return moment(time).format('DD/MM/YYYY');
|
|
63
65
|
}
|
|
64
66
|
};
|
|
67
|
+
|
|
68
|
+
export const getDateData = (initialDate, max, min) => {
|
|
69
|
+
let dateData = [];
|
|
70
|
+
let dateIndex = -1;
|
|
71
|
+
const date = moment(min);
|
|
72
|
+
const today = moment();
|
|
73
|
+
|
|
74
|
+
while (date <= max) {
|
|
75
|
+
const dateString = date.isSame(today, 'day')
|
|
76
|
+
? t('today')
|
|
77
|
+
: date.format('ddd DD/MM');
|
|
78
|
+
dateData.push({
|
|
79
|
+
text: dateString,
|
|
80
|
+
value: moment(date),
|
|
81
|
+
});
|
|
82
|
+
if (date.isSame(initialDate, 'day')) {
|
|
83
|
+
dateIndex = dateData.length - 1;
|
|
84
|
+
}
|
|
85
|
+
date.add(1, 'days');
|
|
86
|
+
}
|
|
87
|
+
const indexInitialDate = dateIndex !== -1 ? dateIndex : 0;
|
|
88
|
+
return [dateData, indexInitialDate];
|
|
89
|
+
};
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"Yesterday": "Yesterday",
|
|
101
101
|
"last_updated_%{minutes}_minutes_ago": "Last updated %{minutes} minutes ago",
|
|
102
102
|
"Last %{days} ago": "Last %{days} days",
|
|
103
|
-
"Welcome
|
|
103
|
+
"Welcome {name}": "Welcome {name}",
|
|
104
104
|
"devices": "Devices",
|
|
105
105
|
"Turbidity": "Turbidity",
|
|
106
106
|
"pH": "pH",
|
|
@@ -180,6 +180,9 @@
|
|
|
180
180
|
"text_recommended_clo": "The higher the residual chlorine levels in the supply, the better and longer the chemical will be able to protect the system from contamination. However, high levels of chlorine make the water smell and give it a bad taste, which will discourage people from drinking it. \nFor normal domestic use, residual chlorine levels at the point where the consumer collects water should be between 0.2 and 0.5 mg/l. The higher level will be close to the disinfection point and the lower level at the far extremities of the supply network.",
|
|
181
181
|
"text_low_level": "Low",
|
|
182
182
|
"text_high_level": "High",
|
|
183
|
+
"launch_one_tap": "Launch One-Tap",
|
|
184
|
+
"des_launch_one_tap": "Quick button create at the dashboard",
|
|
185
|
+
"active_list": "Actions List",
|
|
183
186
|
"text_very_good_level": "Very good",
|
|
184
187
|
"text_good_level": "Good",
|
|
185
188
|
"text_moderate_level": "Moderate",
|
|
@@ -308,6 +311,8 @@
|
|
|
308
311
|
"text_remove_sub_unit_success": "Remove sub unit success!",
|
|
309
312
|
"text_remove_sub_unit_fail": "Remove sub unit fail!",
|
|
310
313
|
"camera": "Camera",
|
|
314
|
+
"favorites": "Favorites",
|
|
315
|
+
"add_to_favorites": "Add to Favorites",
|
|
311
316
|
"add_new_device": "Add new device",
|
|
312
317
|
"add_new_device_message_no_unit": "You cannot add new device. You have to add a new unit first.",
|
|
313
318
|
"add_member": "Add member",
|
|
@@ -383,6 +388,7 @@
|
|
|
383
388
|
"rebook": "Rebook",
|
|
384
389
|
"cancelled": "Cancelled",
|
|
385
390
|
"recent": "Recent",
|
|
391
|
+
"playback_camera": "Playback Camera",
|
|
386
392
|
"vehicle_management": "Vehicle management",
|
|
387
393
|
"saved_parking_areas": "Saved parking areas",
|
|
388
394
|
"payment_methods": "Payment methods",
|
|
@@ -447,7 +453,9 @@
|
|
|
447
453
|
"what_is_tds_title": "What is TDS?",
|
|
448
454
|
"what_is_tds_text": "TDS: is the total dissolved solids present in a certain amount of water - (the total number of charged ions, including salts, minerals or metals) that exist in a certain volume of water. High TDS is also responsible for turbidity and sedimentation in water. TDS is expressed in mg / L or parts per million (parts per million).",
|
|
449
455
|
"tds_guidlines_title": "TDS guidlines for drinking water",
|
|
450
|
-
"
|
|
456
|
+
"tds_guidlines_text_1": "Ideally, the TDS for drinking water should be below 300ppm and the maximum limit considered safe is 500ppm. Water sources with TDS <50ppm are usually water at a fairly pure level or water after being filtered through the RO system - this is water that contains a small amount of minerals and is completely assured to drink directly.",
|
|
457
|
+
"tds_guidlines_text_2": "Alpha 139G Water Purifier is certified to the national standards TCVN 11978:2017 & QCVN 4-2009/BKHCN about water purifiers for household use by the Ministry of Science and Technology.",
|
|
458
|
+
"tds_guidlines_text_3": "The quality of filtered water meets the standard of direct drinking water, QCVN 6-1:2010/BYT of the Ministry of Health includes 21 toxic physicochemical indicators such as: Arsenic, Ammonium, Lead, Cyanide, Mercury, Copper, Nitrate.. and 5 microbiological indicators: E.coli bacteria, Coliform, Streptococci feacal, Pseudomonas aeruginosa, Spores of sulfite-reducing anaerobic bacteria, ensuring absolute safety for users' health when drinking directly without boiling .(*).",
|
|
451
459
|
"your_booking_is_safety": "Your booking is safely reserved. However, please be aware that there is no refund for cancellation.",
|
|
452
460
|
"no_spot_available": "No spots available",
|
|
453
461
|
"status_full_info": "No spots available at this moment.",
|
|
@@ -590,7 +598,9 @@
|
|
|
590
598
|
"emergency_alert": "EMERGENCY ALERT!",
|
|
591
599
|
"the_emergency_button_has_been_activated": "The Emergency button has been activated at unit ",
|
|
592
600
|
"seconds_ago": "seconds ago",
|
|
601
|
+
"secs_ago": "secs ago",
|
|
593
602
|
"minutes_ago": "minutes ago",
|
|
603
|
+
"mins_ago": "mins ago",
|
|
594
604
|
"hours_ago": "hours ago",
|
|
595
605
|
"days_ago": "days ago",
|
|
596
606
|
"months_ago": "months ago",
|
|
@@ -664,6 +674,22 @@
|
|
|
664
674
|
"gateway": "Gateway",
|
|
665
675
|
"add_new_gateway": "Add new gateway",
|
|
666
676
|
"chip_name": "Chip name",
|
|
677
|
+
"manage_access": "Manage Access",
|
|
678
|
+
"owners": "Owners",
|
|
679
|
+
"guest": "Guest",
|
|
680
|
+
"no_guest": "No guest",
|
|
681
|
+
"guest_info": "Guest Information",
|
|
682
|
+
"eoh_account_id": "EoH account ID",
|
|
683
|
+
"access_schedule": "Access Schedule",
|
|
684
|
+
"always": "Always",
|
|
685
|
+
"recurring": "Recurring",
|
|
686
|
+
"temporary": "Temporary",
|
|
687
|
+
"set_time": "Set time",
|
|
688
|
+
"set_date_time": "Set date and time",
|
|
689
|
+
"start": "Start",
|
|
690
|
+
"end": "End",
|
|
691
|
+
"repeat": "Repeat",
|
|
692
|
+
"add_action": "Add action",
|
|
667
693
|
"connecting_your_gateway": "Connecting your gateway",
|
|
668
694
|
"general_trading_conditions": "General Trading Conditions",
|
|
669
695
|
"station_name": "Station name",
|
|
@@ -678,10 +704,33 @@
|
|
|
678
704
|
"device_info": "Device Info",
|
|
679
705
|
"battery": "Battery capacity",
|
|
680
706
|
"voltage": "Voltage",
|
|
707
|
+
"how_to_start": "How to start",
|
|
681
708
|
"temperature": "Temperature",
|
|
682
709
|
"rssi_board": "RSSI Board",
|
|
710
|
+
"tap_to_run": "Tap to run",
|
|
683
711
|
"request_fail": "Request fail",
|
|
684
712
|
"modbus_fail": "Modbus failrate",
|
|
685
713
|
"rssi_node": "RSSI Node",
|
|
714
|
+
"edit_actions_list": "Edit Actions List",
|
|
715
|
+
"des_edit_actions_list": "Click on the order number to rearrange automatic order",
|
|
716
|
+
"please_add_your_phone_number_and_chip_name": "Please add your phone number and chip name",
|
|
717
|
+
"phone_number_of_data_sim": "Phone number of data sim",
|
|
718
|
+
"select_a_sub_unit": "Select a sub-unit that you want to add this gateway",
|
|
719
|
+
"all_camera": "All Cameras",
|
|
720
|
+
"gateway_name": "Gateway name",
|
|
721
|
+
"activated_time": "Activated {time}",
|
|
722
|
+
"activated_successfully": "Activated successfully.",
|
|
723
|
+
"activation_failed": "Activation failed.",
|
|
724
|
+
"set_hour": "Set hour",
|
|
725
|
+
"sync_lg_device": "Sync LG device",
|
|
726
|
+
"lg_sync_failed": "Sync LG device failed!",
|
|
727
|
+
"lg_sync_success": "Sync LG device success!",
|
|
728
|
+
"setting_at": "Setting at",
|
|
729
|
+
"name_your_button": "Name your button",
|
|
730
|
+
"continue": "Continue",
|
|
731
|
+
"tap_to_run": "Tap to run",
|
|
732
|
+
"how_to_start": "How to start",
|
|
733
|
+
"actions_list": "Actions list",
|
|
734
|
+
"go_to_automate_scripts": "Go to automate scripts",
|
|
686
735
|
"error_please_try_later": "Error! Please try later"
|
|
687
736
|
}
|
|
@@ -32,12 +32,16 @@
|
|
|
32
32
|
"today": "Today",
|
|
33
33
|
"yesterday": "Yesterday",
|
|
34
34
|
"at": "lúc",
|
|
35
|
+
"playback_camera": "Phát lại Camera",
|
|
35
36
|
"Yesterday": "Hôm qua",
|
|
36
37
|
"text_of_us": "của chúng tôi.",
|
|
37
38
|
"replace_now": "Thay lõi ngay",
|
|
38
39
|
"machine_status": "Trạng thái máy",
|
|
39
40
|
"tank_working_normally": "Máy lọc hoạt động bình thường.",
|
|
40
41
|
"filters": "Lõi lọc",
|
|
42
|
+
"launch_one_tap": "Khởi chạy một lần chạm",
|
|
43
|
+
"des_launch_one_tap": "Tạo nút nhanh trên trang tổng quan",
|
|
44
|
+
"active_list": "Danh sách hành động",
|
|
41
45
|
"filtering": "Đang sục rửa",
|
|
42
46
|
"insufficient_water_input": "Thiếu nước đầu vào.",
|
|
43
47
|
"check_water_leak": "Kiểm tra rò rỉ nước.",
|
|
@@ -49,6 +53,7 @@
|
|
|
49
53
|
"auth_already_have_an_account": "Bạn đã có tài khoản? ",
|
|
50
54
|
"tds_infomation": "Chỉ số TDS",
|
|
51
55
|
"what_is_tds_title": "TDS là gì?",
|
|
56
|
+
"add_action": "Thêm hành động",
|
|
52
57
|
"what_is_tds_text": "TDS là tổng chất rắn hoà tan tồn tại trong một lượng nước nhất định - (tổng số các ion mang điện tích, bao gồm muối, khoáng chất hoặc kim loại) tồn tại trong một thể tích nước nhất định. TDS cao cũng là nguyên nhân gây ra độ đục và trầm tích trong nước. TDS được biểu thị bằng đơn vị mg/L hoặc ppm (parts per million - phần triệu).",
|
|
53
58
|
"tds_guidlines_title": "Chỉ số TDS cho nước uống",
|
|
54
59
|
"tds_guidlines_text_1": "Lý tưởng nhất, TDS cho nước uống phải dưới 300mg/lít và giới hạn tối đa được coi là an toàn là 500mg/lít. Với các nguồn nước có TDS < 50ppm thường là nước ở mức khá tinh khiết hoặc nước sau khi lọc qua hệ thống RO - đây là nước có chứa lượng khoáng nhỏ và hoàn toàn yên tâm để sử dụng uống trực tiếp.",
|
|
@@ -60,6 +65,8 @@
|
|
|
60
65
|
"verify": "Xác nhận",
|
|
61
66
|
"text_new_unit": "Địa điểm",
|
|
62
67
|
"text_sub_units": "Khu vực",
|
|
68
|
+
"edit_actions_list": "Chỉnh sửa danh sách hành động",
|
|
69
|
+
"des_edit_actions_list": "Click on the order number to rearrange automatic order",
|
|
63
70
|
"sub_unit": "Khu vực",
|
|
64
71
|
"sub_units": "Khu vực",
|
|
65
72
|
"device": "Thiết bị",
|
|
@@ -108,7 +115,7 @@
|
|
|
108
115
|
"Today": "Hôm nay",
|
|
109
116
|
"last_updated_%{minutes}_minutes_ago": "Cập nhật lần cuối %{minutes} phút trước",
|
|
110
117
|
"Last %{days} ago": "%{days} ngày qua",
|
|
111
|
-
"Welcome
|
|
118
|
+
"Welcome {name}": "Chào mừng đến {name}",
|
|
112
119
|
"devices": "thiết bị",
|
|
113
120
|
"text_no_units": "Chưa có địa điểm. Nhấn + để tạo địa điểm đầu tiên.",
|
|
114
121
|
"text_last_7_days": "7 ngày qua",
|
|
@@ -337,6 +344,8 @@
|
|
|
337
344
|
"text_remove_sub_unit_success": "Xóa khu vực thành công!",
|
|
338
345
|
"text_remove_sub_unit_fail": "Xóa khu vực thất bại!",
|
|
339
346
|
"camera": "Camera",
|
|
347
|
+
"favorites": "Yêu thích",
|
|
348
|
+
"add_to_favorites": "Thêm vào yêu thích",
|
|
340
349
|
"add_new_device": "Thêm thiết bị",
|
|
341
350
|
"add_new_device_message_no_unit": "Để thêm thiết bị mới, trước tiên bạn cần tạo một địa điểm.",
|
|
342
351
|
"add_member": "Thêm thành viên",
|
|
@@ -593,7 +602,9 @@
|
|
|
593
602
|
"emergency_alert": "Khẩn cấp!",
|
|
594
603
|
"the_emergency_button_has_been_activated": "Nút cảnh báo khẩn cấp vừa được kích hoạt tại địa điểm ",
|
|
595
604
|
"seconds_ago": "giây trước",
|
|
605
|
+
"secs_ago": "giây trước",
|
|
596
606
|
"minutes_ago": "phút trước",
|
|
607
|
+
"mins_ago": "phút trước",
|
|
597
608
|
"hours_ago": "giờ trước",
|
|
598
609
|
"days_ago": "ngày trước",
|
|
599
610
|
"months_ago": "tháng trước",
|
|
@@ -660,6 +671,21 @@
|
|
|
660
671
|
"add_new_gateway": "Thêm gateway",
|
|
661
672
|
"chip_name": "Tên chip",
|
|
662
673
|
"connecting_your_gateway": "Đang kết nối gateway...",
|
|
674
|
+
"manage_access": "Quản lý quyền truy cập",
|
|
675
|
+
"owners": "Chủ sỡ hữu",
|
|
676
|
+
"guest": "Khách",
|
|
677
|
+
"no_guest": "Không có vị khách nào",
|
|
678
|
+
"guest_info": "Thông tin khách",
|
|
679
|
+
"eoh_account_id": "ID tài khoản EoH",
|
|
680
|
+
"access_schedule": "Lịch truy cập",
|
|
681
|
+
"always": "Luôn luôn",
|
|
682
|
+
"recurring": "Tuần hoàn",
|
|
683
|
+
"temporary": "Tạm thời",
|
|
684
|
+
"set_time": "Chọn thời gian",
|
|
685
|
+
"set_date_time": "Chọn ngày và thời gian",
|
|
686
|
+
"start": "Bắt đầu",
|
|
687
|
+
"end": "Kết thúc",
|
|
688
|
+
"repeat": "Lặp lại",
|
|
663
689
|
"please_select_a_wifi_network": "Vui lòng chọn mạng Wi-Fi và nhập mật khẩu",
|
|
664
690
|
"wifi_name": "Tên Wi-Fi",
|
|
665
691
|
"password": "Mật khẩu",
|
|
@@ -673,6 +699,7 @@
|
|
|
673
699
|
"station_name": "Tên station",
|
|
674
700
|
"unit_name": "Tên địa điểm",
|
|
675
701
|
"location": "Vị trí",
|
|
702
|
+
"tap_to_run": "Nhấn để chạy",
|
|
676
703
|
"manage_sub_units": "Quản lý khu vực",
|
|
677
704
|
"unit_wallpaper": "Hình nền địa điểm",
|
|
678
705
|
"tap_to_change": "Nhấn để thay đổi",
|
|
@@ -682,9 +709,29 @@
|
|
|
682
709
|
"battery": "Dung lượng pin",
|
|
683
710
|
"voltage": "Điện áp",
|
|
684
711
|
"temperature": "Nhiệt độ",
|
|
712
|
+
"how_to_start": "Cách bắt đầu",
|
|
685
713
|
"rssi_board": "RSSI Board",
|
|
686
714
|
"request_fail": "Request fail",
|
|
687
715
|
"modbus_fail": "Modbus failrate",
|
|
688
716
|
"rssi_node": "RSSI Node",
|
|
717
|
+
"please_add_your_phone_number_and_chip_name": "Vui lòng thêm số điện thoại và tên chip của bạn",
|
|
718
|
+
"phone_number_of_data_sim": "Số điện thoại của dữ liệu sim",
|
|
719
|
+
"select_a_sub_unit": "Lựa chọn một khu vực mà bạn muốn thêm gateway",
|
|
720
|
+
"all_camera": "All Cameras",
|
|
721
|
+
"gateway_name": "Tên Gateway",
|
|
722
|
+
"activated_time": "Đã kích hoạt {time}",
|
|
723
|
+
"activated_successfully": "Đã kích hoạt thành công.",
|
|
724
|
+
"activation_failed": "Kích hoạt đã thất bại.",
|
|
725
|
+
"set_hour": "Đặt giờ",
|
|
726
|
+
"sync_lg_device": "Đồng bộ thiết bị LG",
|
|
727
|
+
"lg_sync_failed": "Đồng bộ thiết bị LG thất bại!",
|
|
728
|
+
"lg_sync_success": "Đồng bộ thiết bị LG thành công!",
|
|
729
|
+
"setting_at": "Thiết lập tại",
|
|
730
|
+
"name_your_button": "Đặt tên cho nút nhấn của bạn",
|
|
731
|
+
"continue": "Tiếp tục",
|
|
732
|
+
"tap_to_run": "Nhấn để chạy",
|
|
733
|
+
"how_to_start": "Cách khởi động",
|
|
734
|
+
"actions_list": "Dánh sách hành động",
|
|
735
|
+
"go_to_automate_scripts": "Đi đến kịch bản tự động",
|
|
689
736
|
"error_please_try_later": "Lỗi! Vui lòng thử lại sau"
|
|
690
737
|
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import MessageFormat from '@messageformat/core';
|
|
2
|
+
|
|
3
|
+
import en from './translations/en.json';
|
|
4
|
+
import vi from './translations/vi.json';
|
|
5
|
+
|
|
6
|
+
export type TranslationString = keyof typeof en;
|
|
7
|
+
export type Language = 'en' | 'vi';
|
|
8
|
+
|
|
9
|
+
const res = {
|
|
10
|
+
en,
|
|
11
|
+
vi,
|
|
12
|
+
};
|
|
13
|
+
export type InterPolateString = {
|
|
14
|
+
[name: string]: string;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const formatMess = new MessageFormat('en');
|
|
18
|
+
|
|
19
|
+
const formatMessage = (message: string, interpolateStr: InterPolateString) => {
|
|
20
|
+
try {
|
|
21
|
+
const compiledMsg = formatMess.compile(message);
|
|
22
|
+
return compiledMsg(interpolateStr);
|
|
23
|
+
} catch {
|
|
24
|
+
return message;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const getTranslate = (
|
|
29
|
+
language: Language,
|
|
30
|
+
key: TranslationString,
|
|
31
|
+
interpolateStr?: InterPolateString
|
|
32
|
+
) => {
|
|
33
|
+
// @ts-ignore
|
|
34
|
+
if (!res[language][key]) {
|
|
35
|
+
return key;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (!interpolateStr) {
|
|
39
|
+
// @ts-ignore
|
|
40
|
+
return res[language][key];
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// @ts-ignore
|
|
44
|
+
return formatMessage(res[language][key], interpolateStr);
|
|
45
|
+
};
|
package/src/utils/Route/index.js
CHANGED
|
@@ -52,6 +52,7 @@ const Routes = {
|
|
|
52
52
|
DashboardStack: 'DashboardStack',
|
|
53
53
|
AddSubUnit: 'AddSubUnit',
|
|
54
54
|
AddCommonSelectUnit: 'AddCommonSelectUnit',
|
|
55
|
+
AddCommonSelectSubUnit: 'AddCommonSelectSubUnit',
|
|
55
56
|
UnitMemberList: 'UnitMemberList',
|
|
56
57
|
SharingSelectPermission: 'SharingSelectPermission',
|
|
57
58
|
SharingInviteMembers: 'SharingInviteMembers',
|
|
@@ -92,8 +93,18 @@ const Routes = {
|
|
|
92
93
|
EmergencyContactsSelectContacts: 'EmergencyContactsSelectContacts',
|
|
93
94
|
TermAndPolicy: 'TermAndPolicy',
|
|
94
95
|
Browser: 'Browser',
|
|
96
|
+
ManageAccess: 'ManageAccess',
|
|
97
|
+
AddNewActionStack: 'AddNewActionStack',
|
|
98
|
+
SelectDevice: 'SelectDevice',
|
|
99
|
+
GuestInfo: 'GuestInfo',
|
|
95
100
|
AddLGDevice: 'AddLGDevice',
|
|
96
101
|
AddLGDeviceStack: 'AddLGDeviceStack',
|
|
102
|
+
ScriptDetail: 'TapTuRun',
|
|
103
|
+
EditActionsList: 'EditActionsList',
|
|
104
|
+
PlaybackCamera: 'PlaybackCamera',
|
|
105
|
+
AllCamera: 'AllCamera',
|
|
106
|
+
AddNewOneTap: 'AddNewOneTap',
|
|
107
|
+
AddNewScriptAction: 'AddNewScriptAction',
|
|
97
108
|
};
|
|
98
109
|
|
|
99
110
|
export default Routes;
|
package/src/utils/I18n/index.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import i18n from 'i18n-js';
|
|
2
|
-
|
|
3
|
-
export const translations = {
|
|
4
|
-
en: require('./translations/en.json'),
|
|
5
|
-
vi: require('./translations/vi.json'),
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export const updateTranslation = (langTranslate) => {
|
|
9
|
-
i18n.translations = {
|
|
10
|
-
en: { ...translations.en, ...langTranslate.en },
|
|
11
|
-
vi: { ...translations.vi, ...langTranslate.vi },
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export const setLanguage = (language) => {
|
|
16
|
-
i18n.locale = language;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export default (key, config) => i18n.translate(key, config);
|