1
0
Fork 0

Added more /*LANG*/

master
copoer 2022-02-09 19:52:16 -04:00
parent 8b23e17f1c
commit 1f48344d16
121 changed files with 295 additions and 132 deletions

View File

@ -295,7 +295,7 @@ const SocketsMenu = new State({
const startEnd = status => status ? "start" : "end";
/* translate status into english */
const onOff= status => status ? "on" : "off";
const onOff= status => status ? "on" : /*LANG*/"off";
/* create watching functions that will change the global

View File

@ -53,7 +53,7 @@ function countDown() {
g.reset().clearRect(0, 76, 44+44, g.getHeight()/2+6);
g.setFontAlign(0, -1, 0);
g.setFont("6x8").drawString("Timer", 44, g.getHeight()/2-20);
g.setFont("6x8").drawString(/*LANG*/"Timer", 44, g.getHeight()/2-20);
g.setFont("Michroma16").drawString(timeToString(timervalue), 44, g.getHeight()/2-10);
if (timervalue <= 0) {

View File

@ -21,7 +21,7 @@ function getVersion(name,file) {
}
getVersion("Bootloader","boot.info");
getVersion("Launcher","launch.info");
getVersion("Settings","setting.info");
getVersion(/*LANG*/"Settings","setting.info");
y+=h;
g.drawString(MEM.total+" JS Variables available",0,y+=h);

View File

@ -23,7 +23,7 @@ function getVersion(name,file) {
var versions = [
getVersion("Bootloader","boot.info"),
getVersion("Launcher","launch.info"),
getVersion("Settings","setting.info")
getVersion(/*LANG*/"Settings","setting.info")
];
var logo = E.toArrayBuffer(atob("PBwBAAAAAAAB/gAAAAAAAB/gAAAAAAAB/gAAAAAAAB/gAAAAAAAB/gAAAAAAAB/gAAAAAAAD/w+AAAAQAHA4hAAAAQAMAMhAAAAQAYBmhAAAAQAYBGiAAAAQAQCD/H74+R4wGDhoKJCSEwEDgoKJCT8wFDgoKJCSAwHDhoKJCSEQHj/H6I+R4YHmAAAACAAYEGAAABCAAMEMAAAA8AAHA4AAAAAAAD/wAAAAAAAB/gAAAAAAAB/gAAAAAAAB/gAAAAAAAB/gAAAAAAAB/gAAAAAAAB/g"));
@ -41,7 +41,7 @@ function drawInfo() {
getVersion("Bootloader","boot.info");
getVersion("Launcher","launch.info");
getVersion("Settings","setting.info");
getVersion(/*LANG*/"Settings","setting.info");
g.drawString(MEM.total+" JS Vars",0,y+=h);
g.drawString("Storage: "+(require("Storage").getFree()>>10)+"k free",0,y+=h);

View File

@ -136,3 +136,5 @@ function startRecord(force) {
Bangle.loadWidgets();
Bangle.drawWidgets();
showMenu();
Menu();
Menu();

View File

@ -177,3 +177,7 @@ function showSaveMenu() {
}
showMenu();
}
showMenu();

View File

@ -108,7 +108,7 @@
g.setFont("6x8", 2);
g.setColor(1,1,1);
require("graph").drawLine(g, steps, {
//title: "Steps",
//title: /*LANG*/"Steps",
axes : true,
gridy : gridyValue,
y : 60, //offset on screen
@ -118,7 +118,7 @@
// show steps and duration of the chart
g.setFont("6x8", 2);
g.setColor(0,1,0);
g.drawString("steps", 30, 24);
g.drawString(/*LANG*/"steps", 30, 24);
g.drawString(stepsLastEntry, 30, 44);
g.drawString((history/3600000) + " hrs", 30, 64);

View File

@ -110,3 +110,5 @@
};
E.showMenu(menu);
});
;
});

View File

@ -69,7 +69,7 @@
'stepGoal' : 10000,
'stepLength' : 75,
'lineOne' : "Distance",
'lineTwo' : "Steps",
'lineTwo' : /*LANG*/"Steps",
};
if (!settings) { loadSettings(); }
return (key in settings) ? settings[key] : DEFAULTS[key];
@ -169,7 +169,7 @@
if (active == 1) g.setColor(0x07E0); //green
else g.setColor(0xFFFF); //white
g.setFont("6x8", 2);
if (setting('lineOne') == 'Steps') {
if (setting('lineOne') == /*LANG*/'Steps') {
g.drawString(kFormatterSteps(stepsCounted),this.x+1,this.y); //first line, big number, steps
}
if (setting('lineOne') == 'Distance') {
@ -177,7 +177,7 @@
}
g.setFont("6x8", 1);
g.setColor(0xFFFF); //white
if (setting('lineTwo') == 'Steps') {
if (setting('lineTwo') == /*LANG*/'Steps') {
g.drawString(stepsCounted,this.x+1,this.y+14); //second line, small number, steps
}
if (setting('lineTwo') == 'Distance') {

View File

@ -39,9 +39,9 @@ function showMainMenu() {
};
alarms.forEach((alarm,idx)=>{
if (alarm.timer) {
txt = /*LANG*/"TIMER "+(alarm.on?/*LANG*/"on ":/*LANG*/"off ")+formatMins(alarm.timer);
txt = /*LANG*/"TIMER "+(alarm.on?/*LANG*/"on ":/*LANG*//*LANG*/"off ")+formatMins(alarm.timer);
} else {
txt = /*LANG*/"ALARM "+(alarm.on?/*LANG*/"on ":/*LANG*/"off ")+formatTime(alarm.hr);
txt = /*LANG*/"ALARM "+(alarm.on?/*LANG*/"on ":/*LANG*//*LANG*/"off ")+formatTime(alarm.hr);
if (alarm.rp) txt += /*LANG*/" (repeat)";
}
menu[txt] = function() {
@ -82,7 +82,7 @@ function editAlarm(alarmIndex) {
},
/*LANG*/'Enabled': {
value: en,
format: v=>v?"On":"Off",
format: v=>v?"On":/*LANG*/"Off",
onchange: v=>en=v
},
/*LANG*/'Repeat': {
@ -147,7 +147,7 @@ function editTimer(alarmIndex) {
},
/*LANG*/'Enabled': {
value: en,
format: v=>v?/*LANG*/"On":/*LANG*/"Off",
format: v=>v?/*LANG*/"On":/*LANG*//*LANG*/"Off",
onchange: v=>en=v
}
};

View File

@ -29,11 +29,11 @@
},
// {t:"musicstate", state:"play/pause",position,shuffle,repeat}
"musicstate" : function() {
require("messages").pushMessage({t:"modify",id:"music",title:"Music",state:event.state});
require("messages").pushMessage({t:"modify",id:"music",title:/*LANG*/"Music",state:event.state});
},
// {t:"musicinfo", artist,album,track,dur,c(track count),n(track num}
"musicinfo" : function() {
require("messages").pushMessage(Object.assign(event, {t:"modify",id:"music",title:"Music"}));
require("messages").pushMessage(Object.assign(event, {t:"modify",id:"music",title:/*LANG*/"Music"}));
},
// {"t":"call","cmd":"incoming/end","name":"Bob","number":"12421312"})
"call" : function() {
@ -63,7 +63,7 @@
// Music control
Bangle.musicControl = cmd => {
// play/pause/next/previous/volumeup/volumedown
gbSend({ t: "music", n:cmd });
gbSend({ t: /*LANG*/"music", n:cmd });
};
// Message response
Bangle.messageResponse = (msg,response) => {

View File

@ -28,3 +28,5 @@
};
E.showMenu(mainmenu);
})
u(mainmenu);
})

View File

@ -37,7 +37,7 @@ require('Storage').writeJSON(SETTINGSFILE, {
secondsColoured: true,
secondsWithColon: true,
dateOnMain: "Long", // "Short", "Long", "ISO8601"
dateOnSecs: "Year", // "No", "Year", "Weekday", LEGACY: true/false
dateOnSecs: "Year", // "No", /*LANG*/"Year", "Weekday", LEGACY: true/false
weekDay: true,
calWeek: true,
upperCase: true,
@ -60,7 +60,7 @@ function loadSettings() {
secondsColoured = def(settings.secondsColoured, true);
secondsWithColon = def(settings.secondsWithColon, true);
dateOnMain = def(settings.dateOnMain, "Long");
dateOnSecs = def(settings.dateOnSecs, "Year");
dateOnSecs = def(settings.dateOnSecs, /*LANG*/"Year");
weekDay = def(settings.weekDay, true);
calWeek = def(settings.calWeek, false);
upperCase = def(settings.upperCase, true);
@ -68,7 +68,7 @@ function loadSettings() {
// Legacy
if (dateOnSecs === true)
dateOnSecs = "Year";
dateOnSecs = /*LANG*/"Year";
if (dateOnSecs === false)
dateOnSecs = "No";
}
@ -153,7 +153,7 @@ function draw() {
var md;
var yearfirst;
if (dateStr2.match(/\d\d\d\d$/)) { // formatted date ends with year
year = (dateOnSecs === "Year" ? dateStr2.slice(-4) : require("locale").dow(date, 1));
year = (dateOnSecs === /*LANG*/"Year" ? dateStr2.slice(-4) : require("locale").dow(date, 1));
md = dateStr2.slice(0, -4);
if (!md.endsWith(".")) // keep separator before the year only if it is a dot (31.12. but 31/12)
md = md.slice(0, -1);
@ -161,7 +161,7 @@ function draw() {
} else { // formatted date begins with year
if (!dateStr2.match(/^\d\d\d\d/)) // if year position cannot be detected...
dateStr2 = isoStr(date); // ...use ISO date format instead
year = (dateOnSecs === "Year" ? dateStr2.slice(0, 4) : require("locale").dow(date, 1));
year = (dateOnSecs === /*LANG*/"Year" ? dateStr2.slice(0, 4) : require("locale").dow(date, 1));
md = dateStr2.slice(5); // never keep separator directly after year
yearfirst = true;
}

View File

@ -105,3 +105,9 @@
});
// end of file
nu
E.showMenu(mainmenu);
});
// end of file

View File

@ -1 +1 @@
!function(){"use strict";var t;!function(t){t.Stopped="STOP",t.Paused="PAUSE",t.Running="RUN"}(t||(t={}));const n={STOP:63488,PAUSE:65504,RUN:2016};function e(t,n,e){g.setColor(0),g.fillRect(n-60,e,n+60,e+30),g.setColor(65535),g.drawString(t,n,e)}function i(i){var s;g.setFontVector(30),g.setFontAlign(0,-1,0),e((i.distance/1e3).toFixed(2),60,55),e(function(t){const n=Math.round(t),e=Math.floor(n/3600),i=Math.floor(n/60)%60,s=n%60;return(e?e+":":"")+("0"+i).substr(-2)+":"+("0"+s).substr(-2)}(i.duration),172,55),e(function(t){if(t<.1667)return"__'__\"";const n=Math.round(1e3/t),e=Math.floor(n/60),i=n%60;return("0"+e).substr(-2)+"'"+("0"+i).substr(-2)+'"'}(i.speed),60,115),e(i.hr.toFixed(0),172,115),e(i.steps.toFixed(0),60,175),e(i.cadence.toFixed(0),172,175),g.setFont("6x8",2),g.setColor(i.gpsValid?2016:63488),g.fillRect(0,216,80,240),g.setColor(0),g.drawString("GPS",40,220),g.setColor(65535),g.fillRect(80,216,160,240),g.setColor(0),g.drawString(("0"+(s=new Date).getHours()).substr(-2)+":"+("0"+s.getMinutes()).substr(-2),120,220),g.setColor(n[i.status]),g.fillRect(160,216,230,240),g.setColor(0),g.drawString(i.status,200,220),g.setFont("6x8").setFontAlign(0,0,1).setColor(-1),i.status===t.Paused?g.drawString("START",236,60,1).drawString(" CLEAR ",236,180,1):i.status===t.Running?g.drawString(" PAUSE ",236,60,1).drawString(" PAUSE ",236,180,1):g.drawString("START",236,60,1).drawString(" ",236,180,1)}function s(t){g.clear(),g.setColor(50712),g.setFont("6x8",2),g.setFontAlign(0,-1,0),g.drawString("DIST (KM)",60,32),g.drawString("TIME",180,32),g.drawString("PACE",60,92),g.drawString("HEART",180,92),g.drawString("STEPS",60,152),g.drawString("CADENCE",180,152),i(t),Bangle.drawWidgets()}function a(n){n.status===t.Stopped&&function(t){const n=(new Date).toISOString().replace(/[-:]/g,""),e=`banglerun_${n.substr(2,6)}_${n.substr(9,6)}`;t.file=require("Storage").open(e,"w"),t.fileWritten=!1}(n),n.status===t.Running?n.status=t.Paused:n.status=t.Running,i(n)}const r={fix:NaN,lat:NaN,lon:NaN,alt:NaN,vel:NaN,dop:NaN,gpsValid:!1,x:NaN,y:NaN,z:NaN,t:NaN,timeSinceLog:0,hr:60,hrError:100,file:null,fileWritten:!1,drawing:!1,status:t.Stopped,duration:0,distance:0,speed:0,steps:0,cadence:0};var o;o=r,Bangle.on("GPS",n=>function(n,e){n.lat=e.lat,n.lon=e.lon,n.alt=e.alt,n.vel=e.speed/3.6,n.fix=e.fix,n.dop=e.hdop,n.gpsValid=n.fix>0,function(n){const e=Date.now();let i=(e-n.t)/1e3;if(isFinite(i)||(i=0),n.t=e,n.timeSinceLog+=i,n.status===t.Running&&(n.duration+=i),!n.gpsValid)return;const s=6371008.8+n.alt,a=n.lat*Math.PI/180,r=n.lon*Math.PI/180,o=s*Math.cos(a)*Math.cos(r),g=s*Math.cos(a)*Math.sin(r),d=s*Math.sin(a);if(!n.x)return n.x=o,n.y=g,void(n.z=d);const u=o-n.x,l=g-n.y,c=d-n.z,f=Math.sqrt(u*u+l*l+c*c);n.x=o,n.y=g,n.z=d,n.status===t.Running&&(n.distance+=f,n.speed=n.distance/n.duration||0,n.cadence=60*n.steps/n.duration||0)}(n),i(n),n.gpsValid&&n.status===t.Running&&n.timeSinceLog>5&&(n.timeSinceLog=0,function(t){t.fileWritten||(t.file.write(["timestamp","latitude","longitude","altitude","duration","distance","heartrate","steps"].join(",")+"\n"),t.fileWritten=!0),t.file.write([Date.now().toFixed(0),t.lat.toFixed(6),t.lon.toFixed(6),t.alt.toFixed(2),t.duration.toFixed(0),t.distance.toFixed(2),t.hr.toFixed(0),t.steps.toFixed(0)].join(",")+"\n")}(n))}(o,n)),Bangle.setGPSPower(1),function(t){Bangle.on("HRM",n=>function(t,n){if(0===n.confidence)return;const e=n.bpm-t.hr,i=Math.abs(e)+101-n.confidence,s=t.hrError/(t.hrError+i)||0;t.hr+=e*s,t.hrError+=(i-t.hrError)*s}(t,n)),Bangle.setHRMPower(1)}(r),function(n){Bangle.on("step",()=>function(n){n.status===t.Running&&(n.steps+=1)}(n))}(r),function(t){Bangle.loadWidgets(),Bangle.on("lcdPower",n=>{t.drawing=n,n&&s(t)}),s(t)}(r),setWatch(()=>a(r),BTN1,{repeat:!0,edge:"falling"}),setWatch(()=>function(n){n.status===t.Paused&&function(t){t.duration=0,t.distance=0,t.speed=0,t.steps=0,t.cadence=0}(n),n.status===t.Running?n.status=t.Paused:n.status=t.Stopped,i(n)}(r),BTN3,{repeat:!0,edge:"falling"})}();
!function(){"use strict";var t;!function(t){t.Stopped="STOP",t.Paused="PAUSE",t.Running="RUN"}(t||(t={}));const n={STOP:63488,PAUSE:65504,RUN:2016};function e(t,n,e){g.setColor(0),g.fillRect(n-60,e,n+60,e+30),g.setColor(65535),g.drawString(t,n,e)}function i(i){var s;g.setFontVector(30),g.setFontAlign(0,-1,0),e((i.distance/1e3).toFixed(2),60,55),e(function(t){const n=Math.round(t),e=Math.floor(n/3600),i=Math.floor(n/60)%60,s=n%60;return(e?e+":":"")+("0"+i).substr(-2)+":"+("0"+s).substr(-2)}(i.duration),172,55),e(function(t){if(t<.1667)return"__'__\"";const n=Math.round(1e3/t),e=Math.floor(n/60),i=n%60;return("0"+e).substr(-2)+"'"+("0"+i).substr(-2)+'"'}(i.speed),60,115),e(i.hr.toFixed(0),172,115),e(i.steps.toFixed(0),60,175),e(i.cadence.toFixed(0),172,175),g.setFont("6x8",2),g.setColor(i.gpsValid?2016:63488),g.fillRect(0,216,80,240),g.setColor(0),g.drawString("GPS",40,220),g.setColor(65535),g.fillRect(80,216,160,240),g.setColor(0),g.drawString(("0"+(s=new Date).getHours()).substr(-2)+":"+("0"+s.getMinutes()).substr(-2),120,220),g.setColor(n[i.status]),g.fillRect(160,216,230,240),g.setColor(0),g.drawString(i.status,200,220),g.setFont("6x8").setFontAlign(0,0,1).setColor(-1),i.status===t.Paused?g.drawString("START",236,60,1).drawString(" CLEAR ",236,180,1):i.status===t.Running?g.drawString(" PAUSE ",236,60,1).drawString(" PAUSE ",236,180,1):g.drawString("START",236,60,1).drawString(" ",236,180,1)}function s(t){g.clear(),g.setColor(50712),g.setFont("6x8",2),g.setFontAlign(0,-1,0),g.drawString("DIST (KM)",60,32),g.drawString("TIME",180,32),g.drawString("PACE",60,92),g.drawString("HEART",180,92),g.drawString("STEPS",60,152),g.drawString("CADENCE",180,152),i(t),Bangle.drawWidgets()}function a(n){n.status===t.Stopped&&function(t){const n=(new Date).toISOString().replace(/[-:]/g,""),e=`banglerun_${n.substr(2,6)}_${n.substr(9,6)}`;t.file=require("Storage").open(e,"w"),t.fileWritten=!1}(n),n.status===t.Running?n.status=t.Paused:n.status=t.Running,i(n)}const r={fix:NaN,lat:NaN,lon:NaN,alt:NaN,vel:NaN,dop:NaN,gpsValid:!1,x:NaN,y:NaN,z:NaN,t:NaN,timeSinceLog:0,hr:60,hrError:100,file:null,fileWritten:!1,drawing:!1,status:t.Stopped,duration:0,distance:0,speed:0,steps:0,cadence:0};var o;o=r,Bangle.on("GPS",n=>function(n,e){n.lat=e.lat,n.lon=e.lon,n.alt=e.alt,n.vel=e.speed/3.6,n.fix=e.fix,n.dop=e.hdop,n.gpsValid=n.fix>0,function(n){const e=Date.now();let i=(e-n.t)/1e3;if(isFinite(i)||(i=0),n.t=e,n.timeSinceLog+=i,n.status===t.Running&&(n.duration+=i),!n.gpsValid)return;const s=6371008.8+n.alt,a=n.lat*Math.PI/180,r=n.lon*Math.PI/180,o=s*Math.cos(a)*Math.cos(r),g=s*Math.cos(a)*Math.sin(r),d=s*Math.sin(a);if(!n.x)return n.x=o,n.y=g,void(n.z=d);const u=o-n.x,l=g-n.y,c=d-n.z,f=Math.sqrt(u*u+l*l+c*c);n.x=o,n.y=g,n.z=d,n.status===t.Running&&(n.distance+=f,n.speed=n.distance/n.duration||0,n.cadence=60*n.steps/n.duration||0)}(n),i(n),n.gpsValid&&n.status===t.Running&&n.timeSinceLog>5&&(n.timeSinceLog=0,function(t){t.fileWritten||(t.file.write(["timestamp","latitude","longitude","altitude","duration","distance","heartrate",/*LANG*/"steps"].join(",")+"\n"),t.fileWritten=!0),t.file.write([Date.now().toFixed(0),t.lat.toFixed(6),t.lon.toFixed(6),t.alt.toFixed(2),t.duration.toFixed(0),t.distance.toFixed(2),t.hr.toFixed(0),t.steps.toFixed(0)].join(",")+"\n")}(n))}(o,n)),Bangle.setGPSPower(1),function(t){Bangle.on("HRM",n=>function(t,n){if(0===n.confidence)return;const e=n.bpm-t.hr,i=Math.abs(e)+101-n.confidence,s=t.hrError/(t.hrError+i)||0;t.hr+=e*s,t.hrError+=(i-t.hrError)*s}(t,n)),Bangle.setHRMPower(1)}(r),function(n){Bangle.on("step",()=>function(n){n.status===t.Running&&(n.steps+=1)}(n))}(r),function(t){Bangle.loadWidgets(),Bangle.on("lcdPower",n=>{t.drawing=n,n&&s(t)}),s(t)}(r),setWatch(()=>a(r),BTN1,{repeat:!0,edge:"falling"}),setWatch(()=>function(n){n.status===t.Paused&&function(t){t.duration=0,t.distance=0,t.speed=0,t.steps=0,t.cadence=0}(n),n.status===t.Running?n.status=t.Paused:n.status=t.Stopped,i(n)}(r),BTN3,{repeat:!0,edge:"falling"})}();

View File

@ -19,3 +19,5 @@
}
});
});
});
});

