Skip to content

Commit

Permalink
lots of modifications for localization
Browse files Browse the repository at this point in the history
  • Loading branch information
jp112sdl committed Jul 5, 2018
1 parent 6902fb5 commit 6f2d38f
Show file tree
Hide file tree
Showing 9 changed files with 286 additions and 42 deletions.
14 changes: 7 additions & 7 deletions src/addon/firmware/rftypes/hb-uni-sen-wea.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<logical type="integer" min="10" max="3600" default="60" unit="s" />
<physical type="integer" interface="config" list="0" index="32" size="2" />
</parameter>
<parameter id="Altitude">
<parameter id="HBWEA_ALTITUDE">
<logical type="integer" min="0" max="10000" default="0" unit="m" />
<physical type="integer" interface="config" list="0" index="34" size="2" />
</parameter>
Expand Down Expand Up @@ -54,25 +54,25 @@
<source name="WEATHER_TH" />
</link_roles>
<paramset type="MASTER" id="HB-UNI-Sen-WEA_master">
<parameter id="Anemometer Radius (cm)">
<logical type="float" min="0" max="25.5" unit="" default="6.5" />
<parameter id="ANEMOMETER_RADIUS">
<logical type="float" min="0" max="25.5" unit="cm" default="6.5" />
<physical type="integer" interface="config" list="1" index="1.0" size="1" />
<conversion type="float_integer_scale" factor="10.0" />
</parameter>
<parameter id="Anemometer Calibration Factor">
<parameter id="ANEMOMETER_CALIBRATION_FACTOR">
<logical type="float" min="0" max="1000.0" unit="" default="1.0" />
<physical type="integer" interface="config" list="1" index="2.0" size="2" />
<conversion type="float_integer_scale" factor="10.0" />
</parameter>
<parameter id="Lightning Detector Capacitor">
<parameter id="LD_CAPACITOR">
<logical type="integer" min="0" max="120" default="80" unit="pF" />
<physical type="integer" interface="config" list="1" index="4.0" size="1" />
</parameter>
<parameter id="Lightning Detector Disturber Detection">
<parameter id="LD_DISTURBER_DETECTION">
<logical type="boolean" default="false"/>
<physical type="integer" interface="config" list="1" index="5.0" size="1"/>
</parameter>
<parameter id="Send Extra Message On Gust Threshold">
<parameter id="GUST_THRESHOLD_EXTRA_MESSAGE">
<logical type="integer" min="0" max="255" unit="km/h" default="0" />
<physical type="integer" interface="config" list="1" index="6.0" size="1" />
</parameter>
Expand Down
20 changes: 15 additions & 5 deletions src/addon/install_hb-uni-sen-dist-us
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ fi

### Edit webui.js ###
webuiFile="/www/webui/webui.js"
webuiSearch="DEV_HIGHLIGHT[[:space:]]*=[[:space:]]*new Array();"

webuiSearchBegin="DEV_HIGHLIGHT[[:space:]]*=[[:space:]]*new Array();"
webuiInsert="\n"
webuiInsert="${webuiInsert}DEV_HIGHLIGHT['$DEVICE'] = new Object();\n"
webuiInsert="${webuiInsert}DEV_LIST.push('$DEVICE');\n"
Expand All @@ -28,11 +28,22 @@ webuiInsert="${webuiInsert}DEV_PATHS['$DEVICE']['50'] = '\/config\/img\/devices\
webuiInsert="${webuiInsert}DEV_PATHS['$DEVICE']['250'] = '\/config\/img\/devices\/250\/$DEVICE_IMG';"

if [ -z "`cat $webuiFile | grep \"$DEVICE\"`" ]; then
sed -i "s/\($webuiSearch\)/\1$webuiInsert/g" $webuiFile
sed -i "s/\($webuiSearchBegin\)/\1$webuiInsert/g" $webuiFile
fi

webuiSearchBegin="elvST[[:space:]]*=[[:space:]]*new Array();"

webuiInsertParam="HB_GENERIC_DIST|DISTANCE_OFFSET"
webuiInsertValue="stringTableHbGenericDistDistanceOffset"
webuiInsert="\n"
webuiInsert="${webuiInsert}elvST['$webuiInsertParam'] = '\${$webuiInsertValue}';"
if [ -z "`cat $webuiFile | grep \"$webuiInsertParam\"`" ]; then
sed -i "s/\($webuiSearchBegin\)/\1$webuiInsert/g" $webuiFile
fi

### Edit stringtable_de.txt ###
stringtable_deFile="/www/config/stringtable_de.txt"

