Merge remote-tracking branch 'upstream/master'

pull/272/head
Marco Heiming 2020-04-09 14:39:26 +02:00
commit 836cf48d53
5 changed files with 141 additions and 119 deletions

View File

@ -786,7 +786,7 @@
{ "id": "widpedom",
"name": "Pedometer widget",
"icon": "widget.png",
"version":"0.09",
"version":"0.10",
"description": "Daily pedometer widget",
"tags": "widget",
"type":"widget",

View File

@ -1,15 +1,15 @@
/* jshint esversion: 6 */
const distanceUnits = { // how many meters per X?
"m" : 1,
"yd" : 0.9144,
"mi" : 1609.34,
"km" : 1000,
"kmi" : 1000
"m": 1,
"yd": 0.9144,
"mi": 1609.34,
"km": 1000,
"kmi": 1000
};
const speedUnits = { // how many kph per X?
"kmh" : 1,
"kph" : 1,
"mph" : 1.60934
"kmh": 1,
"kph": 1,
"mph": 1.60934
};
/*
@ -33,23 +33,23 @@ timePattern / datePattern:
*/
var locales = {
"en_GB": { // this is default
lang: "en_GB",
decimal_point: ".",
thousands_sep: ",",
currency_symbol: "£", currency_first:true,
int_curr_symbol: "GBP",
speed: 'mph',
distance: { "0": "yd", "1": "mi" },
temperature: '°C',
ampm: {0:"am",1:"pm"},
timePattern: { 0: "%HH:%MM:%SS ", 1: "%HH:%MM" },
datePattern: { 0: "%b %d %Y", 1: "%d/%m/%Y" }, // Feb 28 2020" // "01/03/2020"(short)
abmonth: "Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec",
month: "January,February,March,April,May,June,July,August,September,October,November,December",
abday: "Sun,Mon,Tue,Wed,Thu,Fri,Sat",
day: "Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday",
// No translation for english...
"en_GB": { // this is default
lang: "en_GB",
decimal_point: ".",
thousands_sep: ",",
currency_symbol: "£", currency_first: true,
int_curr_symbol: "GBP",
speed: 'mph',
distance: { "0": "yd", "1": "mi" },
temperature: '°C',
ampm: { 0: "am", 1: "pm" },
timePattern: { 0: "%HH:%MM:%SS ", 1: "%HH:%MM" },
datePattern: { 0: "%b %d %Y", 1: "%d/%m/%Y" }, // Feb 28 2020" // "01/03/2020"(short)
abmonth: "Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec",
month: "January,February,March,April,May,June,July,August,September,October,November,December",
abday: "Sun,Mon,Tue,Wed,Thu,Fri,Sat",
day: "Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday",
// No translation for english...
},
"de_DE": {
lang: "de_DE",
@ -60,24 +60,25 @@ var locales = {
speed: "kmh",
distance: { 0: "m", 1: "km" },
temperature: "°C",
ampm: {0:"",1:""},
ampm: { 0: "", 1: "" },
timePattern: { 0: "%HH:%MM:%SS", 1: "%HH:%MM" },
datePattern: { 0: "%A, %d. %B %Y", "1": "%d.%m.%Y" }, // Sonntag, 1. März 2020 // 01.01.20
abmonth: "Jan,Feb,Mär,Apr,Mai,Jun,Jul,Aug,Sep,Okt,Nov,Dez",
month: "Januar,Februar,März,April,Mai,Juni,Juli,August,September,Oktober,November,Dezember",
abday: "So,Mo,Di,Mi,Do,Fr,Sa",
day: "Sonntag,Montag,Dienstag,Mittwoch,Donnerstag,Freitag,Samstag",
trans: { yes: "ja", Yes: "Ja", no: "nein", No: "Nein", ok: "ok", on: "an", off: "aus" }},
trans: { yes: "ja", Yes: "Ja", no: "nein", No: "Nein", ok: "ok", on: "an", off: "aus" }
},
"en_US": {
lang: "en_US",
decimal_point: ".",
thousands_sep: ",",
currency_symbol: "$", currency_first:true,
currency_symbol: "$", currency_first: true,
int_curr_symbol: "USD",
speed: "mph",
distance: { 0: "yd", 1: "mi" },
temperature: "°F",
ampm: {0:"am",1:"pm"},
ampm: { 0: "am", 1: "pm" },
timePattern: { 0: "%HH:%MM:%SS ", 1: "%HH:%MM" },
datePattern: { 0: "", 1: "%m/%d/%y" },
abmonth: "Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec",
@ -95,7 +96,7 @@ var locales = {
speed: "kmh",
distance: { 0: "m", 1: "km" },
temperature: "°F",
ampm: {0:"",1:""},
ampm: { 0: "", 1: "" },
timePattern: { 0: "%HH:%MM:%SS ", 1: "%HH:%MM" },
datePattern: { 0: "%y/%M/%d", 1: "%y/%m;/%d" },
abmonth: "Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec",
@ -113,7 +114,7 @@ var locales = {
speed: "kmh",
distance: { 0: "m", 1: "km" },
temperature: "°C",
ampm: {0:"",1:""},
ampm: { 0: "", 1: "" },
timePattern: { 0: "%HH:%MM:%SS", 1: "%HH:%MM" },
datePattern: { 0: "%A %B %d %Y", 1: "%d.%m.%y" }, // zondag 1 maart 2020 // 01.01.20
abday: "zo,ma,di,wo,do,vr,za",
@ -131,7 +132,7 @@ var locales = {
speed: "mph",
distance: { 0: "mi", 1: "kmi" },
temperature: "°F",
ampm: {0:"am",1:"pm"},
ampm: { 0: "am", 1: "pm" },
timePattern: { 0: "%HH:%MM:%SS ", 1: "%HH:%MM" },
datePattern: { 0: "%A, %B %d, %Y", "1": "%Y-%m-%d" }, // Sunday, March 1, 2020 // 2012-12-20
abmonth: "Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec",
@ -149,14 +150,15 @@ var locales = {
speed: "kmh",
distance: { 0: "m", 1: "km" },
temperature: "°C",
ampm: {0:"",1:""},
ampm: { 0: "", 1: "" },
timePattern: { 0: "%HH:%MM:%SS ", 1: "%HH:%MM" },
datePattern: { 0: "%A %d %B %Y", "1": "%d/%m/%Y" }, // dimanche 1 mars 2020 // 01/03/2020
abmonth: "janv,févr,mars,avril,mai,juin,juil,août,sept,oct,nov,déc",
month: "janvier,février,mars,avril,mai,juin,juillet,août,septembre,octobre,novembre,décembre",
abday: "dim,lun,mar,mer,jeu,ven,sam",
day: "dimanche,lundi,mardi,mercredi,jeudi,vendredi,samedi",
trans : { yes : "oui", Yes: "Oui", no: "no", No: "No", ok : "ok", on: "on", off: "off" }},
trans: { yes: "oui", Yes: "Oui", no: "no", No: "No", ok: "ok", on: "on", off: "off" }
},
"sv_SE": {
lang: "sv_SE",
decimal_point: ",",
@ -166,14 +168,15 @@ var locales = {
speed: "kmh",
distance: { 0: "m", 1: "km" },
temperature: "°C",
ampm: {0:"fm",1:"em"},
ampm: { 0: "fm", 1: "em" },
timePattern: { 0: "%HH:%MM:%SS ", 1: "%HH:%MM" },
datePattern: { 0: "%A %B %d %Y", "1": "%Y-%m-%d" }, // söndag 1 mars 2020 // 2020-03-01
abmonth: "jan,feb,mars,apr,maj,juni,juli,aug,sep,okt,nov,dec",
month: "januari,februari,mars,april,maj,juni,juli,augusti,september,oktober,november,december",
abday: "sön,mån,tis,ons,tors,fre,lör",
day: "söndag,måndag,tisdag,onsdag,torsdag,fredag,lördag",
trans : { yes : "ja", Yes: "Ja", no: "nej", No: "Nej", ok : "ok", on: "on", off: "off" }},
abmonth: "jan,feb,mars,apr,maj,juni,juli,aug,sep,okt,nov,dec",
month: "januari,februari,mars,april,maj,juni,juli,augusti,september,oktober,november,december",
abday: "sön,mån,tis,ons,tors,fre,lör",
day: "söndag,måndag,tisdag,onsdag,torsdag,fredag,lördag",
trans: { yes: "ja", Yes: "Ja", no: "nej", No: "Nej", ok: "ok", on: "on", off: "off" }
},
"en_AU": {
lang: "en_AU",
decimal_point: ".",
@ -183,7 +186,7 @@ var locales = {
speed: "mph",
distance: { 0: "mi", 1: "kmi" },
temperature: "°F",
ampm: {0:"am",1:"pm"},
ampm: { 0: "am", 1: "pm" },
timePattern: { 0: "%HH:%MM:%SS ", 1: "%HH:%MM" },
datePattern: { 0: "%A, %B %d, %Y", "1": "%m/%d/%y" }, // Sunday, 1 March 2020 // 1/3/20
abmonth: "Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec",
@ -201,13 +204,14 @@ var locales = {
speed: "kmh",
distance: { 0: "m", 1: "km" },
temperature: "°C",
timePattern: { 0: "%HH:%MM:%SS ", 1: "%HH:%MM" },
timePattern: { 0: "%HH:%MM:%SS ", 1: "%HH:%MM" },
datePattern: { 0: "%A, %d. %B %Y", "1": "%d.%m.%y" }, // Sonntag, 1. März 2020 // 01.03.20
abmonth: "Jän,Feb,März,Apr,Mai,Jun,Jul,Aug,Sep,Okt,Nov,Dez",
month: "Jänner,Februar,März,April,Mai,Juni,Juli,August,September,Oktober,November,Dezember",
abday: "So,Mo,Di,Mi,Do,Fr,Sa",
day: "Sonntag,Montag,Dienstag,Mittwoch,Donnerstag,Freitag,Samstag",
trans: { yes: "ja", Yes: "Ja", no: "nein", No: "Nein", ok: "ok", on: "an", off: "aus" }},
trans: { yes: "ja", Yes: "Ja", no: "nein", No: "Nein", ok: "ok", on: "an", off: "aus" }
},
"en_IL": {
lang: "en_IL",
decimal_point: ",",
@ -217,7 +221,7 @@ var locales = {
speed: "kmh",
distance: { 0: "m", 1: "km" },
temperature: "°F",
ampm: {0:"am",1:"pm"},
ampm: { 0: "am", 1: "pm" },
timePattern: { 0: "%HH:%MM:%SS ", 1: "%HH:%MM" },
datePattern: { 0: "%A, %B %d, %Y", "1": "%d/%m/%Y" }, // Sunday, 1 March 2020 // 01/03/2020
abmonth: "Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec",
@ -235,14 +239,15 @@ var locales = {
speed: "kmh",
distance: { 0: "m", 1: "km" },
temperature: "°C",
ampm: {0:"",1:""},
ampm: { 0: "", 1: "" },
timePattern: { 0: "%HH:%MM:%SS ", 1: "%HH:%MM" },
datePattern: { 0: "%A, %d de %B de %Y", "1": "%d/%m/%y" }, // domingo, 1 de marzo de 2020 // 01/03/20
abmonth: "ene,feb,mar,abr,may,jun,jul,ago,sept,oct,nov,dic",
month: "enero,febrero,marzo,abril,mayo,junio,julio,agosto,septiembre,octubre,noviembre,diciembre",
abday: "dom,lun,mar,mié,jue,vie,sáb",
day: "domingo,lunes,martes,miércoles,jueves,viernes,sábado",
trans: { yes : "sí", Yes: "Sí",no: "no", No: "No", ok : "ok", on: "on", off: "off" }},
trans: { yes: "sí", Yes: "Sí", no: "no", No: "No", ok: "ok", on: "on", off: "off" }
},
"fr_BE": {
lang: "fr_BE",
decimal_point: ",",
@ -252,14 +257,15 @@ var locales = {
speed: "kmh",
distance: { 0: "m", 1: "km" },
temperature: "°C",
ampm: {0: "",1: ""},
ampm: { 0: "", 1: "" },
timePattern: { 0: "%HH:%MM:%SS ", 1: "%HH:%MM" },
datePattern: { 0: "%A %B %d %Y", "1": "%d/%m/%y" }, // dimanche 1 mars 2020 // 01/03/20
abmonth: "anv.,févr.,mars,avril,mai,juin,juil.,août,sept.,oct.,nov.,déc.",
month: "janvier,février,mars,avril,mai,juin,juillet,août,septembre,octobre,novembre,décembre",
abday: "dim,lun,mar,mer,jeu,ven,sam",
day: "dimanche,lundi,mardi,mercredi,jeudi,vendredi,samedi",
trans : { yes : "oui", Yes: "Oui", no: "no", No: "No", ok : "ok", on: "on", off: "off" }},
trans: { yes: "oui", Yes: "Oui", no: "no", No: "No", ok: "ok", on: "on", off: "off" }
},
"fi_FI": {
lang: "fi_FI",
decimal_point: ",",
@ -269,48 +275,51 @@ var locales = {
speed: "kmh",
distance: { 0: "m", 1: "km" },
temperature: "°C",
ampm: {0: "ap",1: "ip"},
ampm: { 0: "ap", 1: "ip" },
timePattern: { 0: "%HH:%MM:%SS ", 1: "%HH:%MM" }, // 17.00.00 // 17.00
datePattern: { 0: "%A %d. %B %Y", "1": "%-d/%-m/%Y" }, // sunnuntai 1. maaliskuuta 2020 // 1.3.2020
abmonth: "tammik,helmik,maalisk,huhtik,toukok,kesäk,heinäk,elok,syysk,lokak,marrask,jouluk",
month: "tammikuuta,helmikuuta,maaliskuuta,huhtikuuta,toukokuuta,kesäkuuta,heinäkuuta,elokuuta,syyskuuta,lokakuuta,marraskuuta,joulukuuta",
abday: "su,ma,ti,ke,to,pe,la",
day: "sunnuntaina,maanantaina,tiistaina,keskiviikkona,torstaina,perjantaina,lauantaina",
trans : { yes : "oui", Yes: "Oui", no: "no", No: "No", ok : "ok", on: "on", off: "off" }},
trans: { yes: "oui", Yes: "Oui", no: "no", No: "No", ok: "ok", on: "on", off: "off" }
},
"de_CH": {
lang: "de_CH",
decimal_point: ",",
decimal_point: ",",
thousands_sep: ".",
currency_symbol: "CHF",
int_curr_symbol: "CHF",
speed: "kmh",
distance: { 0: "m", 1: "km" },
temperature: "°C",
ampm: {0:"vorm",1:" nachm"},
ampm: { 0: "vorm", 1: " nachm" },
timePattern: { 0: "%HH:%MM:%SS", 1: "%HH:%MM" },
datePattern: { 0: "%A, %d. %B %Y", "1": "%d.%m.%Y" }, // Sonntag, 1. März 2020 // 1.3.2020
abmonth: "Jan,Feb,März,Apr,Mai,Jun,Jul,Aug,Sep,Okt,Nov,Dez",
month: "Januar,Februar,März,April,Mai,Juni,Juli,August,September,Oktober,November,Dezember",
abday: "So,Mo,Di,Mi,Do,Fr,Sa",
day: "Sonntag,Montag,Dienstag,Mittwoch,Donnerstag,Freitag,Samstag",
trans: { yes: "ja", Yes: "Ja", no: "nein", No: "Nein", ok: "ok", on: "an", off: "aus" }},
trans: { yes: "ja", Yes: "Ja", no: "nein", No: "Nein", ok: "ok", on: "an", off: "aus" }
},
"fr_CH": {
lang: "fr_CH",
decimal_point: ",",
decimal_point: ",",
thousands_sep: ".",
currency_symbol: "CHF",
int_curr_symbol: "CHF",
speed: "kmh",
distance: { 0: "m", 1: "km" },
temperature: "°C",
ampm: {0:"AM",1:"PM"},
ampm: { 0: "AM", 1: "PM" },
timePattern: { 0: "%HH:%MM:%SS", 1: "%HH:%MM" },
datePattern: { 0: "%A %d %B %Y", "1": "%d/%m/%y" }, // dimanche 1 mars 2020 // 01/03/20
abmonth: "anv.,févr.,mars,avril,mai,juin,juil.,août,sept.,oct.,nov.,déc.",
month: "janvier,février,mars,avril,mai,juin,juillet,août,septembre,octobre,novembre,décembre",
abday: "dim,lun,mar,mer,jeu,ven,sam",
day: "dimanche,lundi,mardi,mercredi,jeudi,vendredi,samedi",
trans : { yes : "oui", Yes: "Oui", no: "no", No: "No", ok : "ok", on: "on", off: "off" }},
trans: { yes: "oui", Yes: "Oui", no: "no", No: "No", ok: "ok", on: "on", off: "off" }
},
"it_CH": {
lang: "it_CH",
decimal_point: ",",
@ -320,13 +329,15 @@ var locales = {
speed: 'kmh',
distance: { "0": "m", "1": "km" },
temperature: '°C',
ampm: { 0: "", 1: "" },
timePattern: { 0: "%HH.%MM.%SS ", 1: "%HH.%MM" }, // 17.00.00 // 17.00
datePattern: { 0: "%A %B %d %Y", "1": "%d/%m/%Y" }, // sunnuntai 1. maaliskuuta 2020 // 1.3.2020
abmonth: "gen,feb,mar,apr,mag,giu,lug,ago,set,ott,nov,dic",
month: "gennaio,febbraio,marzo,aprile,maggio,giugno,luglio,agosto,settembre,ottobre,novembre,dicembre",
abday : "dom,lun,mar,mer,gio,ven,sab",
abday: "dom,lun,mar,mer,gio,ven,sab",
day: "domenica,lunedì,martedì,mercoledì,giovedì,venerdì, sabato",
trans : { yes: "sì", Yes: "Sì", no: "no", No: "No", ok: "ok", on: "on", off: "off" }},
trans: { yes: "sì", Yes: "Sì", no: "no", No: "No", ok: "ok", on: "on", off: "off" }
},
"it_IT": {
lang: "it_IT",
decimal_point: ",",
@ -336,29 +347,33 @@ var locales = {
speed: 'kmh',
distance: { "0": "m", "1": "km" },
temperature: '°C',
ampm: { 0: "", 1: "" },
timePattern: { 0: "%HH.%MM.%SS ", 1: "%HH.%MM" }, // 17.00.00 // 17.00
datePattern: { 0: "%A %B %d %Y", "1": "%d/%m/%Y" }, // sunnuntai 1. maaliskuuta 2020 // 1.3.2020
abmonth: "gen,feb,mar,apr,mag,giu,lug,ago,set,ott,nov,dic",
month: "gennaio,febbraio,marzo,aprile,maggio,giugno,luglio,agosto,settembre,ottobre,novembre,dicembre",
abday : "dom,lun,mar,mer,gio,ven,sab",
abday: "dom,lun,mar,mer,gio,ven,sab",
day: "domenica,lunedì,martedì,mercoledì,giovedì,venerdì, sabato",
trans : { yes: "sì", Yes: "Sì", no: "no", No: "No", ok: "ok", on: "on", off: "off" }},
"wae_CH" : {
trans: { yes: "sì", Yes: "Sì", no: "no", No: "No", ok: "ok", on: "on", off: "off" }
},
"wae_CH": {
lang: "wae_CH",
decimal_point: ",",
decimal_point: ",",
thousands_sep: ".",
currency_symbol: "CHF",
int_curr_symbol: "CHF",
speed: 'kmh',
distance: { "0": "m", "1": "km" },
temperature: '°C',
ampm: { 0: "", 1: "" },
timePattern: { 0: "%HH.%MM.%SS ", 1: "%HH.%MM" }, // 17.00.00 // 17.00
datePattern: { 0: "%A, %d. %B %Y", "1": "%Y-%m-%d" }, // Sunntag, 1. Märze 2020 // 2020-03-01
abmonth: "Jen,Hor,Mär,Abr,Mei,Brá,Hei,Öig,Her,Wím,Win,Chr",
month: "Jenner,Hornig,Märze,Abrille,Meije,Bráčet,Heiwet,Öigšte,Herbštmánet,Wímánet,Wintermánet,Chrištmánet",
abday: "Sun,Män,Ziš,Mit,Fró,Fri,Sam",
day: "Sunntag,Mäntag,Zištag,Mittwuč,Fróntag,Fritag,Samštag",
trans : { yes: "sì", Yes: "Sì", no: "no", No: "No", ok: "ok", on: "on", off: "off" }},
trans: { yes: "sì", Yes: "Sì", no: "no", No: "No", ok: "ok", on: "on", off: "off" }
},
"tr_TR": { // this is default
lang: "tr_TR",
decimal_point: ",",
@ -368,48 +383,51 @@ var locales = {
speed: 'kmh',
distance: { "0": "m", "1": "km" },
temperature: '°C',
ampm: {0:"öö",1:"ös"},
ampm: { 0: "öö", 1: "ös" },
timePattern: { 0: "%HH:%MM:%SS ", 1: "%HH:%MM" },
datePattern: { 0: "%d %w %Y %A", 1: "%d/%m/%Y" }, // 1 Mart 2020 Pazar // "01/03/2020"
abmonth: "Oca,Sub,Mar,Nis,May,Haz,Tem,Agu,Eyl,Eki,Kas,Ara",
month: "Ocak,Subat,Mart,Nisan,Mayis,Haziran,Temmuz,Agustos,Eylul,Ekim,Kasim,Aralik",
abday: "Paz,Pzt,Sal,Car,Per,Cum,Cmt",
day: "Pazar,Pazartesi,Sali,Carsamba,Persembe,Cuma,Cumartesi",
trans: { yes: "evet", Yes: "Evet", no: "hayir", No: "Hayir", ok: "tamam", on: "acik", off: "kapali" }},
"hu_HU": {
lang: "hu_HU",
decimal_point: ",",
thousands_sep: " ",
currency_symbol: "Ft",
int_curr_symbol: "HUF",
speed: 'kph',
distance: { "0": "m", "1": "km" },
temperature: '°C',
ampm: {0:"de",1:"du"},
timePattern: { 0: "%HH:%MM:%SS ", 1: "%HH:%MM" },
datePattern: { 0: "%Y %b %d, %A", 1: "%Y.%m.%d" }, // 2020 Feb 28, Péntek" // "2020.03.01."(short)
abmonth: "Jan,Feb,Már,Ápr,Máj,Jún,Júl,Aug,Szep,Okt,Nov,Dec",
month: "Január,Február,Március,Április,Május,Június,Július,Augusztus,Szeptember,Október,November,December",
abday: "Vas,Hét,Ke,Szer,Csüt,Pén,Szom",
day: "Vasárnap,Hétfő,Kedd,Szerda,Csütörtök,Péntek,Szombat",
trans: { yes: "igen", Yes: "Igen", no: "nem", No: "Nem", ok: "ok", on: "be", off: "ki" }},
trans: { yes: "evet", Yes: "Evet", no: "hayir", No: "Hayir", ok: "tamam", on: "acik", off: "kapali" }
},
"hu_HU": {
lang: "hu_HU",
decimal_point: ",",
thousands_sep: " ",
currency_symbol: "Ft",
int_curr_symbol: "HUF",
speed: 'kph',
distance: { "0": "m", "1": "km" },
temperature: '°C',
ampm: { 0: "de", 1: "du" },
timePattern: { 0: "%HH:%MM:%SS ", 1: "%HH:%MM" },
datePattern: { 0: "%Y %b %d, %A", 1: "%Y.%m.%d" }, // 2020 Feb 28, Péntek" // "2020.03.01."(short)
abmonth: "Jan,Feb,Már,Ápr,Máj,Jún,Júl,Aug,Szep,Okt,Nov,Dec",
month: "Január,Február,Március,Április,Május,Június,Július,Augusztus,Szeptember,Október,November,December",
abday: "Vas,Hét,Ke,Szer,Csüt,Pén,Szom",
day: "Vasárnap,Hétfő,Kedd,Szerda,Csütörtök,Péntek,Szombat",
trans: { yes: "igen", Yes: "Igen", no: "nem", No: "Nem", ok: "ok", on: "be", off: "ki" }
},
"pt_BR": {
lang: "pt_BR",
decimal_point: ",",
thousands_sep: ".",
currency_symbol: "R$", currency_first:true,
currency_symbol: "R$", currency_first: true,
int_curr_symbol: "BRL",
speed: "kmh",
distance: { 0: "m", 1: "km" },
temperature: "°C",
ampm: {0:"am",1:"pm"},
ampm: { 0: "am", 1: "pm" },
timePattern: { 0: "%HH:%MM:%SS ", 1: "%HH:%MM" },
datePattern: { 0: "", 1: "%d/%m/%y" },
abmonth: "Jan,Fev,Mar,Abr,Mai,Jun,Jul,Ago,Set,Out,Nov,Dez",
month: "Janeiro,Fevereiro,Março,Abril,Maio,Junho,Julho,Agosto,Setembro,Outubro,Novembro,Dezembro",
abday: "Dom,Seg,Ter,Qua,Qui,Sex,Sab",
day: "Domingo,Segunda-feira,Terça-feira,Quarta-feira,Quinta-feira,Sexta-feira,Sábado",
trans: { yes: "sim", Yes: "Sim", no: "não", No: "Não", ok: "certo", on: "ligado", off: "desligado" }},
trans: { yes: "sim", Yes: "Sim", no: "não", No: "Não", ok: "certo", on: "ligado", off: "desligado" }
},
"cs_CZ": {
lang: "cs_CZ",
decimal_point: ",",
@ -419,12 +437,13 @@ var locales = {
speed: 'kmh',
distance: { "0": "m", "1": "km" },
temperature: '°C',
ampm: {0:"dop",1:"odp"},
ampm: { 0: "dop", 1: "odp" },
timePattern: { 0: "%HH:%MM:%SS ", 1: "%HH:%MM" },
datePattern: { 0: "%d. %b %Y", 1: "%d.%m.%Y" }, // "30. led 2020" // "30.01.2020"(short)
abmonth: "led,úno,bře,dub,kvě,čvn,čvc,srp,zář,říj,lis,pro",
month: "leden,únor,březen,duben,květen,červen,červenec,srpen,září,říjen,listopad,prosinec",
abday: "ne,po,út,st,čt,pá,so",
day: "neděle,pondělí,úterý,středa,čtvrtek,pátek,sobota",
trans: { yes: "tak", Yes: "Tak", no: "nie", No: "Nie", ok: "ok", on: "na", off: "poza" }}
trans: { yes: "tak", Yes: "Tak", no: "nie", No: "Nie", ok: "ok", on: "na", off: "poza" }
}
};

View File

@ -6,3 +6,4 @@
0.07: Tweaks for variable size widget system
0.08: Ensure redrawing works with variable size widget system
0.09: Add daily goal
0.10: Fix daily goal, don't store settings in separate file

View File

@ -1,5 +1,5 @@
(function(back) {
const SETTINGS_FILE = 'widpedom.settings.json'
const PEDOMFILE = "wpedom.json";
// initialize with default settings...
let s = {
@ -9,13 +9,15 @@
// ...and overwrite them with any saved values
// This way saved values are preserved if a new version adds more settings
const storage = require('Storage')
const saved = storage.readJSON(SETTINGS_FILE, 1) || {}
const d = storage.readJSON(PEDOMFILE, 1) || {}
const saved = d.settings || {}
for (const key in saved) {
s[key] = saved[key]
}
function save() {
storage.write(SETTINGS_FILE, s)
d.settings = s
storage.write(PEDOMFILE, d)
WIDGETS['wpedom'].reload()
}

View File

@ -1,6 +1,5 @@
(() => {
const PEDOMFILE = "wpedom.json"
const SETTINGS_FILE = "widpedom.settings.json"
const DEFAULTS = {
'goal': 10000,
'progress': false,
@ -16,7 +15,8 @@
let settings;
function loadSettings() {
settings = require('Storage').readJSON(SETTINGS_FILE, 1) || {};
const d = require('Storage').readJSON(PEDOMFILE, 1) || {};
settings = d.settings || {};
}
function setting(key) {
@ -25,31 +25,29 @@
}
function drawProgress(stps) {
if (setting('progress')) {
const width = 24, half = width/2;
const goal = setting('goal'), left = Math.max(goal-stps,0);
const c = left ? COLORS.progress : COLORS.done;
g.setColor(c).fillCircle(this.x + half, this.y + half, half);
if (left) {
const f = left/goal; // fraction to blank out
let p = [];
p.push(half,half);
p.push(half,0);
if(f>1/8) p.push(0,0);
if(f>2/8) p.push(0,half);
if(f>3/8) p.push(0,width);
if(f>4/8) p.push(half,width);
if(f>5/8) p.push(width,width);
if(f>6/8) p.push(width,half);
if(f>7/8) p.push(width,0);
p.push(half - Math.sin(f * TAU) * half);
p.push(half - Math.cos(f * TAU) * half);
for (let i = p.length; i; i -= 2) {
p[i - 2] += this.x;
p[i - 1] += this.y;
}
g.setColor(0).fillPoly(p);
const width = 24, half = width/2;
const goal = setting('goal'), left = Math.max(goal-stps,0);
const c = left ? COLORS.progress : COLORS.done;
g.setColor(c).fillCircle(this.x + half, this.y + half, half);
if (left) {
const f = left/goal; // fraction to blank out
let p = [];
p.push(half,half);
p.push(half,0);
if(f>1/8) p.push(0,0);
if(f>2/8) p.push(0,half);
if(f>3/8) p.push(0,width);
if(f>4/8) p.push(half,width);
if(f>5/8) p.push(width,width);
if(f>6/8) p.push(width,half);
if(f>7/8) p.push(width,0);
p.push(half - Math.sin(f * TAU) * half);
p.push(half - Math.cos(f * TAU) * half);
for (let i = p.length; i; i -= 2) {
p[i - 2] += this.x;
p[i - 1] += this.y;
}
g.setColor(0).fillPoly(p);
}
}
@ -62,7 +60,7 @@
let stps = stp_today.toString();
g.reset();
g.clearRect(this.x, this.y, this.x + width, this.y + 23); // erase background
drawProgress(stps);
if (setting('progress')){ drawProgress.call(this, stps); }
g.setColor(COLORS.white);
if (stps.length > 3){
stps = stps.slice(0,-3) + "," + stps.slice(-3);
@ -104,9 +102,11 @@
});
// When unloading, save state
E.on('kill', () => {
if (!settings) { loadSettings() }
let d = {
lastUpdate : lastUpdate.toISOString(),
stepsToday : stp_today
stepsToday : stp_today,
settings : settings,
};
require("Storage").write(PEDOMFILE,d);
});