View File

@ -191,8 +191,8 @@ function btn3Pressed() {
if (settings.vibrate == "forward")
settings.vibrate = "backward";
else if (settings.vibrate == "backward")
settings.vibrate = "off";
else if (settings.vibrate == "off")
settings.vibrate = /*LANG*/"off";
else if (settings.vibrate == /*LANG*/"off")
settings.vibrate = "forward";
}
else if(status == 5){

View File

@ -503,7 +503,7 @@
if (settings.startWithHrm){
Bangle.setHRMPower = function(isOn, app) {
log("setHRMPower for " + app + ": " + (isOn?"on":"off"));
log("setHRMPower for " + app + ": " + (isOn?"on":/*LANG*/"off"));
if (settings.enabled){
Bangle.setBTHRMPower(isOn, app);
}

View File

@ -243,5 +243,12 @@
}
};
E.showMenu(mainmenu);
})
writeSettings("gracePeriodService",v);
}
}
};
E.showMenu(mainmenu);
})

View File

@ -58,7 +58,7 @@ function draw(y, hrv) {
}
g.setRotation(3);
g.setFontVector(12).drawString("Reset",g.getHeight()/2, g.getWidth()-10);
g.setFontVector(12).drawString(/*LANG*/"Reset",g.getHeight()/2, g.getWidth()-10);
g.setRotation(0);
}

