@trackunit/translations-machine-type 1.4.34 → 1.4.38
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/index.cjs.js +5 -5
- package/index.esm.js +5 -5
- package/package.json +3 -3
package/index.cjs.js
CHANGED
|
@@ -644,7 +644,7 @@ const setupLibraryTranslations = () => {
|
|
|
644
644
|
*/
|
|
645
645
|
const useMachineInsightsTranslations = () => {
|
|
646
646
|
const [t] = useTranslation();
|
|
647
|
-
const getInsightOptionText = (key, fallbackValue) => {
|
|
647
|
+
const getInsightOptionText = react.useCallback((key, fallbackValue) => {
|
|
648
648
|
switch (key) {
|
|
649
649
|
case "ACAVERAGEFREQUENCY":
|
|
650
650
|
case "ACAVERAGEPHASETONEUTRALRMSVOLTAGE":
|
|
@@ -954,7 +954,7 @@ const useMachineInsightsTranslations = () => {
|
|
|
954
954
|
}
|
|
955
955
|
return t("pages.machines.insights.sections.insights.insightNames.unknown");
|
|
956
956
|
}
|
|
957
|
-
};
|
|
957
|
+
}, [t]);
|
|
958
958
|
const getInsightUnitText = react.useCallback((key) => {
|
|
959
959
|
switch (key) {
|
|
960
960
|
case "DEGREE_ANGLE":
|
|
@@ -1017,7 +1017,7 @@ const useMachineInsightsTranslations = () => {
|
|
|
1017
1017
|
return `${t("pages.machines.insights.sections.insights.units.unknown")}`;
|
|
1018
1018
|
}
|
|
1019
1019
|
}, [t]);
|
|
1020
|
-
const getInsightSubType = (type, subtype) => {
|
|
1020
|
+
const getInsightSubType = react.useCallback((type, subtype) => {
|
|
1021
1021
|
switch (stringTs.replaceAll(type, "_", "")) {
|
|
1022
1022
|
case "AFTERTREATMENTDIESELPARTICULATEFILTERACTIVEREGENERATIONSTATE":
|
|
1023
1023
|
switch (subtype) {
|
|
@@ -1047,8 +1047,8 @@ const useMachineInsightsTranslations = () => {
|
|
|
1047
1047
|
}
|
|
1048
1048
|
return t("pages.machines.insights.sections.insights.insightNames.unknown");
|
|
1049
1049
|
}
|
|
1050
|
-
};
|
|
1051
|
-
return { getInsightOptionText, getInsightUnitText, getInsightSubType };
|
|
1050
|
+
}, [t]);
|
|
1051
|
+
return react.useMemo(() => ({ getInsightOptionText, getInsightUnitText, getInsightSubType }), [getInsightOptionText, getInsightUnitText, getInsightSubType]);
|
|
1052
1052
|
};
|
|
1053
1053
|
|
|
1054
1054
|
/**
|
package/index.esm.js
CHANGED
|
@@ -642,7 +642,7 @@ const setupLibraryTranslations = () => {
|
|
|
642
642
|
*/
|
|
643
643
|
const useMachineInsightsTranslations = () => {
|
|
644
644
|
const [t] = useTranslation();
|
|
645
|
-
const getInsightOptionText = (key, fallbackValue) => {
|
|
645
|
+
const getInsightOptionText = useCallback((key, fallbackValue) => {
|
|
646
646
|
switch (key) {
|
|
647
647
|
case "ACAVERAGEFREQUENCY":
|
|
648
648
|
case "ACAVERAGEPHASETONEUTRALRMSVOLTAGE":
|
|
@@ -952,7 +952,7 @@ const useMachineInsightsTranslations = () => {
|
|
|
952
952
|
}
|
|
953
953
|
return t("pages.machines.insights.sections.insights.insightNames.unknown");
|
|
954
954
|
}
|
|
955
|
-
};
|
|
955
|
+
}, [t]);
|
|
956
956
|
const getInsightUnitText = useCallback((key) => {
|
|
957
957
|
switch (key) {
|
|
958
958
|
case "DEGREE_ANGLE":
|
|
@@ -1015,7 +1015,7 @@ const useMachineInsightsTranslations = () => {
|
|
|
1015
1015
|
return `${t("pages.machines.insights.sections.insights.units.unknown")}`;
|
|
1016
1016
|
}
|
|
1017
1017
|
}, [t]);
|
|
1018
|
-
const getInsightSubType = (type, subtype) => {
|
|
1018
|
+
const getInsightSubType = useCallback((type, subtype) => {
|
|
1019
1019
|
switch (replaceAll(type, "_", "")) {
|
|
1020
1020
|
case "AFTERTREATMENTDIESELPARTICULATEFILTERACTIVEREGENERATIONSTATE":
|
|
1021
1021
|
switch (subtype) {
|
|
@@ -1045,8 +1045,8 @@ const useMachineInsightsTranslations = () => {
|
|
|
1045
1045
|
}
|
|
1046
1046
|
return t("pages.machines.insights.sections.insights.insightNames.unknown");
|
|
1047
1047
|
}
|
|
1048
|
-
};
|
|
1049
|
-
return { getInsightOptionText, getInsightUnitText, getInsightSubType };
|
|
1048
|
+
}, [t]);
|
|
1049
|
+
return useMemo(() => ({ getInsightOptionText, getInsightUnitText, getInsightSubType }), [getInsightOptionText, getInsightUnitText, getInsightSubType]);
|
|
1050
1050
|
};
|
|
1051
1051
|
|
|
1052
1052
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/translations-machine-type",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.38",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"react": "19.0.0",
|
|
11
11
|
"jest-fetch-mock": "^3.0.3",
|
|
12
12
|
"string-ts": "^2.0.0",
|
|
13
|
-
"@trackunit/i18n-library-translation": "1.4.
|
|
14
|
-
"@trackunit/react-test-setup": "1.1.
|
|
13
|
+
"@trackunit/i18n-library-translation": "1.4.36",
|
|
14
|
+
"@trackunit/react-test-setup": "1.1.28"
|
|
15
15
|
},
|
|
16
16
|
"module": "./index.esm.js",
|
|
17
17
|
"main": "./index.cjs.js",
|