stringtable_deInsert="HB_GENERIC_DIST|DISTANCE \${stringTableHbGenericDistDistance} \n"
if [ -z "`cat $stringtable_deFile | grep \"HB_GENERIC_DIST|DISTANCE"`" ]; then
sed -i "1s/^/\1$stringtable_deInsert/" $stringtable_deFile
Expand All @@ -51,18 +62,17 @@ fi
### Edit translate.lang.stringtable.js ###
translate_deFile="/www/webui/js/lang/de/translate.lang.stringtable.js"
translate_deSearch="\"dummy\" : \"\","
translate_deInsert="\n \"stringTableHbGenericDistDistance\" : \"Abstand\","
if [ -z "`cat $translate_deFile | grep \"stringTableHbGenericDistDistance\"`" ]; then
sed -i "s/\($translate_deSearch\)/\1$translate_deInsert/g" $translate_deFile
fi
translate_deSearch="\"dummy\" : \"\","
translate_deInsert="\n \"stringTableHbGenericDistDistanceOffset\" : \"Sensor Offset\","
translate_deInsert="\n \"stringTableHbGenericDistDistanceOffset\" : \"Ultraschallsensor Abstand Offset\","
if [ -z "`cat $translate_deFile | grep \"stringTableHbGenericDistDistanceOffset\"`" ]; then
sed -i "s/\($translate_deSearch\)/\1$translate_deInsert/g" $translate_deFile
fi
translate_deSearch="\"dummy\" : \"\","
translate_deInsert="\n \"stringTableHbGenericDistBatteryVoltage\" : \"Batteriespannung\","
if [ -z "`cat $translate_deFile | grep \"stringTableHbGenericDistBatteryVoltage\"`" ]; then
sed -i "s/\($translate_deSearch\)/\1$translate_deInsert/g" $translate_deFile
Expand Down
19 changes: 14 additions & 5 deletions src/addon/install_hb-uni-sen-lev-us
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ fi

### Edit webui.js ###
webuiFile="/www/webui/webui.js"
webuiSearch="DEV_HIGHLIGHT[[:space:]]*=[[:space:]]*new Array();"

webuiSearchBegin="DEV_HIGHLIGHT[[:space:]]*=[[:space:]]*new Array();"
webuiInsert="\n"
webuiInsert="${webuiInsert}DEV_HIGHLIGHT['$DEVICE'] = new Object();\n"
webuiInsert="${webuiInsert}DEV_LIST.push('$DEVICE');\n"
Expand All @@ -28,7 +28,17 @@ webuiInsert="${webuiInsert}DEV_PATHS['$DEVICE']['50'] = '\/config\/img\/devices\
webuiInsert="${webuiInsert}DEV_PATHS['$DEVICE']['250'] = '\/config\/img\/devices\/250\/$DEVICE_IMG';"

if [ -z "`cat $webuiFile | grep \"$DEVICE\"`" ]; then
sed -i "s/\($webuiSearch\)/\1$webuiInsert/g" $webuiFile
sed -i "s/\($webuiSearchBegin\)/\1$webuiInsert/g" $webuiFile
fi

webuiSearchBegin="elvST[[:space:]]*=[[:space:]]*new Array();"

webuiInsertParam="CAPACITIVE_FILLING_LEVEL_SENSOR|DISTANCE_OFFSET"
webuiInsertValue="stringTableCapacitiveFillingSensorDistanceOffset"
webuiInsert="\n"
webuiInsert="${webuiInsert}elvST['$webuiInsertParam'] = '\${$webuiInsertValue}';"
if [ -z "`cat $webuiFile | grep \"$webuiInsertParam\"`" ]; then
sed -i "s/\($webuiSearchBegin\)/\1$webuiInsert/g" $webuiFile
fi