View File

@ -36,3 +36,7 @@
});
})
},
});
})

View File

@ -91,3 +91,4 @@ function showMenu() {
}
showMenu();
enu();

View File

@ -227,7 +227,7 @@ function isCircleEnabled(type) {
function getCircleColor(type) {
const pos = getCirclePosition(type);
const color = settings["circle" + (pos + 1) + "color"];
const color = settings["circle" + (pos + 1) + /*LANG*/"color"];
if (color && color != "") return color;
}
@ -828,3 +828,7 @@ Bangle.loadWidgets();
draw();
setInterval(draw, 60000);
s();
draw();
setInterval(draw, 60000);

View File

@ -44,7 +44,7 @@
},
/*LANG*/'show widgets': {
value: "showWidgets" in settings ? settings.showWidgets : false,
format: () => (settings.showWidgets ? 'Yes' : 'No'),
format: () => (settings.showWidgets ? /*LANG*/'Yes' : 'No'),
onchange: x => save('showWidgets', x),
},
/*LANG*/'weather circle': {
@ -167,7 +167,7 @@
},
/*LANG*/'colorize icon': {
value: colorizeIconKey in settings ? settings[colorizeIconKey] : false,
format: () => (settings[colorizeIconKey] ? 'Yes' : 'No'),
format: () => (settings[colorizeIconKey] ? /*LANG*/'Yes' : 'No'),
onchange: x => save(colorizeIconKey, x),
},
};
@ -175,5 +175,9 @@
}
showMainMenu();
});
showMainMenu();
});

