fix variables leaks + shorter code
parent
d3b686e09a
commit
fc1cea0b6c
|
|
@ -172,19 +172,19 @@ exports = { name : "en_GB", currencySym:"£",
|
||||||
abmonth : locale.abmonth,
|
abmonth : locale.abmonth,
|
||||||
month : locale.month,
|
month : locale.month,
|
||||||
})};
|
})};
|
||||||
exports = {
|
exports = {
|
||||||
name: ${js(locale.lang)},
|
name: ${js(locale.lang)},
|
||||||
currencySym: ${js(locale.currency_symbol)},
|
currencySym: ${js(locale.currency_symbol)},
|
||||||
dow: (d,short) => {day = d.getDay();return (short) ? l.abday.split(",")[day] : l.day.split(",")[day];},
|
dow: (d,short) => l[short ? 'abday' : 'day'].split(',')[d.getDay()],
|
||||||
month: (d,short) => { month = d.getMonth(); return (short) ? l.abmonth.split(",")[month] : l.month.split(",")[month];},
|
month: (d,short) => l[short ? 'abmonth' : 'month'].split(',')[d.getMonth()],
|
||||||
number: n => n.toString(),
|
number: n => n.toString(),
|
||||||
currency: n => ${currency},
|
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])},
|
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)},
|
speed: s => Math.round(s/${speedUnits[locale.speed]}) + ${js(locale.speed)},
|
||||||
temp: t => Math.round(${temperature}) + ${js(locale.temperature)},
|
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`},
|
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}\`,
|
||||||
meridian: d => (d.getHours() <= 12) ? ${js(locale.ampm[0])}:${js(locale.ampm[1])},
|
meridian: d => (d.getHours() <= 12) ? ${js(locale.ampm[0])}:${js(locale.ampm[1])},
|
||||||
};`;
|
};`;
|
||||||
console.log("Locale Module is:",localeModule);
|
console.log("Locale Module is:",localeModule);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue