@trackunit/translations-machine-type 0.0.108 → 0.0.110

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 CHANGED
@@ -628,11 +628,12 @@ const setupLibraryTranslations = () => {
628
628
  /**
629
629
  * This function is used to translate the insight names.
630
630
  *
631
- * @returns {(key: string, fallbackValue?: string) => string)} A function that takes a key and returns the translated value.
631
+ * @returns {ReturnType<useMachineInsightsTranslations>} A function that takes a key and returns the translated value.
632
632
  */
633
633
  const useMachineInsightsTranslations = () => {
634
634
  const [t] = useTranslation();
635
635
  const getInsightOptionText = (key, fallbackValue) => {
636
+ // eslint-disable-next-line sonarjs/max-switch-cases
636
637
  switch (key) {
637
638
  case "ACAVERAGEFREQUENCY":
638
639
  case "AC_AVERAGE_FREQUENCY":
@@ -1005,6 +1006,7 @@ const useMachineInsightsTranslations = () => {
1005
1006
  }
1006
1007
  };
1007
1008
  const getInsightUnitText = (key) => {
1009
+ // eslint-disable-next-line sonarjs/max-switch-cases
1008
1010
  switch (key) {
1009
1011
  case "AMPERE":
1010
1012
  return t("pages.machines.insights.sections.insights.units.AMPERE");
@@ -1085,8 +1087,6 @@ const useMachineInsightsTranslations = () => {
1085
1087
  return t("pages.machines.insights.sections.insights.units.YARD");
1086
1088
  case "ENUMERATION":
1087
1089
  return "";
1088
- case "YARD":
1089
- return t("pages.machines.insights.sections.insights.units.YARD");
1090
1090
  default:
1091
1091
  // keys are user defined, so just let them go through without translation
1092
1092
  if (key) {
@@ -1098,6 +1098,7 @@ const useMachineInsightsTranslations = () => {
1098
1098
  const getInsightSubType = (type, subtype) => {
1099
1099
  switch (type) {
1100
1100
  case "AFTERTREATMENTDIESELPARTICULATEFILTERACTIVEREGENERATIONSTATE":
1101
+ // eslint-disable-next-line sonarjs/no-nested-switch
1101
1102
  switch (subtype) {
1102
1103
  case "ACTIVE":
1103
1104
  return t("pages.machines.insights.sections.insights.insightNames.AFTERTREATMENTDIESELPARTICULATEFILTERACTIVEREGENERATIONSTATE.ACTIVE");
@@ -1109,6 +1110,7 @@ const useMachineInsightsTranslations = () => {
1109
1110
  return t("pages.machines.insights.sections.insights.insightNames.unknown");
1110
1111
  }
1111
1112
  case "AFTERTREATMENTDIESELPARTICULATEFILTERSTATE":
1113
+ // eslint-disable-next-line sonarjs/no-nested-switch
1112
1114
  switch (subtype) {
1113
1115
  case "REGENERATION_NOT_NEEDED":
1114
1116
  return t("pages.machines.insights.sections.insights.insightNames.AFTERTREATMENTDIESELPARTICULATEFILTERSTATE.REGENERATION_NOT_NEEDED");
@@ -1145,6 +1147,7 @@ const useMachineInsightsTranslations = () => {
1145
1147
  const useMachineTypeTranslations = () => {
1146
1148
  const [t] = useTranslation();
1147
1149
  const getMachineTypeTranslation = react.useCallback((type) => {
1150
+ // eslint-disable-next-line sonarjs/max-switch-cases
1148
1151
  switch (type) {
1149
1152
  case null:
1150
1153
  case "null":
@@ -1894,6 +1897,7 @@ const useMachineTypeTranslations = () => {
1894
1897
  case "Wellpoint Pump":
1895
1898
  return t("machine.types.Wellpoint Pump");
1896
1899
  default:
1900
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
1897
1901
  return `${type === undefined ? t("machine.types.UNDEFINED") : type}`;
1898
1902
  }
1899
1903
  }, [t]);
package/index.esm.js CHANGED
@@ -624,11 +624,12 @@ const setupLibraryTranslations = () => {
624
624
  /**
625
625
  * This function is used to translate the insight names.
626
626
  *
627
- * @returns {(key: string, fallbackValue?: string) => string)} A function that takes a key and returns the translated value.
627
+ * @returns {ReturnType<useMachineInsightsTranslations>} A function that takes a key and returns the translated value.
628
628
  */
629
629
  const useMachineInsightsTranslations = () => {
630
630
  const [t] = useTranslation();
631
631
  const getInsightOptionText = (key, fallbackValue) => {
632
+ // eslint-disable-next-line sonarjs/max-switch-cases
632
633
  switch (key) {
633
634
  case "ACAVERAGEFREQUENCY":
634
635
  case "AC_AVERAGE_FREQUENCY":
@@ -1001,6 +1002,7 @@ const useMachineInsightsTranslations = () => {
1001
1002
  }
1002
1003
  };
1003
1004
  const getInsightUnitText = (key) => {
1005
+ // eslint-disable-next-line sonarjs/max-switch-cases
1004
1006
  switch (key) {
1005
1007
  case "AMPERE":
1006
1008
  return t("pages.machines.insights.sections.insights.units.AMPERE");
@@ -1081,8 +1083,6 @@ const useMachineInsightsTranslations = () => {
1081
1083
  return t("pages.machines.insights.sections.insights.units.YARD");
1082
1084
  case "ENUMERATION":
1083
1085
  return "";
1084
- case "YARD":
1085
- return t("pages.machines.insights.sections.insights.units.YARD");
1086
1086
  default:
1087
1087
  // keys are user defined, so just let them go through without translation
1088
1088
  if (key) {
@@ -1094,6 +1094,7 @@ const useMachineInsightsTranslations = () => {
1094
1094
  const getInsightSubType = (type, subtype) => {
1095
1095
  switch (type) {
1096
1096
  case "AFTERTREATMENTDIESELPARTICULATEFILTERACTIVEREGENERATIONSTATE":
1097
+ // eslint-disable-next-line sonarjs/no-nested-switch
1097
1098
  switch (subtype) {
1098
1099
  case "ACTIVE":
1099
1100
  return t("pages.machines.insights.sections.insights.insightNames.AFTERTREATMENTDIESELPARTICULATEFILTERACTIVEREGENERATIONSTATE.ACTIVE");
@@ -1105,6 +1106,7 @@ const useMachineInsightsTranslations = () => {
1105
1106
  return t("pages.machines.insights.sections.insights.insightNames.unknown");
1106
1107
  }
1107
1108
  case "AFTERTREATMENTDIESELPARTICULATEFILTERSTATE":
1109
+ // eslint-disable-next-line sonarjs/no-nested-switch
1108
1110
  switch (subtype) {
1109
1111
  case "REGENERATION_NOT_NEEDED":
1110
1112
  return t("pages.machines.insights.sections.insights.insightNames.AFTERTREATMENTDIESELPARTICULATEFILTERSTATE.REGENERATION_NOT_NEEDED");
@@ -1141,6 +1143,7 @@ const useMachineInsightsTranslations = () => {
1141
1143
  const useMachineTypeTranslations = () => {
1142
1144
  const [t] = useTranslation();
1143
1145
  const getMachineTypeTranslation = useCallback((type) => {
1146
+ // eslint-disable-next-line sonarjs/max-switch-cases
1144
1147
  switch (type) {
1145
1148
  case null:
1146
1149
  case "null":
@@ -1890,6 +1893,7 @@ const useMachineTypeTranslations = () => {
1890
1893
  case "Wellpoint Pump":
1891
1894
  return t("machine.types.Wellpoint Pump");
1892
1895
  default:
1896
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
1893
1897
  return `${type === undefined ? t("machine.types.UNDEFINED") : type}`;
1894
1898
  }
1895
1899
  }, [t]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/translations-machine-type",
3
- "version": "0.0.108",
3
+ "version": "0.0.110",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * This function is used to translate the insight names.
3
3
  *
4
- * @returns {(key: string, fallbackValue?: string) => string)} A function that takes a key and returns the translated value.
4
+ * @returns {ReturnType<useMachineInsightsTranslations>} A function that takes a key and returns the translated value.
5
5
  */
6
6
  export declare const useMachineInsightsTranslations: () => {
7
7
  getInsightOptionText: (key?: string, fallbackValue?: string) => string;
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
3
  var translation = {
4
- "machine.types.10 KW Generator": "Générateur de 10 kW",
5
- "machine.types.100 KW Generator": "Générateur de 100 kW",
6
- "machine.types.20 KW Generator DSL": "Générateur diesel de 20 kW",
7
- "machine.types.30 KW Generator DSL": "Générateur diesel de 30 kW",
8
- "machine.types.320KW Generator DSL": "Générateur diesel de 320 kW",
9
- "machine.types.40 KW Generator DSL": "Générateur diesel de 40 kW",
10
- "machine.types.55 KW Generator DSL": "Générateur diesel de 55 kW",
4
+ "machine.types.10 KW Generator": "Générateur de 10 kW",
5
+ "machine.types.100 KW Generator": "Générateur de 100 kW",
6
+ "machine.types.20 KW Generator DSL": "Générateur diesel de 20 kW",
7
+ "machine.types.30 KW Generator DSL": "Générateur diesel de 30 kW",
8
+ "machine.types.320KW Generator DSL": "Générateur diesel de 320 kW",
9
+ "machine.types.40 KW Generator DSL": "Générateur diesel de 40 kW",
10
+ "machine.types.55 KW Generator DSL": "Générateur diesel de 55 kW",
11
11
  "machine.types.Agricultural Tractor": "Tracteur agricole",
12
12
  "machine.types.Air Compressor": "Compresseur d'air",
13
13
  "machine.types.Air Conditioner": "Climatiseur",
@@ -1,11 +1,11 @@
1
1
  var translation = {
2
- "machine.types.10 KW Generator": "Générateur de 10 kW",
3
- "machine.types.100 KW Generator": "Générateur de 100 kW",
4
- "machine.types.20 KW Generator DSL": "Générateur diesel de 20 kW",
5
- "machine.types.30 KW Generator DSL": "Générateur diesel de 30 kW",
6
- "machine.types.320KW Generator DSL": "Générateur diesel de 320 kW",
7
- "machine.types.40 KW Generator DSL": "Générateur diesel de 40 kW",
8
- "machine.types.55 KW Generator DSL": "Générateur diesel de 55 kW",
2
+ "machine.types.10 KW Generator": "Générateur de 10 kW",
3
+ "machine.types.100 KW Generator": "Générateur de 100 kW",
4
+ "machine.types.20 KW Generator DSL": "Générateur diesel de 20 kW",
5
+ "machine.types.30 KW Generator DSL": "Générateur diesel de 30 kW",
6
+ "machine.types.320KW Generator DSL": "Générateur diesel de 320 kW",
7
+ "machine.types.40 KW Generator DSL": "Générateur diesel de 40 kW",
8
+ "machine.types.55 KW Generator DSL": "Générateur diesel de 55 kW",
9
9
  "machine.types.Agricultural Tractor": "Tracteur agricole",
10
10
  "machine.types.Air Compressor": "Compresseur d'air",
11
11
  "machine.types.Air Conditioner": "Climatiseur",