View File

@ -16,7 +16,7 @@ var lasty = 0;
var lastx = 0;
if (settings.HID=="kbmedia") {
profile = 'Music';
profile = /*LANG*/'Music';
sendHid = function (code, cb) {
try {
NRF.sendHIDReport([1,code], () => {
@ -57,29 +57,29 @@ if (next) {
if(lasty > 40){
writeLine('Down', 3);
// setTimeout(drawApp, 1000);
// Bluetooth.println(JSON.stringify({t:"music", n:"volumedown"}));
// Bluetooth.println(JSON.stringify({t:/*LANG*/"music", n:"volumedown"}));
down(() => {});
}
else if(lasty < -40){
writeLine('Up', 3);
// setTimeout(drawApp, 1000);
//Bluetooth.println(JSON.stringify({t:"music", n:"volumeup"}));
//Bluetooth.println(JSON.stringify({t:/*LANG*/"music", n:"volumeup"}));
up(() => {});
} else if(lastx < -40){
writeLine('Prev', 3);
// setTimeout(drawApp, 1000);
// Bluetooth.println(JSON.stringify({t:"music", n:"previous"}));
// Bluetooth.println(JSON.stringify({t:/*LANG*/"music", n:"previous"}));
prev(() => {});
} else if(lastx > 40){
writeLine('Next', 3);
// setTimeout(drawApp, 1000);
// Bluetooth.println(JSON.stringify({t:"music", n:"next"}));
// Bluetooth.println(JSON.stringify({t:/*LANG*/"music", n:"next"}));
next(() => {});
} else if(lastx==0 && lasty==0){
writeLine('play/pause', 3);
//setTimeout(drawApp, 1000);
// Bluetooth.println(JSON.stringify({t:"music", n:"play"}));
// Bluetooth.println(JSON.stringify({t:/*LANG*/"music", n:"play"}));
toggle(() => {});
}

View File

@ -35,7 +35,7 @@ function setting(key) {
'battery': true,
'batteryLvl': 30,
'weather': true,
'steps': true,
/*LANG*/'steps': true,
'heartrate': true
};
return (key in settings) ? settings[key] : DEFAULTS[key];
@ -45,7 +45,7 @@ function setting(key) {
let showBattery = setting('battery');
let batteryWarnLevel = setting('batteryLvl');
let showWeather = setting('weather');
let showSteps = setting('steps');
let showSteps = setting(/*LANG*/'steps');
let showHeartRate = setting('heartrate');

View File

@ -52,3 +52,7 @@
'< Back': back,
});
});
,
'< Back': back,
});
});

View File

@ -710,7 +710,7 @@
{
Face:'1-12', colored:true,
Hands:'rounded', withSeconds:true,
Foreground:'Theme', Background:'Theme', Seconds:'#FF0000'
Foreground:'Theme', Background:/*LANG*/'Theme', Seconds:'#FF0000'
},
require('Storage').readJSON('configurable_clock.json', true) || {}
);
@ -855,8 +855,8 @@
activeLayout = null;
g.setTheme({
fg:(Settings.Foreground === 'Theme' ? Theme.fg : Settings.Foreground || '#000000'),
bg:(Settings.Background === 'Theme' ? Theme.bg : Settings.Background || '#FFFFFF')
fg:(Settings.Foreground === /*LANG*/'Theme' ? Theme.fg : Settings.Foreground || '#000000'),
bg:(Settings.Background === /*LANG*/'Theme' ? Theme.bg : Settings.Background || '#FFFFFF')
});
g.clear(true); // also installs the current theme
@ -872,8 +872,8 @@
/**** renderClock ****/
function renderClock () {
g.setColor (Settings.Foreground === 'Theme' ? Theme.fg : Settings.Foreground || '#000000');
g.setBgColor(Settings.Background === 'Theme' ? Theme.bg : Settings.Background || '#FFFFFF');
g.setColor (Settings.Foreground === /*LANG*/'Theme' ? Theme.fg : Settings.Foreground || '#000000');
g.setBgColor(Settings.Background === /*LANG*/'Theme' ? Theme.bg : Settings.Background || '#FFFFFF');
switch (Settings.Face) {
case 'none':
@ -951,7 +951,7 @@
let HoursAngle = (Hours+(Minutes/60))/12 * twoPi - Pi;
let MinutesAngle = (Minutes/60) * twoPi - Pi;
g.setColor(Settings.Foreground === 'Theme' ? Theme.fg : Settings.Foreground || '#000000');
g.setColor(Settings.Foreground === /*LANG*/'Theme' ? Theme.fg : Settings.Foreground || '#000000');
switch (Settings.Hands) {
case 'simple':
@ -968,10 +968,10 @@
transformPolygon(roundedMinuteHandPolygon, CenterX,CenterY, MinutesAngle);
g.fillPoly(transformedPolygon);
// g.setColor(Settings.Foreground === 'Theme' ? Theme.fg || '#000000');
// g.setColor(Settings.Foreground === /*LANG*/'Theme' ? Theme.fg || '#000000');
g.fillCircle(CenterX,CenterY, outerBoltRadius);
g.setColor(Settings.Background === 'Theme' ? Theme.bg : Settings.Background || '#FFFFFF');
g.setColor(Settings.Background === /*LANG*/'Theme' ? Theme.bg : Settings.Background || '#FFFFFF');
g.drawCircle(CenterX,CenterY, outerBoltRadius);
g.fillCircle(CenterX,CenterY, innerBoltRadius);
break;
@ -986,7 +986,7 @@
}
if (Settings.withSeconds) {
g.setColor(Settings.Seconds === 'Theme' ? Theme.fgH : Settings.Seconds || '#FF0000');
g.setColor(Settings.Seconds === /*LANG*/'Theme' ? Theme.fgH : Settings.Seconds || '#FF0000');
let Seconds = now.getSeconds();
let SecondsAngle = (Seconds/60) * twoPi - Pi;
@ -1089,9 +1089,9 @@
let Seconds = (Changes.Seconds == null ? Settings.Seconds : Changes.Seconds);
activeLayout = ColorsScreen;
activeLayout['Foreground'].bgCol = (Foreground === 'Theme' ? Theme.fg : Foreground);
activeLayout['Background'].bgCol = (Background === 'Theme' ? Theme.bg : Background);
activeLayout['Seconds'].bgCol = (Seconds === 'Theme' ? Theme.fgH : Seconds);
activeLayout['Foreground'].bgCol = (Foreground === /*LANG*/'Theme' ? Theme.fg : Foreground);
activeLayout['Background'].bgCol = (Background === /*LANG*/'Theme' ? Theme.bg : Background);
activeLayout['Seconds'].bgCol = (Seconds === /*LANG*/'Theme' ? Theme.fgH : Seconds);
activeLayout.render();
}
@ -1123,12 +1123,12 @@
activeLayout['#FF00FF'].selected = (chosenColor === '#FF00FF');
activeLayout['#00FFFF'].selected = (chosenColor === '#00FFFF');
activeLayout['#FFFFFF'].selected = (chosenColor === '#FFFFFF');
activeLayout['Theme'].selected = (chosenColor === 'Theme');
activeLayout['Theme'].selected = (chosenColor === /*LANG*/'Theme');
activeLayout.render();
}
function chooseColor (Control) { Bangle.buzz(); chosenColor = Control.id; refreshColorChoiceScreen(); }
function chooseThemeColor () { Bangle.buzz(); chosenColor = 'Theme'; refreshColorChoiceScreen(); }
function chooseThemeColor () { Bangle.buzz(); chosenColor = /*LANG*/'Theme'; refreshColorChoiceScreen(); }
function applyColor () {
Changes[ColorToChange] = chosenColor;
@ -1347,9 +1347,9 @@
Drawable(drawColorChoice, { id:'#00FFFF', common:ColorChoice, col:'#00FFFF' }),
], filly:1 },
{ type:'h', c:[
Label('use Theme:', { id:'Theme', common:leftAligned, pad:4 }),
Label('use Theme:', { id:/*LANG*/'Theme', common:leftAligned, pad:4 }),
{ width:10 },
Drawable(drawColorChoice, { id:'Theme', common:ColorChoice, col:Theme.fg }),
Drawable(drawColorChoice, { id:/*LANG*/'Theme', common:ColorChoice, col:Theme.fg }),
], filly:1, onTouch:chooseThemeColor },
{ height:4 },
{ type:'h', c:[

View File

@ -45,3 +45,7 @@ const menu = {
E.showMenu(menu);
})
nu);
})
nu);
})

