fix variables leaks + shorter code

master
Matjaz Lipus 2020-06-02 13:10:35 +02:00
parent d3b686e09a
commit fc1cea0b6c
1 changed files with 6 additions and 6 deletions

View File

@ -175,16 +175,16 @@ exports = { name : "en_GB", currencySym:"£",
exports = {
name: ${js(locale.lang)},
currencySym: ${js(locale.currency_symbol)},
dow: (d,short) => {day = d.getDay();return (short) ? l.abday.split(",")[day] : l.day.split(",")[day];},
month: (d,short) => { month = d.getMonth(); return (short) ? l.abmonth.split(",")[month] : l.month.split(",")[month];},
dow: (d,short) => l[short ? 'abday' : 'day'].split(',')[d.getDay()],
month: (d,short) => l[short ? 'abmonth' : 'month'].split(',')[d.getMonth()],
number: n => n.toString(),
currency: n => ${currency},
distance: n => (n < ${distanceUnits[locale.distance[1]]}) ? Math.round(n/${distanceUnits[locale.distance[0]]}) + ${js(locale.distance[0])} : Math.round(n/${distanceUnits[locale.distance[1]]}) + ${js(locale.distance[1])},
speed: s => Math.round(s/${speedUnits[locale.speed]}) + ${js(locale.speed)},
temp: t => Math.round(${temperature}) + ${js(locale.temperature)},
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}\`,
time: (d,short) => (short) ? \`${timeS}\`: \`${timeN}\`,
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}\`,
time: (d,short) => short ? \`${timeS}\`: \`${timeN}\`,
meridian: d => (d.getHours() <= 12) ? ${js(locale.ampm[0])}:${js(locale.ampm[1])},
};`;
console.log("Locale Module is:",localeModule);