forked from FOSS/BangleApps
Show distance more accurately in conjunction with new locale app (fix #1523)
Also slightly more memory efficient locale modulemaster
parent
a09df566f2
commit
48efab699d
|
@ -28,4 +28,5 @@
|
||||||
0.24: Better support for Bangle.js 2, avoid widget area for Graphs, smooth graphs more
|
0.24: Better support for Bangle.js 2, avoid widget area for Graphs, smooth graphs more
|
||||||
0.25: Fix issue where if Bangle.js 2 got a GPS fix but no reported time, errors could be caused by the widget (fix #935)
|
0.25: Fix issue where if Bangle.js 2 got a GPS fix but no reported time, errors could be caused by the widget (fix #935)
|
||||||
0.26: Multiple bugfixes
|
0.26: Multiple bugfixes
|
||||||
0.27: Map drawing with light theme (fix #1023)
|
0.27: Map drawing with light theme (fix #1023)
|
||||||
|
0.28: Show distance more accurately in conjunction with new locale app (fix #1523)
|
||||||
|
|
|
@ -248,7 +248,7 @@ function plotTrack(info) {
|
||||||
g.fillCircle(ox,oy,5);
|
g.fillCircle(ox,oy,5);
|
||||||
if (info.qOSTM) g.setColor(0, 0, 0);
|
if (info.qOSTM) g.setColor(0, 0, 0);
|
||||||
else g.setColor(g.theme.fg);
|
else g.setColor(g.theme.fg);
|
||||||
g.drawString(require("locale").distance(dist),g.getWidth() / 2, g.getHeight() - 20);
|
g.drawString(require("locale").distance(dist,2),g.getWidth() / 2, g.getHeight() - 20);
|
||||||
g.setFont("6x8",2);
|
g.setFont("6x8",2);
|
||||||
g.setFontAlign(0,0,3);
|
g.setFontAlign(0,0,3);
|
||||||
g.drawString("Back",g.getWidth() - 10, g.getHeight()/2);
|
g.drawString("Back",g.getWidth() - 10, g.getHeight()/2);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"id": "gpsrec",
|
"id": "gpsrec",
|
||||||
"name": "GPS Recorder",
|
"name": "GPS Recorder",
|
||||||
"version": "0.27",
|
"version": "0.28",
|
||||||
"description": "Application that allows you to record a GPS track. Can run in background",
|
"description": "Application that allows you to record a GPS track. Can run in background",
|
||||||
"icon": "app.png",
|
"icon": "app.png",
|
||||||
"tags": "tool,outdoors,gps,widget",
|
"tags": "tool,outdoors,gps,widget",
|
||||||
|
|
|
@ -15,4 +15,6 @@
|
||||||
0.13: Now use shorter de_DE date format to more closely match other languages for size
|
0.13: Now use shorter de_DE date format to more closely match other languages for size
|
||||||
0.14: Added some first translations for Messages in nl_NL
|
0.14: Added some first translations for Messages in nl_NL
|
||||||
0.15: Fixed sv_SE formatting, long date does not work well for Bangle.js2
|
0.15: Fixed sv_SE formatting, long date does not work well for Bangle.js2
|
||||||
Added Swedish localisation with English text
|
Added Swedish localisation with English text
|
||||||
|
0.16: Remove global variables that used RAM
|
||||||
|
Add second 'dp' argument for decimal places in distance/speed/temp (fix #1523)
|
||||||
|
|
|
@ -158,10 +158,10 @@ exports = { name : "en_GB", currencySym:"£",
|
||||||
"%HH": "('0'+getHours(d)).slice(-2)",
|
"%HH": "('0'+getHours(d)).slice(-2)",
|
||||||
"%MM": "('0'+d.getMinutes()).slice(-2)",
|
"%MM": "('0'+d.getMinutes()).slice(-2)",
|
||||||
"%SS": "('0'+d.getSeconds()).slice(-2)",
|
"%SS": "('0'+d.getSeconds()).slice(-2)",
|
||||||
"%A": "day.split(',')[d.getDay()]",
|
"%A": `${js(locale.day)}.split(',')[d.getDay()]`,
|
||||||
"%a": "day.split(',')[d.getDay() + 7]",
|
"%a": `${js(locale.abday)}.split(',')[d.getDay()]`,
|
||||||
"%B": "month.split(',')[d.getMonth()]",
|
"%B": `${js(locale.month)}.split(',')[d.getMonth()]`,
|
||||||
"%b": "month.split(',')[d.getMonth() + 12]",
|
"%b": `${js(locale.abmonth)}.split(',')[d.getMonth() + 12]`,
|
||||||
"%p": `d.getHours()<12?${js(locale.ampm[0].toUpperCase())}:${js(locale.ampm[1].toUpperCase())}`,
|
"%p": `d.getHours()<12?${js(locale.ampm[0].toUpperCase())}:${js(locale.ampm[1].toUpperCase())}`,
|
||||||
"%P": `d.getHours()<12?${js(locale.ampm[0].toLowerCase())}:${js(locale.ampm[1].toLowerCase())}`
|
"%P": `d.getHours()<12?${js(locale.ampm[0].toLowerCase())}:${js(locale.ampm[1].toLowerCase())}`
|
||||||
};
|
};
|
||||||
|
@ -182,10 +182,10 @@ exports = { name : "en_GB", currencySym:"£",
|
||||||
var temperature = locale.temperature=='°F' ? '(t*9/5)+32' : 't';
|
var temperature = locale.temperature=='°F' ? '(t*9/5)+32' : 't';
|
||||||
|
|
||||||
var localeModule = `
|
var localeModule = `
|
||||||
var day = ${js(locale.day + ',' + locale.abday)};
|
function round(n, dp) {
|
||||||
var month = ${js(locale.month + ',' + locale.abmonth)};
|
if (dp===undefined) dp=0;
|
||||||
function round(n) {
|
var p = Math.min(dp,dp - Math.floor(Math.log(n)/Math.log(10)));
|
||||||
return n < 10 ? Math.round(n * 10) / 10 : Math.round(n);
|
return n.toFixed(p);
|
||||||
}
|
}
|
||||||
var is12;
|
var is12;
|
||||||
function getHours(d) {
|
function getHours(d) {
|
||||||
|
@ -197,8 +197,8 @@ function getHours(d) {
|
||||||
exports = {
|
exports = {
|
||||||
name: ${js(locale.lang)},
|
name: ${js(locale.lang)},
|
||||||
currencySym: ${js(locale.currency_symbol)},
|
currencySym: ${js(locale.currency_symbol)},
|
||||||
dow: (d,short) => day.split(',')[d.getDay() + (short ? 7 : 0)],
|
dow: (d,short) => ${js(locale.day + ',' + locale.abday)}.split(',')[d.getDay() + (short ? 7 : 0)],
|
||||||
month: (d,short) => month.split(',')[d.getMonth() + (short ? 12 : 0)],
|
month: (d,short) => ${js(locale.month + ',' + locale.abmonth)}.split(',')[d.getMonth() + (short ? 12 : 0)],
|
||||||
number: (n, dec) => {
|
number: (n, dec) => {
|
||||||
if (dec == null) dec = 2;
|
if (dec == null) dec = 2;
|
||||||
var w = n.toFixed(dec),
|
var w = n.toFixed(dec),
|
||||||
|
@ -215,9 +215,9 @@ exports = {
|
||||||
return s.substr(0, i + 3) + r + (d ? '${locale.decimal_point}' + d: '');
|
return s.substr(0, i + 3) + r + (d ? '${locale.decimal_point}' + d: '');
|
||||||
},
|
},
|
||||||
currency: n => ${currency},
|
currency: n => ${currency},
|
||||||
distance: n => n < ${distanceUnits[locale.distance[1]]} ? round(${unitConv(distanceUnits[locale.distance[0]])}) + ${js(locale.distance[0])} : round(${unitConv(distanceUnits[locale.distance[1]])}) + ${js(locale.distance[1])},
|
distance: (n,dp) => n < ${distanceUnits[locale.distance[1]]} ? round(${unitConv(distanceUnits[locale.distance[0]])},dp) + ${js(locale.distance[0])} : round(${unitConv(distanceUnits[locale.distance[1]])},dp) + ${js(locale.distance[1])},
|
||||||
speed: n => round(${unitConv(speedUnits[locale.speed])}) + ${js(locale.speed)},
|
speed: (n,dp) => round(${unitConv(speedUnits[locale.speed])},dp) + ${js(locale.speed)},
|
||||||
temp: t => Math.round(${temperature}) + ${js(locale.temperature)},
|
temp: (t,dp) => round(${temperature},dp) + ${js(locale.temperature)},
|
||||||
translate: s => ${locale.trans?`{var t=${js(locale.trans)};s=''+s;return t[s]||t[s.toLowerCase()]||s;}`:`s`},
|
translate: s => ${locale.trans?`{var t=${js(locale.trans)};s=''+s;return t[s]||t[s.toLowerCase()]||s;}`:`s`},
|
||||||
date: (d,short) => short ? \`${dateS}\` : \`${dateN}\`,
|
date: (d,short) => short ? \`${dateS}\` : \`${dateN}\`,
|
||||||
time: (d,short) => short ? \`${timeS}\` : \`${timeN}\`,
|
time: (d,short) => short ? \`${timeS}\` : \`${timeN}\`,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"id": "locale",
|
"id": "locale",
|
||||||
"name": "Languages",
|
"name": "Languages",
|
||||||
"version": "0.15",
|
"version": "0.16",
|
||||||
"description": "Translations for different countries",
|
"description": "Translations for different countries",
|
||||||
"icon": "locale.png",
|
"icon": "locale.png",
|
||||||
"type": "locale",
|
"type": "locale",
|
||||||
|
|
|
@ -17,4 +17,5 @@
|
||||||
0.11: Fix KML and GPX export when there is no GPS data
|
0.11: Fix KML and GPX export when there is no GPS data
|
||||||
0.12: Fix 'Back' label positioning on track/graph display, make translateable
|
0.12: Fix 'Back' label positioning on track/graph display, make translateable
|
||||||
0.13: Fix for when widget is used before app
|
0.13: Fix for when widget is used before app
|
||||||
0.14: Remove unneeded variable assignment
|
0.14: Remove unneeded variable assignment
|
||||||
|
0.15: Show distance more accurately in conjunction with new locale app (fix #1523)
|
||||||
|
|
|
@ -307,7 +307,7 @@ function viewTrack(filename, info) {
|
||||||
g.fillCircle(ox,oy,5);
|
g.fillCircle(ox,oy,5);
|
||||||
if (info.qOSTM) g.setColor("#000");
|
if (info.qOSTM) g.setColor("#000");
|
||||||
else g.setColor(g.theme.fg);
|
else g.setColor(g.theme.fg);
|
||||||
g.drawString(require("locale").distance(dist),g.getWidth() / 2, g.getHeight() - 20);
|
g.drawString(require("locale").distance(dist,2),g.getWidth() / 2, g.getHeight() - 20);
|
||||||
g.setFont("6x8",2);
|
g.setFont("6x8",2);
|
||||||
g.setFontAlign(0,0,3);
|
g.setFontAlign(0,0,3);
|
||||||
var isBTN3 = "BTN3" in global;
|
var isBTN3 = "BTN3" in global;
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
"id": "recorder",
|
"id": "recorder",
|
||||||
"name": "Recorder",
|
"name": "Recorder",
|
||||||
"shortName": "Recorder",
|
"shortName": "Recorder",
|
||||||
"version": "0.14",
|
"version": "0.15",
|
||||||
"description": "Record GPS position, heart rate and more in the background, then download to your PC.",
|
"description": "Record GPS position, heart rate and more in the background, then download to your PC.",
|
||||||
"icon": "app.png",
|
"icon": "app.png",
|
||||||
"tags": "tool,outdoors,gps,widget",
|
"tags": "tool,outdoors,gps,widget",
|
||||||
|
|
|
@ -212,7 +212,7 @@ exports.getStats = function(statIDs, options) {
|
||||||
stats["dist"]={
|
stats["dist"]={
|
||||||
title : "Dist",
|
title : "Dist",
|
||||||
getValue : function() { return state.distance; },
|
getValue : function() { return state.distance; },
|
||||||
getString : function() { return require("locale").distance(state.distance); },
|
getString : function() { return require("locale").distance(state.distance,2); },
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if (statIDs.includes("step")) {
|
if (statIDs.includes("step")) {
|
||||||
|
@ -251,7 +251,7 @@ exports.getStats = function(statIDs, options) {
|
||||||
stats["speed"]={
|
stats["speed"]={
|
||||||
title : "Speed",
|
title : "Speed",
|
||||||
getValue : function() { return state.curSpeed*3.6; }, // in kph
|
getValue : function() { return state.curSpeed*3.6; }, // in kph
|
||||||
getString : function() { return require("locale").speed(state.curSpeed*3.6); },
|
getString : function() { return require("locale").speed(state.curSpeed*3.6,2); },
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if (statIDs.includes("caden")) {
|
if (statIDs.includes("caden")) {
|
||||||
|
|
Loading…
Reference in New Issue