gps i18n support

10.3.x-maintenance
cTn 2014-05-08 10:56:41 +02:00
parent aaacf6cea8
commit c6efcf1850
3 changed files with 50 additions and 13 deletions

View File

@ -366,5 +366,42 @@
}, },
"servosEepromSave": { "servosEepromSave": {
"message": "EEPROM <span style=\"color: green\">saved</span>" "message": "EEPROM <span style=\"color: green\">saved</span>"
},
"gpsHead": {
"message": "GPS"
},
"gps3dFix": {
"message": "3D Fix:"
},
"gpsFixTrue": {
"message": "<span style=\"color: green\">True</span>"
},
"gpsFixFalse": {
"message": "<span style=\"color: red\">False</span>"
},
"gpsAltitude": {
"message": "Altitude:"
},
"gpsLat": {
"message": "Latitude:"
},
"gpsLon": {
"message": "Longitude:"
},
"gpsSpeed": {
"message": "Speed:"
},
"gpsSats": {
"message": "Sats:"
},
"gpsDistToHome": {
"message": "Dist to Home:"
},
"gpsSignalStrHead": {
"message": "GPS Signal Strength"
},
"gpsSignalStr": {
"message": "Signal Strength"
} }
} }

View File

@ -1,44 +1,44 @@
<div class="tab-gps"> <div class="tab-gps">
<div class="GPS_info"> <div class="GPS_info">
<span class="head">GPS</span> <span class="head" i18n="gpsHead"></span>
<table> <table>
<tr> <tr>
<td style="width: 85px">3D Fix:</td> <td style="width: 85px" i18n="gps3dFix"></td>
<td class="fix"><span style="color: red">False</span></td> <td class="fix" i18n="gpsFixFalse"></td>
</tr> </tr>
<tr> <tr>
<td>Altitude:</td> <td i18n="gpsAltitude"></td>
<td class="alt">0 m</td> <td class="alt">0 m</td>
</tr> </tr>
<tr> <tr>
<td>Latitude:</td> <td i18n="gpsLat"></td>
<td class="lat"><a href="#" target="_blank">0.0000 deg</a></td> <td class="lat"><a href="#" target="_blank">0.0000 deg</a></td>
</tr> </tr>
<tr> <tr>
<td>Longitude:</td> <td i18n="gpsLon"></td>
<td class="lon"><a href="#" target="_blank">0.0000 deg</a></td> <td class="lon"><a href="#" target="_blank">0.0000 deg</a></td>
</tr> </tr>
<tr> <tr>
<td>Speed:</td> <td i18n="gpsSpeed"></td>
<td class="speed">0 cm/s</td> <td class="speed">0 cm/s</td>
</tr> </tr>
<tr> <tr>
<td>Sats:</td> <td i18n="gpsSats"></td>
<td class="sats">0</td> <td class="sats">0</td>
</tr> </tr>
<tr> <tr>
<td>Dist to Home:</td> <td i18n="gpsDistToHome"></td>
<td class="distToHome">0 m</td> <td class="distToHome"></td>
</tr> </tr>
</table> </table>
</div> </div>
<div class="GPS_signal_strength"> <div class="GPS_signal_strength">
<span class="head">GPS Signal Strength</span> <span class="head" i18n="gpsSignalStrHead"></span>
<table> <table>
<tr class="titles"> <tr class="titles">
<td style="width: 40px;">Sat ID</td> <td style="width: 40px;">Sat ID</td>
<td style="width: 30px;">Qty</td> <td style="width: 30px;">Qty</td>
<td>Signal Strength</td> <td i18n="gpsSignalStr">Signal Strength</td>
</tr> </tr>
<tr> <tr>
<td>0</td> <td>0</td>

View File

@ -25,7 +25,7 @@ function tab_initialize_gps () {
var lon = GPS_DATA.lon / 100000000; var lon = GPS_DATA.lon / 100000000;
var url = 'https://maps.google.com/?q=' + lat + ',' + lon; var url = 'https://maps.google.com/?q=' + lat + ',' + lon;
$('.GPS_info td.fix').html((GPS_DATA.fix) ? '<span style="color: green">True</span>' : '<span style="color: red">False</span>'); $('.GPS_info td.fix').html((GPS_DATA.fix) ? chrome.i18n.getMessage('gpsFixTrue') : chrome.i18n.getMessage('gpsFixFalse'));
$('.GPS_info td.alt').text(GPS_DATA.alt + ' m'); $('.GPS_info td.alt').text(GPS_DATA.alt + ' m');
$('.GPS_info td.lat a').prop('href', url).text(lat.toFixed(4) + ' deg'); $('.GPS_info td.lat a').prop('href', url).text(lat.toFixed(4) + ' deg');
$('.GPS_info td.lon a').prop('href', url).text(lon.toFixed(4) + ' deg'); $('.GPS_info td.lon a').prop('href', url).text(lon.toFixed(4) + ' deg');