View File

@ -225,7 +225,7 @@ function connection_setup() {
return device.gatt.connect();
}).then(function(ga) {
gatt = ga;
E.showMessage("Connected");
E.showMessage(/*LANG*/"Connected");
return gatt.getPrimaryService("1816");
}).then(function(s) {
service = s;

View File

@ -43,3 +43,5 @@
}
E.showMenu(menu);
})
nu);
})

View File

@ -244,7 +244,7 @@ function run(){
Bangle.setLCDMode();
g.clear();
g.flip();
E.showMessage("Loading...");
E.showMessage(/*LANG*/"Loading...");
load(app.src);
}

View File

@ -56,4 +56,6 @@
},
'< Back': back
});
});: back
});
});

View File

@ -46,7 +46,7 @@ function showMenu() {
updateSettings();
}
},
'Year': {
/*LANG*/'Year': {
value: settings.year,
step: 1,
onchange: v => {

View File

@ -59,7 +59,7 @@ function parseDevice(d) {
g.clearRect(0, 60, 239, 239).setFontAlign(0, 0, 0).setColor(0, 1, 0).drawString("Found device", 120, 120).flip();
device.gatt.connect().then(function(ga) {
gatt = ga;
g.clearRect(0, 60, 239, 239).setFontAlign(0, 0, 0).setColor(0, 1, 0).drawString("Connected", 120, 120).flip();
g.clearRect(0, 60, 239, 239).setFontAlign(0, 0, 0).setColor(0, 1, 0).drawString(/*LANG*/"Connected", 120, 120).flip();
return gatt.getPrimaryService("FFE0");
}).then(function(s) {
service = s;

View File

@ -31,3 +31,7 @@
}
});
})
}
});
})

View File

@ -40,3 +40,8 @@
}
});
})
}
}
});
})

View File

@ -20,4 +20,5 @@
}
}
});
}) });
})

View File

@ -2,7 +2,7 @@ const locale = require("locale");
const storage = require('Storage');
const is12Hour = (storage.readJSON("setting.json", 1) || {})["12hour"];
const color = (storage.readJSON("ffcniftyb.json", 1) || {})["color"] || 63488 /* red */;
const color = (storage.readJSON("ffcniftyb.json", 1) || {})[/*LANG*/"color"] || 63488 /* red */;
/* Clock *********************************************/

View File

@ -102,3 +102,5 @@ function get_pruned_file_list() {
files = get_pruned_file_list();
drawMenu();
Menu();
Menu();

View File

@ -225,3 +225,4 @@ function sortHelper() {
}
showMainMenu();
Menu();

View File

@ -31,3 +31,7 @@
};
E.showMenu(appMenu)
})
enu)
})
enu(appMenu)
})

View File

@ -43,3 +43,5 @@
E.showMenu(menu);
});
u);
});

View File

@ -47,3 +47,7 @@
E.showMenu(mainmenu);
})
nu);
})
u(mainmenu);
})

View File