### Edit stringtable_de.txt ###
Expand All @@ -45,15 +55,14 @@ if [ -z "`cat $stringtable_deFile | grep \"CAPACITIVE_FILLING_LEVEL_SENSOR|DISTA
fi
### Edit translate.lang.stringtable.js ###
translate_deFile="/www/webui/js/lang/de/translate.lang.stringtable.js"

translate_deSearch="\"dummy\" : \"\","

translate_deInsert="\n \"stringTableCapacitiveFillingSensorBatteryVoltage\" : \"Batteriespannung\","
if [ -z "`cat $translate_deFile | grep \"stringTableCapacitiveFillingSensorBatteryVoltage\"`" ]; then
sed -i "s/\($translate_deSearch\)/\1$translate_deInsert/g" $translate_deFile
fi

translate_deSearch="\"dummy\" : \"\","
translate_deInsert="\n \"stringTableCapacitiveFillingSensorDistanceOffset\" : \"Sensor Offset\","
translate_deInsert="\n \"stringTableCapacitiveFillingSensorDistanceOffset\" : \"Ultraschallsensor Abstand Offset\","
if [ -z "`cat $translate_deFile | grep \"stringTableCapacitiveFillingSensorDistanceOffset\"`" ]; then
sed -i "s/\($translate_deSearch\)/\1$translate_deInsert/g" $translate_deFile
fi
52 changes: 48 additions & 4 deletions src/addon/install_hb-uni-sen-press
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ fi

### Edit webui.js ###
webuiFile="/www/webui/webui.js"
webuiSearch="DEV_HIGHLIGHT[[:space:]]*=[[:space:]]*new Array();"

webuiSearchBegin="DEV_HIGHLIGHT[[:space:]]*=[[:space:]]*new Array();"
webuiInsert="\n"
webuiInsert="${webuiInsert}DEV_HIGHLIGHT['$DEVICE'] = new Object();\n"
webuiInsert="${webuiInsert}DEV_LIST.push('$DEVICE');\n"
Expand All @@ -29,7 +29,17 @@ webuiInsert="${webuiInsert}DEV_PATHS['$DEVICE']['50'] = '\/config\/img\/devices\
webuiInsert="${webuiInsert}DEV_PATHS['$DEVICE']['250'] = '\/config\/img\/devices\/250\/$DEVICE_IMG';"

if [ -z "`cat $webuiFile | grep \"$DEVICE\"`" ]; then
sed -i "s/\($webuiSearch\)/\1$webuiInsert/g" $webuiFile
sed -i "s/\($webuiSearchBegin\)/\1$webuiInsert/g" $webuiFile
fi

webuiSearchBegin="elvST[[:space:]]*=[[:space:]]*new Array();"

webuiInsertParam="GENERIC|Sensortyp"
webuiInsertValue="stringTableHbGenericSensortyp"
webuiInsert="\n"
webuiInsert="${webuiInsert}elvST['$webuiInsertParam'] = '\${$webuiInsertValue}';"
if [ -z "`cat $webuiFile | grep \"$webuiInsertParam\"`" ]; then
sed -i "s/\($webuiSearchBegin\)/\1$webuiInsert/g" $webuiFile
fi

DEVICE="HB-UNI-Sen-PRESS-SC"
Expand All @@ -49,8 +59,8 @@ fi

### Edit webui.js ###
webuiFile="/www/webui/webui.js"
webuiSearch="DEV_HIGHLIGHT[[:space:]]*=[[:space:]]*new Array();"

webuiSearchBegin="DEV_HIGHLIGHT[[:space:]]*=[[:space:]]*new Array();"
webuiInsert="\n"
webuiInsert="${webuiInsert}DEV_HIGHLIGHT['$DEVICE'] = new Object();\n"
webuiInsert="${webuiInsert}DEV_LIST.push('$DEVICE');\n"
Expand All @@ -60,7 +70,25 @@ webuiInsert="${webuiInsert}DEV_PATHS['$DEVICE']['50'] = '\/config\/img\/devices\
webuiInsert="${webuiInsert}DEV_PATHS['$DEVICE']['250'] = '\/config\/img\/devices\/250\/$DEVICE_IMG';"

if [ -z "`cat $webuiFile | grep \"$DEVICE\"`" ]; then
sed -i "s/\($webuiSearch\)/\1$webuiInsert/g" $webuiFile
sed -i "s/\($webuiSearchBegin\)/\1$webuiInsert/g" $webuiFile
fi

webuiSearchBegin="elvST[[:space:]]*=[[:space:]]*new Array();"

webuiInsertParam="GENERIC|Schaltschwelle"
webuiInsertValue="stringTableHbGenericSchaltschwelle"
webuiInsert="\n"
webuiInsert="${webuiInsert}elvST['$webuiInsertParam'] = '\${$webuiInsertValue}';"
if [ -z "`cat $webuiFile | grep \"$webuiInsertParam\"`" ]; then
sed -i "s/\($webuiSearchBegin\)/\1$webuiInsert/g" $webuiFile
fi

webuiInsertParam="GENERIC|Hysterese"
webuiInsertValue="stringTableHbGenericHysterese"
webuiInsert="\n"
webuiInsert="${webuiInsert}elvST['$webuiInsertParam'] = '\${$webuiInsertValue}';"
if [ -z "`cat $webuiFile | grep \"$webuiInsertParam\"`" ]; then
sed -i "s/\($webuiSearchBegin\)/\1$webuiInsert/g" $webuiFile
fi

### Edit stringtable_de.txt ###
Expand All @@ -73,7 +101,23 @@ fi
### Edit translate.lang.stringtable.js ###
translate_deFile="/www/webui/js/lang/de/translate.lang.stringtable.js"
translate_deSearch="\"dummy\" : \"\","
translate_deInsert="\n \"stringTableUniPressure\" : \"Druck\","
if [ -z "`cat $translate_deFile | grep \"stringTableUniPressure\"`" ]; then
sed -i "s/\($translate_deSearch\)/\1$translate_deInsert/g" $translate_deFile
fi
translate_deInsert="\n \"stringTableHbGenericSensortyp\" : \"Sensortyp\","
if [ -z "`cat $translate_deFile | grep \"stringTableHbGenericSensortyp\"`" ]; then
sed -i "s/\($translate_deSearch\)/\1$translate_deInsert/g" $translate_deFile
fi
translate_deInsert="\n \"stringTableHbGenericSchaltschwelle\" : \"Schaltschwelle\","
if [ -z "`cat $translate_deFile | grep \"stringTableHbGenericSchaltschwelle\"`" ]; then
sed -i "s/\($translate_deSearch\)/\1$translate_deInsert/g" $translate_deFile
fi
translate_deInsert="\n \"stringTableHbGenericHysterese\" : \"Hysterese\","
if [ -z "`cat $translate_deFile | grep \"stringTableHbGenericHysterese\"`" ]; then
sed -i "s/\($translate_deSearch\)/\1$translate_deInsert/g" $translate_deFile
fi
Loading

0 comments on commit 6f2d38f

Please sign in to comment.