add more /*LANG*/ to some of the most installed apps

pull/2343/head
thyttan 2022-12-01 21:03:15 +01:00
parent 1bb9b68e6a
commit 481ddb6a22
17 changed files with 101 additions and 33 deletions

View File

@ -11,3 +11,4 @@
0.11: Bangle.js2: New pixels, btn1 to exit 0.11: Bangle.js2: New pixels, btn1 to exit
0.12: Actual pixels as of 29th Nov 2021 0.12: Actual pixels as of 29th Nov 2021
0.13: Bangle.js 2: Use setUI to add software back button 0.13: Bangle.js 2: Use setUI to add software back button
0.14: Add automatic translation of more strings

View File

@ -11,8 +11,8 @@ g.drawString("BANGLEJS.COM",120,y-4);
} else { } else {
y=-(4+h); // small screen, start right at top y=-(4+h); // small screen, start right at top
} }
g.drawString("Powered by Espruino",0,y+=4+h); g.drawString(/*LANG*/"Powered by Espruino",0,y+=4+h);
g.drawString("Version "+ENV.VERSION,0,y+=h); g.drawString(/*LANG*/"Version "+ENV.VERSION,0,y+=h);
g.drawString("Commit "+ENV.GIT_COMMIT,0,y+=h); g.drawString("Commit "+ENV.GIT_COMMIT,0,y+=h);
function getVersion(name,file) { function getVersion(name,file) {
var j = s.readJSON(file,1); var j = s.readJSON(file,1);
@ -24,9 +24,9 @@ getVersion("Launcher","launch.info");
getVersion("Settings","setting.info"); getVersion("Settings","setting.info");
y+=h; y+=h;
g.drawString(MEM.total+" JS Variables available",0,y+=h); g.drawString(MEM.total+/*LANG*/" JS Variables available",0,y+=h);
g.drawString("Storage: "+(require("Storage").getFree()>>10)+"k free",0,y+=h); g.drawString("Storage: "+(require("Storage").getFree()>>10)+/*LANG*/"k free",0,y+=h);
if (ENV.STORAGE) g.drawString(" "+(ENV.STORAGE>>10)+"k total",0,y+=h); if (ENV.STORAGE) g.drawString(" "+(ENV.STORAGE>>10)+/*LANG*/"k total",0,y+=h);
if (ENV.SPIFLASH) g.drawString("SPI Flash: "+(ENV.SPIFLASH>>10)+"k",0,y+=h); if (ENV.SPIFLASH) g.drawString("SPI Flash: "+(ENV.SPIFLASH>>10)+"k",0,y+=h);
g.setFontAlign(0,-1); g.setFontAlign(0,-1);
g.flip(); g.flip();

View File

@ -35,17 +35,17 @@ function drawInfo() {
g.setFont("4x6").setFontAlign(0,0).drawString("BANGLEJS.COM",W-30,56); g.setFont("4x6").setFontAlign(0,0).drawString("BANGLEJS.COM",W-30,56);
var h=8, y = 24-h; var h=8, y = 24-h;
g.setFont("6x8").setFontAlign(-1,-1); g.setFont("6x8").setFontAlign(-1,-1);
g.drawString("Powered by Espruino",0,y+=4+h); g.drawString(/*LANG*/"Powered by Espruino",0,y+=4+h);
g.drawString("Version "+ENV.VERSION,0,y+=h); g.drawString(/*LANG*/"Version "+ENV.VERSION,0,y+=h);
g.drawString("Commit "+ENV.GIT_COMMIT,0,y+=h); g.drawString("Commit "+ENV.GIT_COMMIT,0,y+=h);
getVersion("Bootloader","boot.info"); getVersion("Bootloader","boot.info");
getVersion("Launcher","launch.info"); getVersion("Launcher","launch.info");
getVersion("Settings","setting.info"); getVersion("Settings","setting.info");
g.drawString(MEM.total+" JS Vars",0,y+=h); g.drawString(MEM.total+/*LANG*/" JS Vars",0,y+=h);
g.drawString("Storage: "+(require("Storage").getFree()>>10)+"k free",0,y+=h); g.drawString("Storage: "+(require("Storage").getFree()>>10)+/*LANG*/"k free",0,y+=h);
if (ENV.STORAGE) g.drawString(" "+(ENV.STORAGE>>10)+"k total",0,y+=h); if (ENV.STORAGE) g.drawString(" "+(ENV.STORAGE>>10)+/*LANG*/"k total",0,y+=h);
if (ENV.SPIFLASH) g.drawString("SPI Flash: "+(ENV.SPIFLASH>>10)+"k",0,y+=h); if (ENV.SPIFLASH) g.drawString("SPI Flash: "+(ENV.SPIFLASH>>10)+"k",0,y+=h);
imageTop = y+h; imageTop = y+h;
imgScroll = imgHeight-imageTop; imgScroll = imgHeight-imageTop;

View File

@ -1,7 +1,7 @@
{ {
"id": "about", "id": "about",
"name": "About", "name": "About",
"version": "0.13", "version": "0.14",
"description": "Bangle.js About page - showing software version, stats, and a collaborative mural from the Bangle.js KickStarter backers", "description": "Bangle.js About page - showing software version, stats, and a collaborative mural from the Bangle.js KickStarter backers",
"icon": "app.png", "icon": "app.png",
"tags": "tool,system", "tags": "tool,system",

View File

@ -35,4 +35,5 @@
Add option for auto-delete a timer after it expires Add option for auto-delete a timer after it expires
0.33: Allow hiding timers&alarms 0.33: Allow hiding timers&alarms
0.34: Add "Confirm" option to alarm/timer edit menus 0.34: Add "Confirm" option to alarm/timer edit menus
0.35: Add automatic translation of more strings

View File

@ -183,7 +183,7 @@ function decodeDOW(alarm) {
.map((day, index) => alarm.dow & (1 << (index + firstDayOfWeek)) ? day : "_") .map((day, index) => alarm.dow & (1 << (index + firstDayOfWeek)) ? day : "_")
.join("") .join("")
.toLowerCase() .toLowerCase()
: "Once" : /*LANG*/"Once"
} }
function showEditRepeatMenu(repeat, dow, dowChangeCallback) { function showEditRepeatMenu(repeat, dow, dowChangeCallback) {

View File

@ -2,7 +2,7 @@
"id": "alarm", "id": "alarm",
"name": "Alarms & Timers", "name": "Alarms & Timers",
"shortName": "Alarms", "shortName": "Alarms",
"version": "0.34", "version": "0.35",
"description": "Set alarms and timers on your Bangle", "description": "Set alarms and timers on your Bangle",
"icon": "app.png", "icon": "app.png",
"tags": "tool,alarm,widget", "tags": "tool,alarm,widget",

View File

@ -15,3 +15,4 @@
0.14: Move settings 0.14: Move settings
0.15: Fix charts (fix #1366) 0.15: Fix charts (fix #1366)
0.16: Code tidyup, add back button in top left of health app graphs 0.16: Code tidyup, add back button in top left of health app graphs
0.17: Add automatic translation of bar chart labels

View File

@ -41,7 +41,7 @@ function stepsPerHour() {
var data = new Uint16Array(24); var data = new Uint16Array(24);
require("health").readDay(new Date(), h=>data[h.hr]+=h.steps); require("health").readDay(new Date(), h=>data[h.hr]+=h.steps);
setButton(menuStepCount); setButton(menuStepCount);
barChart("HOUR", data); barChart(/*LANG*/"HOUR", data);
} }
function stepsPerDay() { function stepsPerDay() {
@ -49,7 +49,7 @@ function stepsPerDay() {
var data = new Uint16Array(31); var data = new Uint16Array(31);
require("health").readDailySummaries(new Date(), h=>data[h.day]+=h.steps); require("health").readDailySummaries(new Date(), h=>data[h.day]+=h.steps);
setButton(menuStepCount); setButton(menuStepCount);
barChart("DAY", data); barChart(/*LANG*/"DAY", data);
} }
function hrmPerHour() { function hrmPerHour() {
@ -62,7 +62,7 @@ function hrmPerHour() {
}); });
data.forEach((d,i)=>data[i] = d/cnt[i]); data.forEach((d,i)=>data[i] = d/cnt[i]);
setButton(menuHRM); setButton(menuHRM);
barChart("HOUR", data); barChart(/*LANG*/"HOUR", data);
} }
function hrmPerDay() { function hrmPerDay() {
@ -75,7 +75,7 @@ function hrmPerDay() {
}); });
data.forEach((d,i)=>data[i] = d/cnt[i]); data.forEach((d,i)=>data[i] = d/cnt[i]);
setButton(menuHRM); setButton(menuHRM);
barChart("DAY", data); barChart(/*LANG*/"DAY", data);
} }
function movementPerHour() { function movementPerHour() {
@ -83,7 +83,7 @@ function movementPerHour() {
var data = new Uint16Array(24); var data = new Uint16Array(24);
require("health").readDay(new Date(), h=>data[h.hr]+=h.movement); require("health").readDay(new Date(), h=>data[h.hr]+=h.movement);
setButton(menuMovement); setButton(menuMovement);
barChart("HOUR", data); barChart(/*LANG*/"HOUR", data);
} }
function movementPerDay() { function movementPerDay() {
@ -91,7 +91,7 @@ function movementPerDay() {
var data = new Uint16Array(31); var data = new Uint16Array(31);
require("health").readDailySummaries(new Date(), h=>data[h.day]+=h.movement); require("health").readDailySummaries(new Date(), h=>data[h.day]+=h.movement);
setButton(menuMovement); setButton(menuMovement);
barChart("DAY", data); barChart(/*LANG*/"DAY", data);
} }
// Bar Chart Code // Bar Chart Code
@ -163,7 +163,7 @@ function setButton(fn) {
swipe:(lr,ud) => { swipe:(lr,ud) => {
if (lr == 1) { if (lr == 1) {
// HOUR data starts at index 0, DAY data starts at index 1 // HOUR data starts at index 0, DAY data starts at index 1
chart_index = Math.max((chart_label == "DAY") ? -3 : -4, chart_index - 1); chart_index = Math.max((chart_label == /*LANG*/"DAY") ? -3 : -4, chart_index - 1);
} else if (lr<0) { } else if (lr<0) {
chart_index = Math.min(data_len - 5, chart_index + 1); chart_index = Math.min(data_len - 5, chart_index + 1);
} else { } else {

View File

@ -1,7 +1,7 @@
{ {
"id": "health", "id": "health",
"name": "Health Tracking", "name": "Health Tracking",
"version": "0.16", "version": "0.17",
"description": "Logs health data and provides an app to view it", "description": "Logs health data and provides an app to view it",
"icon": "app.png", "icon": "app.png",
"tags": "tool,system,health", "tags": "tool,system,health",

View File

@ -15,3 +15,4 @@
Fix wrong fallback for buzz pattern Fix wrong fallback for buzz pattern
0.13: Ask to delete a timer after stopping it 0.13: Ask to delete a timer after stopping it
0.14: Added clkinfo for alarms and timers 0.14: Added clkinfo for alarms and timers
0.15: Automatic translation of some string in clkinfo

View File

@ -31,7 +31,7 @@
function getAlarmText(a){ function getAlarmText(a){
if(a.timer) { if(a.timer) {
if(!a.on) return "off"; if(!a.on) return /*LANG*/"off";
let time = Math.round(alarm.getTimeToAlarm(a)/(60*1000)); let time = Math.round(alarm.getTimeToAlarm(a)/(60*1000));
if(time > 60) if(time > 60)
time = Math.round(time / 60) + "h"; time = Math.round(time / 60) + "h";
@ -52,7 +52,7 @@
var img = iconAlarmOn; var img = iconAlarmOn;
//get only alarms not created by other apps //get only alarms not created by other apps
var alarmItems = { var alarmItems = {
name: "Alarms", name: /*LANG*/"Alarms",
img: img, img: img,
dynamic: true, dynamic: true,
items: alarm.getAlarms().filter(a=>!a.appid) items: alarm.getAlarms().filter(a=>!a.appid)

View File

@ -1,7 +1,7 @@
{ {
"id": "sched", "id": "sched",
"name": "Scheduler", "name": "Scheduler",
"version": "0.14", "version": "0.15",
"description": "Scheduling library for alarms and timers", "description": "Scheduling library for alarms and timers",
"icon": "app.png", "icon": "app.png",
"type": "scheduler", "type": "scheduler",

62
apps/setting/' Normal file
View File

@ -0,0 +1,62 @@
0.02: Add support for 30-minute timezones.
0.03: Add support for Welcome app
0.04: Add setting to disable log messages
0.05: Fix Settings json
0.06: Remove distance setting as there's a separate app for Locale now
0.07: Added vibrate as beep workaround
0.08: Add support for app/widget settings
0.09: Move Welcome into App/widget settings
0.10: Added LCD wake-up settings
Adds LCD brightness setting
0.11: Make LCD brightness work after leaving settings
0.12: Fix memory leak (#206)
Bring App settings nearer the top
Move LCD Timeout to wakeup menu
0.13: Fix memory leak for App settings
Make capitalization more consistent
Move LCD Brightness menu into more general LCD menu
0.14: Reduce memory usage when running app settings page
0.15: Reduce memory usage when running default clock chooser (#294)
0.16: Reduce memory usage further when running app settings page
0.17: Remove need for "settings" in appid.info
0.18: Don't overwrite existing settings on app update
0.19: Allow BLE HID settings, add README.md
0.20: Fix set time menu, allow dates to roll over
0.21: Add passkey pairing option (BETA)
Add whitelist option (fix #78)
0.22: Move HID to BLE menu
0.23: Change max time offset to 13 for NZ summer daylight time (NZDT)
0.24: Add Quiet Mode settings
0.25: Move boot.js code into 'boot' app itself
0.26: Use Bangle.softOff if available as this keeps the time
0.27: Add Theme menu
0.28: Update Quiet Mode widget (if present)
0.29: Add Customize to Theme menu
0.30: Move '< Back' to the top of menus
0.31: Remove Bangle 1 settings when running on Bangle 2
0.32: Fix 'beep' menu on Bangle.js 2
0.33: Really fix 'beep' menu on Bangle.js 2 this time
0.34: Remove Quiet Mode LCD settings: now handled by Quiet Mode Schedule app
0.35: Change App/Widget settings to 'App Settings' so it fits on Bangle screen
0.36: Added 'Utils' menu with helpful utilities for restoring Bangle.js
0.37: Going into passkey menu now saves settings with passkey
0.38: Restructed menus as per forum discussion
0.39: Fix misbehaving debug info option
0.40: Moved off into Utils, put System after Apps
0.41: Stop users disabling all wake-up methods and locking themselves out (fix #1272)
0.42: Fix theme customizer on new Bangle 2 firmware
0.43: Add some Bangle 1 colours to theme customizer
0.44: Add "Start Week On X" option (#1780)
UI improvements to Locale and Date & Time menu
0.45: Add calibrate battery option
0.46: Fix regression after making 'calibrate battery' only for Bangle.js 2
0.47: Allow colors to be translated
Improve "Turn Off" user experience
0.48: Allow reading custom themes from files
0.49: Now reloads settings properly after 'Calibrate Battery'
0.50: Add Bangle.js 2 touchscreen calibration - for 2v16 or 2v15 cutting edge builds
0.51: Add setting for configuring a launcher
0.52: Add option for left-handed users
0.53: Ensure that when clock is set, clockHasWidgets is set correctly too
0.54: If setting.json is corrupt, ensure it gets re-written
0.55: More strings tagged for automatic translation.

View File

@ -59,3 +59,4 @@
0.52: Add option for left-handed users 0.52: Add option for left-handed users
0.53: Ensure that when clock is set, clockHasWidgets is set correctly too 0.53: Ensure that when clock is set, clockHasWidgets is set correctly too
0.54: If setting.json is corrupt, ensure it gets re-written 0.54: If setting.json is corrupt, ensure it gets re-written
0.55: More strings tagged for automatic translation.

View File

@ -1,7 +1,7 @@
{ {
"id": "setting", "id": "setting",
"name": "Settings", "name": "Settings",
"version": "0.54", "version": "0.55",
"description": "A menu for setting up Bangle.js", "description": "A menu for setting up Bangle.js",
"icon": "settings.png", "icon": "settings.png",
"tags": "tool,system", "tags": "tool,system",

View File

@ -146,7 +146,7 @@ function showAlertsMenu() {
}, },
/*LANG*/"Quiet Mode": { /*LANG*/"Quiet Mode": {
value: settings.quiet|0, value: settings.quiet|0,
format: v => ["Off", "Alarms", "Silent"][v%3], format: v => [/*LANG*/"Off", /*LANG*/"Alarms", /*LANG*/"Silent"][v%3],
onchange: v => { onchange: v => {
settings.quiet = v%3; settings.quiet = v%3;
updateSettings(); updateSettings();
@ -162,9 +162,9 @@ function showAlertsMenu() {
function showBLEMenu() { function showBLEMenu() {
var hidV = [false, "kbmedia", "kb", "com", "joy"]; var hidV = [false, "kbmedia", "kb", "com", "joy"];
var hidN = ["Off", "Kbrd & Media", "Kbrd", "Kbrd & Mouse" ,"Joystick"]; var hidN = [/*LANG*/"Off", /*LANG*/"Kbrd & Media", /*LANG*/"Kbrd", /*LANG*/"Kbrd & Mouse", /*LANG*/"Joystick"];
E.showMenu({ E.showMenu({
'': { 'title': 'Bluetooth' }, '': { 'title': /*LANG*/'Bluetooth' },
'< Back': ()=>showMainMenu(), '< Back': ()=>showMainMenu(),
/*LANG*/'Make Connectable': ()=>makeConnectable(), /*LANG*/'Make Connectable': ()=>makeConnectable(),
/*LANG*/'BLE': { /*LANG*/'BLE': {
@ -193,11 +193,11 @@ function showBLEMenu() {
} }
}, },
/*LANG*/'Passkey BETA': { /*LANG*/'Passkey BETA': {
value: settings.passkey?settings.passkey:"none", value: settings.passkey?settings.passkey:/*LANG*/"none",
onchange: () => setTimeout(showPasskeyMenu) // graphical_menu redraws after the call onchange: () => setTimeout(showPasskeyMenu) // graphical_menu redraws after the call
}, },
/*LANG*/'Whitelist': { /*LANG*/'Whitelist': {
value: settings.whitelist?(settings.whitelist.length+" devs"):"off", value: settings.whitelist?(settings.whitelist.length+/*LANG*/" devs"):/*LANG*/"off",
onchange: () => setTimeout(showWhitelistMenu) // graphical_menu redraws after the call onchange: () => setTimeout(showWhitelistMenu) // graphical_menu redraws after the call
} }
}); });
@ -606,7 +606,7 @@ function showUtilMenu() {
menu[/*LANG*/'Reset Settings'] = () => { menu[/*LANG*/'Reset Settings'] = () => {
E.showPrompt(/*LANG*/'Reset to Defaults?',{title:/*LANG*/"Settings"}).then((v) => { E.showPrompt(/*LANG*/'Reset to Defaults?',{title:/*LANG*/"Settings"}).then((v) => {
if (v) { if (v) {
E.showMessage('Resetting'); E.showMessage(/*LANG*/'Resetting');
resetSettings(); resetSettings();
setTimeout(showMainMenu, 50); setTimeout(showMainMenu, 50);
} else showUtilMenu(); } else showUtilMenu();
@ -824,6 +824,7 @@ function showAppSettings(app) {
function showTouchscreenCalibration() { function showTouchscreenCalibration() {
Bangle.setUI(); Bangle.setUI();
require('widget_utils').hide();
// disable touchscreen calibration (passed coords right through) // disable touchscreen calibration (passed coords right through)
Bangle.setOptions({touchX1: 0, touchY1: 0, touchX2: g.getWidth(), touchY2: g.getHeight() }); Bangle.setOptions({touchX1: 0, touchY1: 0, touchX2: g.getWidth(), touchY2: g.getHeight() });
@ -847,7 +848,7 @@ function showTouchscreenCalibration() {
g.drawLine(spot[0],spot[1]-32,spot[0],spot[1]+32); g.drawLine(spot[0],spot[1]-32,spot[0],spot[1]+32);
g.drawCircle(spot[0],spot[1], 16); g.drawCircle(spot[0],spot[1], 16);
var tapsLeft = (1-currentTry)*4+(4-currentCorner); var tapsLeft = (1-currentTry)*4+(4-currentCorner);
g.setFont("6x8:2").setFontAlign(0,0).drawString(tapsLeft+" taps\nto go", g.getWidth()/2, g.getHeight()/2); g.setFont("6x8:2").setFontAlign(0,0).drawString(tapsLeft+/*LANG*/" taps\nto go", g.getWidth()/2, g.getHeight()/2);
} }
function calcCalibration() { function calcCalibration() {
@ -870,7 +871,7 @@ function showTouchscreenCalibration() {
var s = storage.readJSON("setting.json",1)||{}; var s = storage.readJSON("setting.json",1)||{};
s.touch = calib; s.touch = calib;
storage.writeJSON("setting.json",s); storage.writeJSON("setting.json",s);
g.setFont("6x8:2").setFontAlign(0,0).drawString("Calibrated!", g.getWidth()/2, g.getHeight()/2); g.setFont("6x8:2").setFontAlign(0,0).drawString(/*LANG*/"Calibrated!", g.getWidth()/2, g.getHeight()/2);
// now load the main menu again // now load the main menu again
setTimeout(showLCDMenu, 500); setTimeout(showLCDMenu, 500);
} }