@ -5,7 +5,7 @@ function satelliteImage() {
var Layout = require("Layout");
var layout;
//Bangle.setGPSPower(1, "app");
E.showMessage("Loading..."); // avoid showing rubbish on screen
E.showMessage(/*LANG*/"Loading..."); // avoid showing rubbish on screen
var lastFix = {
fix: -1,

View File

@ -251,7 +251,7 @@ function plotTrack(info) {
g.drawString(require("locale").distance(dist),g.getWidth() / 2, g.getHeight() - 20);
g.setFont("6x8",2);
g.setFontAlign(0,0,3);
g.drawString("Back",g.getWidth() - 10, g.getHeight()/2);
g.drawString(/*LANG*/"Back",g.getWidth() - 10, g.getHeight()/2);
setWatch(function() {
viewTrack(info.fn, info);
}, global.BTN3||BTN1);
@ -335,7 +335,7 @@ function plotGraph(info, style) {
});
g.setFont("6x8",2);
g.setFontAlign(0,0,3);
g.drawString("Back",g.getWidth() - 10, g.getHeight() - 40);
g.drawString(/*LANG*/"Back",g.getWidth() - 10, g.getHeight() - 40);
setWatch(function() {
viewTrack(info.fn, info);
}, global.BTN3||BTN1);

View File

@ -40,7 +40,7 @@ var layout = new Layout( {
{type:"txt", fillx:1, filly:1, font:"6x8:2", label:"---", id:"gpstime" }
]},{lazy:true, btns: [
{ label : "Set", cb : setGPSTime},
{ label : "Back", cb : ()=>load() }
{ label : /*LANG*/"Back", cb : ()=>load() }
]});

View File

@ -110,3 +110,4 @@ function editAlarm(alarmIndex) {
}
showMainMenu();
showMainMenu();

View File

@ -40,7 +40,7 @@ function showNumberPicker(currentGuess, randomNum) {
function showPrompt(msg, buzzCount, alarm) {
E.showPrompt(msg,{
title:"STAY AWAKE!",
buttons : {"Sleep":0,"Stop":1} // default is sleep so it'll come back in 10 mins
buttons : {/*LANG*/"Sleep":0,"Stop":1} // default is sleep so it'll come back in 10 mins
}).then(function(choice) {
buzzCount = 0;
if (choice==0) {

View File

@ -255,3 +255,7 @@ function clearButton() {
Bangle.loadWidgets();
Bangle.drawWidgets();
menuMain();
Main();
ts();
Bangle.drawWidgets();
menuMain();

View File

@ -310,3 +310,4 @@ function graphRecord(n) {
showMainMenu();
// vim: et ts=2 sw=2
=2 sw=2

View File

@ -5,7 +5,7 @@ const settings = storage.readJSON('setting.json',1) || { HID: false };
var sendHid, next, prev, toggle, up, down, profile;
if (settings.HID=="kbmedia") {
profile = 'Music';
profile = /*LANG*/'Music';
sendHid = function (code, cb) {
try {
NRF.sendHIDReport([1,code], () => {

View File

@ -7,7 +7,7 @@ var lasty = 0;
var lastx = 0;
if (settings.HID=="kbmedia") {
profile = 'Music';
profile = /*LANG*/'Music';
sendHid = function (code, cb) {
try {
NRF.sendHIDReport([1,code], () => {
@ -36,8 +36,8 @@ if (settings.HID=="kbmedia") {
function drawApp() {
g.clear();
if(Bangle.isLocked()==false) E.showMessage('Swipe', 'Music');
else E.showMessage('Locked', 'Music');
if(Bangle.isLocked()==false) E.showMessage('Swipe', /*LANG*/'Music');
else E.showMessage('Locked', /*LANG*/'Music');
}
if (next) {

View File

@ -38,3 +38,4 @@ function showMainMenu() {
}
showMainMenu();
Menu();

View File

@ -55,3 +55,5 @@
}
});
})
});
})

View File

@ -172,7 +172,7 @@ function setNumSets(){
type:"v", c: [
{type:"txt", font:"6x8:2", label:"Number Sets", id:"title" },
{type:"txt", font:"30%", pad: 20, label: numSets, id:"value" },
{type:"btn", font:"6x8:2", label:"Back", cb: l => {
{type:"btn", font:"6x8:2", label:/*LANG*/"Back", cb: l => {
setRestTime();
}
}
@ -217,7 +217,7 @@ function setRestTime(){
type:"v", c: [
{type:"txt", font:"6x8:2", label:"Rest Time", id:"title" },
{type:"txt", font:"30%", pad: 20, label: restTime, id:"value" },
{type:"btn", font:"6x8:2", label:"Back", cb: l => {
{type:"btn", font:"6x8:2", label:/*LANG*/"Back", cb: l => {
setActiveTime();
}
}

View File

@ -152,7 +152,7 @@ function showMenu()
"Work seconds" : { value : settings.workseg,min:0,max:59,step:5,onchange : v => { settings.workseg=v; } },
"Rest minutes" : { value : settings.restmin,min:0,max:59,step:1,onchange : v => { settings.restmin=v; } },
"Rest seconds" : { value : settings.restseg,min:0,max:59,step:5,onchange : v => { settings.restseg=v; } },
"Signal type" : { value : settings.buzz,format : v => v?"Buzz":"Beep",onchange : v => { settings.buzz=v; }}
"Signal type" : { value : settings.buzz,format : v => v?"Buzz":/*LANG*/"Beep",onchange : v => { settings.buzz=v; }}
};
E.showMenu(mainmenu);

View File

@ -132,7 +132,7 @@ E.on('notify',msg=>{
// Apple media service
E.on('AMS',a=>{
function push(m) {
var msg = { t : "modify", id : "music", title:"Music" };
var msg = { t : "modify", id : "music", title:/*LANG*/"Music" };
if (a.id=="artist") msg.artist = m;
else if (a.id=="album") msg.album = m;
else if (a.id=="title") msg.track = m;

View File

@ -2,12 +2,12 @@ const affirmative = [
'It is\ncertain.',
'It is\ndicededly\nso.',
'Without\na doubt.',
'Yes\ndefinitely.',
/*LANG*/'Yes\ndefinitely.',
'You may\nrely\non it.',
'As I see,\nit yes.',
'Most\nlikely.',
'Outlook\ngood.',
'Yes.',
/*LANG*/'Yes.',
'Signs point\nto yes.'
];
const nonCommittal = [

View File

@ -84,3 +84,5 @@
E.showMenu(mainMenu);
});
u);
});

View File

@ -3,7 +3,7 @@ const locale = require('locale');
const storage = require('Storage')
let settings = {
alarm: -1,
dataRow1: "Steps",
dataRow1: /*LANG*/"Steps",
dataRow2: "Temp",
dataRow3: "Battery"
};
@ -151,7 +151,7 @@ function _drawData(key, y, c){
var value = "ERR";
var should_print= true;
if(key == "STEPS"){
if(key == /*LANG*/"STEPS"){
text = "STEP";
value = getSteps();

View File

@ -52,3 +52,7 @@
}
});
})
}
});
})

View File

@ -107,8 +107,8 @@
step: 1
},
unlockSide: {
title: ["off", "left", "right", "top", "bottom", "front", "back"],
value: ["", "left", "right", "top", "bottom", "front", "back"]
title: ["off", "left", "right", "top", "bottom", "front", /*LANG*/"back"],
value: ["", "left", "right", "top", "bottom", "front", /*LANG*/"back"]
},
tapOn: {
title: ["on locked", "on unlocked", "always on"],

View File

@ -21,7 +21,7 @@
area: "tr",
sortorder: 10,
width: 23,
dragStatus: "off",
dragStatus: /*LANG*/"off",
// internal function //
// write settings to storage
@ -165,7 +165,7 @@
// on touch release remove drag listener and reset drag status to indicate stopped drag action
if (!event.b) {
Bangle.removeListener("drag", w.dragListener);
w.dragStatus = "off";
w.dragStatus = /*LANG*/"off";
}
// clear variables
@ -181,7 +181,7 @@
var w = WIDGETS.lightswitch;
// skip all if drag action ongoing
if (w.dragStatus === "off") {
if (w.dragStatus === /*LANG*/"off") {
// check if inside widget area
if (!(!w || cursor.x < w.x || cursor.x > w.x + w.width ||
@ -199,7 +199,7 @@
// clear drag timeout
if (typeof w.dragStatus === "number") clearTimeout(w.dragStatus);
// reset drag status to indicate stopped drag action
w.dragStatus = "off";
w.dragStatus = /*LANG*/"off";
}, w.dragDelay, w);
}
// switch backlight

View File

@ -75,4 +75,8 @@
},
}
});
})
},
}
});
})

View File

@ -20,6 +20,6 @@ const avg = [];
setInterval(function() {
drawTemperature();
}, 2000);
E.showMessage("Loading...");
E.showMessage(/*LANG*/"Loading...");
Bangle.loadWidgets();
Bangle.drawWidgets();

View File

@ -73,7 +73,7 @@ let lastTemp = 0;
const phone = {
get status() {
return NRF.getSecurityStatus().connected ? "Yes" : "No";
return NRF.getSecurityStatus().connected ? /*LANG*/"Yes" : "No";
},
message: null,
messageTimeout: null,

View File

@ -14,7 +14,7 @@ E.showMenu = function(items) {
// show "< Back" item (or similar) as button instead (i.e. remove from the menu)
var back,backLbl;
for (var b of ['Back', 'Exit', 'Cancel']) {
for (var b of [/*LANG*/'Back', 'Exit', 'Cancel']) {
if (!items[b] && items['< '+b]) b = '< '+b;
back = items[b];
if (typeof back === "function") {

View File

@ -98,7 +98,7 @@ function getMessageImage(msg) {
if (s=="whatsapp") return atob("GBiBAAB+AAP/wAf/4A//8B//+D///H9//n5//nw//vw///x///5///4///8e//+EP3/APn/wPn/+/j///H//+H//8H//4H//wMB+AA==");
if (s=="wordfeud") return atob("GBgCWqqqqqqlf//////9v//////+v/////++v/////++v8///Lu+v8///L++v8///P/+v8v//P/+v9v//P/+v+fx/P/+v+Pk+P/+v/PN+f/+v/POuv/+v/Ofdv/+v/NvM//+v/I/Y//+v/k/k//+v/i/w//+v/7/6//+v//////+v//////+f//////9Wqqqqqql");
if (msg.id=="music") return atob("FhaBAH//+/////////////h/+AH/4Af/gB/+H3/7/f/v9/+/3/7+f/vB/w8H+Dwf4PD/x/////////////3//+A=");
if (msg.id=="back") return getBackImage();
if (msg.id==/*LANG*/"back") return getBackImage();
return getNotificationImage();
}
function getMessageImageCol(msg,def) {
@ -375,7 +375,7 @@ function checkMessages(options) {
if (msg && msg.new) g.setBgColor(colBg);
else g.setBgColor((idx&1) ? colSBg1 : colSBg2);
g.clearRect(r.x,r.y,r.x+r.w-1,r.y+r.h-1).setColor(g.theme.fg);
if (idx==0) msg = {id:"back", title:"< Back"};
if (idx==0) msg = {id:/*LANG*/"back", title:"< Back"};
if (!msg) return;
var x = r.x+2, title = msg.title, body = msg.body;
var img = getMessageImage(msg);

View File

@ -40,3 +40,5 @@
};
E.showMenu(mainmenu);
})
.showMenu(mainmenu);
})

View File

@ -39,3 +39,9 @@
E.showMenu(appMenu)
})
nu(appMenu)
})
nu)
})

View File

@ -46,3 +46,9 @@
E.showMenu(appMenu)
})
nu(appMenu)
})
nu)
})

View File

@ -15,4 +15,6 @@
},
'< Back': back,
})
})
})
})

View File

@ -29,7 +29,7 @@ function welcome() {
setWatch(() => {
clearInterval(i);
clearWatch();
E.showMessage('Loading...');
E.showMessage(/*LANG*/'Loading...');
res();
}, BTN2, {repeat:false});
});

View File

@ -32,7 +32,7 @@
"Date on touch": {
value: 0|numeralsSettings.showDate,
min:0,max:1,
format: v=>v?"On":"Off",
format: v=>v?"On":/*LANG*/"Off",
onchange: v=> { numeralsSettings.showDate=v; updateSettings();}
},
"< back": back

View File

@ -54,3 +54,7 @@
}
})
})
,
}
})
})

View File

@ -12,7 +12,7 @@ const SETTINGS_FILE = "pebble.json";
let settings;
function loadSettings() {
settings = require("Storage").readJSON(SETTINGS_FILE,1)|| {'bg': '#0f0', 'color': 'Green'};
settings = require("Storage").readJSON(SETTINGS_FILE,1)|| {'bg': '#0f0', /*LANG*/'color': 'Green'};
}
var img = require("heatshrink").decompress(atob("oFAwkEogA/AH4A/AH4A/AH4A/AE8AAAoeXoAfeDQUBmcyD7A+Dh///8QD649CiAfaHwUvD4sEHy0DDYIfEICg+Cn4fHICY+DD4nxcgojOHwgfEIAYfRCIQaDD4ZAFD5r7DH4//kAfRCIZ/GAAnwD5p9DX44fTHgYSBf4ofVDAQEBl4fFUAgfOXoQzBgIfFBAIfPP4RAEAoYAB+cRiK/SG4h/WIBAfXIA7CBAAswD55AHn6fUIBMCD65AHl4gCmcziAfQQJqfQQJpiDgk0IDXxQLRAEECaBM+QgRYRYgUIA0CD4ggSQJiDCiAKBICszAAswD55AHABKBVD7BAFABIqBD5pAFABPxD55AOD6BADiIAJQAyxLABwf/gaAPAH4A/AH4ARA=="));

View File

@ -36,3 +36,5 @@
}
});
})
});
})

View File

@ -12,7 +12,7 @@ const SETTINGS_FILE = "pebbleDistance.json";
let settings;
function loadSettings() {
settings = require("Storage").readJSON(SETTINGS_FILE,1)|| {'bg': '#0f0', 'color': 'Green', 'avStep': 0.75};
settings = require("Storage").readJSON(SETTINGS_FILE,1)|| {'bg': '#0f0', /*LANG*/'color': 'Green', 'avStep': 0.75};
}
var img = require("heatshrink").decompress(atob("oFAwkEogA/AH4A/AH4A/AH4A/AE8AAAoeXoAfeDQUBmcyD7A+Dh///8QD649CiAfaHwUvD4sEHy0DDYIfEICg+Cn4fHICY+DD4nxcgojOHwgfEIAYfRCIQaDD4ZAFD5r7DH4//kAfRCIZ/GAAnwD5p9DX44fTHgYSBf4ofVDAQEBl4fFUAgfOXoQzBgIfFBAIfPP4RAEAoYAB+cRiK/SG4h/WIBAfXIA7CBAAswD55AHn6fUIBMCD65AHl4gCmcziAfQQJqfQQJpiDgk0IDXxQLRAEECaBM+QgRYRYgUIA0CD4ggSQJiDCiAKBICszAAswD55AHABKBVD7BAFABIqBD5pAFABPxD55AOD6BADiIAJQAyxLABwf/gaAPAH4A/AH4ARA=="));

View File

@ -45,4 +45,7 @@
}
}
});
});
}
});
});

View File

@ -28,4 +28,5 @@
}},
};
E.showMenu(appMenu)
})E.showMenu(appMenu)
})

View File

@ -106,7 +106,7 @@ let mainLayout = new Layout({
type: 'txt',
font: '15%',
label: '00:00',
id: 'Timer',
id: /*LANG*/'Timer',
halign: 1,
pad: 3
}

View File

@ -58,7 +58,7 @@ var showMainMenu = () => {
showScrollerContainingAppsWithPatterns().then((selected) => {
var pattern = selected.pattern;
var appName = selected.appName;
if (pattern === "back") {
if (pattern === /*LANG*/"back") {
showMainMenu();
} else {
E.showPrompt(appName + "\n\npattern:\n" + pattern, {
@ -309,7 +309,7 @@ var showScrollerContainingAppsWithPatterns = () => {
},
select: (i) => {
log("selected: " + i);
var pattern = "back";
var pattern = /*LANG*/"back";
var appName = "";
if (i > 0) {
var storedPattern = storedPatternsArray[i - 1];

View File

@ -63,7 +63,7 @@ var startWith;
/* For development purposes
require('Storage').writeJSON(SETTINGSFILE, {
splashMode: "off",
splashMode: /*LANG*/"off",
startWith: "5x5",
});
/* */
@ -622,9 +622,9 @@ function framedText(text, x, y, textcol, framecol) {
}
// Show the splash screen at program start, call afterSplash afterwards.
// If spash mode is "off", call afterSplash directly.
// If spash mode is /*LANG*/"off", call afterSplash directly.
function showSplash(afterSplash) {
if (splashMode === "off")
if (splashMode === /*LANG*/"off")
afterSplash();
else {
g.reset();

View File

@ -47,4 +47,4 @@
});
// end of file
// end of file of file

View File

@ -269,3 +269,7 @@ function showEditTimerMenu(timerIndex) {
}
showMainMenu();
wMenu(menu);
}
showMainMenu();

View File

@ -267,3 +267,4 @@ function showOptionsMenu() {
loadSettings();
showMainMenu();
showMainMenu();

View File

@ -33,7 +33,7 @@ function loadLocation() {
}
function loadSettings() {
settings = require("Storage").readJSON(SETTINGS_FILE,1)|| {'bg': '#0f0', 'color': 'Green'};
settings = require("Storage").readJSON(SETTINGS_FILE,1)|| {'bg': '#0f0', /*LANG*/'color': 'Green'};
}
function extractTime(d){

View File

@ -36,3 +36,5 @@
}
});
})
});
})

View File

@ -305,7 +305,7 @@ function viewTrack(filename, info) {
g.drawString(require("locale").distance(dist),g.getWidth() / 2, g.getHeight() - 20);
g.setFont("6x8",2);
g.setFontAlign(0,0,3);
g.drawString("Back",g.getWidth() - 10, g.getHeight() - 40);
g.drawString(/*LANG*/"Back",g.getWidth() - 10, g.getHeight() - 40);
setWatch(function() {
viewTrack(info.fn, info);
}, global.BTN3||BTN1);
@ -404,7 +404,7 @@ function viewTrack(filename, info) {
});
g.setFont("6x8",2);
g.setFontAlign(0,0,3);
g.drawString("Back",g.getWidth() - 10, g.getHeight() - 40);
g.drawString(/*LANG*/"Back",g.getWidth() - 10, g.getHeight() - 40);
setWatch(function() {
viewTrack(info.filename, info);
}, global.BTN3||BTN1);

View File

@ -99,8 +99,8 @@
steps:function() {
var lastSteps = 0;
return {
name : "Steps",
fields : ["Steps"],
name : /*LANG*/"Steps",
fields : [/*LANG*/"Steps"],
getValues : () => {
var c = Bangle.getStepCount(), r=[c-lastSteps];
lastSteps = c;

View File

@ -217,3 +217,5 @@
});
})();
;
})();

View File

@ -50,7 +50,7 @@ let barMenu = {
"": { "title" : "- Barometer -" },
"State": {
value: settings.isBarEnabled,
format: v => v ? "On" : "Off",
format: v => v ? "On" : /*LANG*/"Off",
onchange: v => { updateSetting('isBarEnabled', v); }
},
"Altitude": { value: null },
@ -62,7 +62,7 @@ let gpsMenu = {
"": { "title" : "- GPS -" },
"State": {
value: settings.isGpsEnabled,
format: v => v ? "On" : "Off",
format: v => v ? "On" : /*LANG*/"Off",
onchange: v => { updateSetting('isGpsEnabled', v); }
},
"Lat": { value: null },
@ -76,7 +76,7 @@ let hrmMenu = {
"": { "title" : "- Heart Rate -" },
"State": {
value: settings.isHrmEnabled,
format: v => v ? "On" : "Off",
format: v => v ? "On" : /*LANG*/"Off",
onchange: v => { updateSetting('isHrmEnabled', v); }
},
"BPM": { value: null },
@ -87,7 +87,7 @@ let magMenu = {
"": { "title" : "- Magnetometer -" },
"State": {
value: settings.isMagEnabled,
format: v => v ? "On" : "Off",
format: v => v ? "On" : /*LANG*/"Off",
onchange: v => { updateSetting('isMagEnabled', v); }
},
"x": { value: null },

View File

@ -704,7 +704,7 @@ function showAppSettings(app) {
return showError(/*LANG*/'Invalid settings');
}
try {
// pass showAppSettingsMenu as "back" argument
// pass showAppSettingsMenu as /*LANG*/"back" argument
appSettings(()=>showAppSettingsMenu());
} catch (e) {
console.log(`${app.name} settings error:`, e)
@ -713,3 +713,8 @@ function showAppSettings(app) {
}
showMainMenu();
tings');
}
}
showMainMenu();

View File

@ -116,7 +116,7 @@ function drawLabels() {
g.setFont("6x8", 1);
g.drawString("Reset (re)start", 230, 120);
if (state != "started") // only when not runnung
g.drawString("Back", 230, 120);
g.drawString(/*LANG*/"Back", 230, 120);
}
function resetTimer(value) {

View File

@ -68,7 +68,7 @@ function drawApp() {
if (alarmHour < 10) alarmHour = "0" + alarmHour;
if (alarmMinute < 10) alarmMinute = "0" + alarmMinute;
const s = "Alarm at " + alarmHour + ":" + alarmMinute + "\n\n"; //# make distinct to time
E.showMessage(s, "Sleep Phase Alarm");
E.showMessage(s, /*LANG*/"Sleep Phase Alarm");
function drawTime() {
if (Bangle.isLCDOn()) {
@ -125,7 +125,7 @@ if (nextAlarm !== undefined) {
if (swest !== undefined) {
if (Bangle.isLCDOn()) {
drawString(swest ? "Sleep" : "Awake", BANGLEJS2 ? 150 : 180); //# remove x, adjust height
drawString(swest ? /*LANG*/"Sleep" : "Awake", BANGLEJS2 ? 150 : 180); //# remove x, adjust height
}
}

View File

@ -35,7 +35,7 @@ function findDevices() {
m[dev.id.substr(0,17)] = () => startConnectChoose(dev);
});
m["Search again"] = () => findDevices();
m["Back"] = () => load();
m[/*LANG*/"Back"] = () => load();
E.showMenu(m);
}
}, {timeout : 2000, filters : [{ name : "Espruino SMARTIBOT" }] });
@ -46,7 +46,7 @@ function startConnectChoose(device) {
"": {title:"Control Method"},
"Accelerometer" : () => startConnectAccel(device),
"Button" : () => startConnectBtn(device),
"Back": () => load(),
/*LANG*/"Back": () => load(),
});
}
@ -57,7 +57,7 @@ function startConnectBtn(device) {
function(gatt, write) {
function setMotors(val) { write(`\x10w(${val})\n`); }
drawBGBtn();
g.reset().setFont("6x8",2).setFontAlign(0,0,1).drawString("BACK", 230,200);
g.reset().setFont("6x8",2).setFontAlign(0,0,1).drawString(/*LANG*/"BACK", 230,200);
var state = 0;
var watches = [
setWatch(e=>setMotors(state = (state&0b0011) | (e.state<<2)), BTN4, {repeat:true, edge:0}),
@ -81,7 +81,7 @@ function startConnectAccel(device) {
"\x03\x10function w(x,y,z,v){var a=analogWrite;a(D4,x);a(D6,y);a(D10,z);a(D11,v);}\n",
function(gatt, write) {
drawBGAccel();
g.reset().setFont("6x8",2).setFontAlign(0,0,1).drawString("BACK", 230,200);
g.reset().setFont("6x8",2).setFontAlign(0,0,1).drawString(/*LANG*/"BACK", 230,200);
Bangle.on("accel", function(a) {
var v = [0,0,0,0];
if (a.z<-0.5) {

View File

@ -35,7 +35,7 @@ function loadPage(page) {
g.setFont("Vector", 15);
g.drawString(page.name, g.getWidth() / 2, 200);
g.setFont("Vector", 40);
g.drawString(page.state ? "On" : "Off", g.getWidth() / 2, g.getHeight() / 2);
g.drawString(page.state ? "On" : /*LANG*/"Off", g.getWidth() / 2, g.getHeight() / 2);
g.drawImage(storage.read(`${icon}.img`), g.getWidth() / 2 - 24, g.getHeight() / 2 - 24 - 50);
}

View File

@ -268,7 +268,7 @@ const settingsMenu = {
"": { title: "Settings" },
"Active Mode": {
value: settings.activeMode,
format: (v) => (v ? "On" : "Off"),
format: (v) => (v ? "On" : /*LANG*/"Off"),
onchange: (v) => (settings.activeMode = v),
},
"Twist Thresh": {

View File

@ -87,3 +87,6 @@
E.showMenu(appMenu);
});
showMenu(appMenu);
});

Some files were not shown because too many files have changed in this diff Show More