mirror of https://github.com/espruino/BangleApps
Merge pull request #3278 from atjn/deprecate-currency
`locale`: Deprecate currency informationpull/3295/head
commit
95994b7e24
|
@ -20,3 +20,4 @@
|
|||
Add second 'dp' argument for decimal places in distance/speed/temp (fix #1523)
|
||||
0.17: Fix regression where long month names were 'undefined' (fix #1641)
|
||||
0.18: Fix lint warnings, change anv->janv for fr_BE and fr_CH
|
||||
0.19: Deprecate currency information
|
||||
|
|
|
@ -10,7 +10,6 @@ other applications or widgets to provide locale-friendly
|
|||
- Time (12h/24h)
|
||||
- Days of the Week
|
||||
- Months
|
||||
- Currency values
|
||||
- Distances/Lengths/Speed (metric/imperial)
|
||||
- Temperature (°C/°F)
|
||||
|
||||
|
|
|
@ -195,9 +195,6 @@ exports = { name : "system", currencySym:"£",
|
|||
dateN = dateN.replace(e,"${"+replaceList[e]+"}");
|
||||
dateS = dateS.replace(e,"${"+replaceList[e]+"}");
|
||||
});
|
||||
var currency = locale.currency_first ?
|
||||
`${js(locale.currency_symbol)} + exports.number(n)`:
|
||||
`exports.number(n) + ${js(locale.currency_symbol)}`;
|
||||
var temperature = locale.temperature=='°F' ? '(t*9/5)+32' : 't';
|
||||
|
||||
function getLocaleModule(isLocal) {
|
||||
|
@ -216,7 +213,7 @@ function getHours(d) {
|
|||
}
|
||||
exports = {
|
||||
name: ${js(locale.lang)},
|
||||
currencySym: ${js(locale.currency_symbol)},
|
||||
currencySym: ${js("£")},
|
||||
dow: (d,short) => ${js(locale.day + ',' + locale.abday)}.split(',')[d.getDay() + (short ? 7 : 0)],
|
||||
month: (d,short) => ${js(locale.month + ',' + locale.abmonth)}.split(',')[d.getMonth() + (short ? 12 : 0)],
|
||||
number: (n, dec) => {
|
||||
|
@ -233,7 +230,7 @@ exports = {
|
|||
r = '${locale.thousands_sep}' + s.substr(i, 3) + r;
|
||||
return s.substr(0, i + 3) + r + (d ? '${locale.decimal_point}' + d: '');
|
||||
},
|
||||
currency: n => ${currency},
|
||||
currency: n => {console.log("Warning: Currency information is deprecated, see https://github.com/espruino/BangleApps/issues/3269");return ${js("£")}+exports.number(n)},
|
||||
distance: (n,dp) => n < ${distanceUnits[locale.distance[1]]} ? round(${unitConv(distanceUnits[locale.distance[0]])},dp) + ${js(locale.distance[0])} : round(${unitConv(distanceUnits[locale.distance[1]])},dp) + ${js(locale.distance[1])},
|
||||
speed: (n,dp) => round(${unitConv(speedUnits[locale.speed])},dp) + ${js(locale.speed)},
|
||||
temp: (t,dp) => round(${temperature},dp) + ${js(locale.temperature)},
|
||||
|
@ -257,7 +254,6 @@ exports = {
|
|||
<tr><td class="table_t">Date</td><td>${exports.date(date,1)}</td><td>${exports.date(date,0)}</td></tr>
|
||||
<tr><td class="table_t">Time</td><td>${exports.time(date,1)}</td><td>${exports.time(date,0)}</td></tr>
|
||||
<tr><td class="table_t">Number</td><td>${exports.number(12.3456789)}</td><td>${exports.number(12.3456789,4)}</td></tr>
|
||||
<tr><td class="table_t">Currency</td><td></td><td>${exports.currency(12.34)}</td></tr>
|
||||
<tr><td class="table_t">Distance</td><td>${exports.distance(12.34,0)}</td><td>${exports.distance(12345.6,1)}</td></tr>
|
||||
<tr><td class="table_t">Speed</td><td></td><td>${exports.speed(123)}</td></tr>
|
||||
<tr><td class="table_t">Temperature</td><td></td><td>${exports.temp(12,0)}</td></tr>
|
||||
|
|
|
@ -78,8 +78,6 @@ var locales = {
|
|||
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',
|
||||
|
@ -97,8 +95,6 @@ var locales = {
|
|||
notes: "USA with MM/DD/YY date",
|
||||
decimal_point: ".",
|
||||
thousands_sep: ",",
|
||||
currency_symbol: "$", currency_first: true,
|
||||
int_curr_symbol: "USD",
|
||||
speed: "mph",
|
||||
distance: { 0: "ft", 1: "mi" },
|
||||
temperature: "°F",
|
||||
|
@ -116,8 +112,6 @@ var locales = {
|
|||
notes: "USA with YYYY-MM-DD date",
|
||||
decimal_point: ".",
|
||||
thousands_sep: ",",
|
||||
currency_symbol: "$", currency_first: true,
|
||||
int_curr_symbol: "USD",
|
||||
speed: "mph",
|
||||
distance: { 0: "ft", 1: "mi" },
|
||||
temperature: "°F",
|
||||
|
@ -134,9 +128,6 @@ var locales = {
|
|||
lang: "en_IN",
|
||||
decimal_point: ".",
|
||||
thousands_sep: ",",
|
||||
currency_symbol: "Rs.",
|
||||
currency_first: true,
|
||||
int_curr_symbol: "INR",
|
||||
speed: 'kmh',
|
||||
distance: { "0": "m", "1": "km" },
|
||||
temperature: '°C',
|
||||
|
@ -153,9 +144,6 @@ var locales = {
|
|||
lang: "en_IE",
|
||||
decimal_point: ".",
|
||||
thousands_sep: ",",
|
||||
currency_symbol: "€",
|
||||
int_curr_symbol: "EUR",
|
||||
currency_first: true,
|
||||
speed: 'kmh',
|
||||
distance: { "0": "m", "1": "km" },
|
||||
temperature: '°C',
|
||||
|
@ -172,8 +160,6 @@ var locales = {
|
|||
lang: "en_NAV", icon: "⛵✈️",
|
||||
decimal_point: ".",
|
||||
thousands_sep: ",",
|
||||
currency_symbol: "£", currency_first: true,
|
||||
int_curr_symbol: "GBP",
|
||||
speed: 'kts',
|
||||
distance: { "0": "m", "1": "nm" },
|
||||
temperature: '°C',
|
||||
|
@ -190,8 +176,6 @@ var locales = {
|
|||
lang: "de_DE",
|
||||
decimal_point: ",",
|
||||
thousands_sep: ".",
|
||||
currency_symbol: "€",
|
||||
int_curr_symbol: "EUR",
|
||||
speed: "kmh",
|
||||
distance: { 0: "m", 1: "km" },
|
||||
temperature: "°C",
|
||||
|
@ -209,8 +193,6 @@ var locales = {
|
|||
lang: "en_JP",
|
||||
decimal_point: ".",
|
||||
thousands_sep: ",",
|
||||
currency_symbol: "¥",
|
||||
int_curr_symbol: "JPY",
|
||||
speed: "kmh",
|
||||
distance: { 0: "m", 1: "km" },
|
||||
temperature: "°C",
|
||||
|
@ -227,8 +209,6 @@ var locales = {
|
|||
lang: "nl_NL",
|
||||
decimal_point: ",",
|
||||
thousands_sep: ".",
|
||||
currency_symbol: "€",
|
||||
int_curr_symbol: "EUR",
|
||||
speed: "kmh",
|
||||
distance: { 0: "m", 1: "km" },
|
||||
temperature: "°C",
|
||||
|
@ -242,12 +222,10 @@ var locales = {
|
|||
trans: { yes: "ja", Yes: "Ja", no: "nee", No: "Nee", ok: "ok", on: "aan", off: "uit",
|
||||
"< Back": "< Terug", "Delete": "Verwijderen", "Mark Unread": "Markeer als ongelezen" }
|
||||
},
|
||||
"en_NL": { // English date units with Dutch number, currency and navigation units.
|
||||
"en_NL": { // English date units with Dutch number and navigation units.
|
||||
lang: "en_NL",
|
||||
decimal_point: ",",
|
||||
thousands_sep: ".",
|
||||
currency_symbol: "€",
|
||||
int_curr_symbol: "EUR",
|
||||
speed: "km/h",
|
||||
distance: { 0: "m", 1: "km" },
|
||||
temperature: "°C",
|
||||
|
@ -263,8 +241,6 @@ var locales = {
|
|||
lang: "en_CA",
|
||||
decimal_point: ".",
|
||||
thousands_sep: ",",
|
||||
currency_symbol: "$",
|
||||
int_curr_symbol: "CAD",
|
||||
speed: "km/h",
|
||||
distance: { 0: "m", 1: "km" },
|
||||
temperature: "°C",
|
||||
|
@ -281,8 +257,6 @@ var locales = {
|
|||
lang: "fr_FR",
|
||||
decimal_point: ",",
|
||||
thousands_sep: " ",
|
||||
currency_symbol: "€",
|
||||
int_curr_symbol: "EUR",
|
||||
speed: "km/h",
|
||||
distance: { 0: "m", 1: "km" },
|
||||
temperature: "°C",
|
||||
|
@ -299,8 +273,6 @@ var locales = {
|
|||
lang: "sv_SE",
|
||||
decimal_point: ",",
|
||||
thousands_sep: ".",
|
||||
currency_symbol: "kr",
|
||||
int_curr_symbol: "SKR",
|
||||
speed: "km/tim",
|
||||
distance: { 0: "m", 1: "km" },
|
||||
temperature: "°C",
|
||||
|
@ -317,8 +289,6 @@ var locales = {
|
|||
lang: "en_SE",
|
||||
decimal_point: ",",
|
||||
thousands_sep: ".",
|
||||
currency_symbol: "kr",
|
||||
int_curr_symbol: "SKR",
|
||||
speed: 'km/h',
|
||||
distance: { "0": "m", "1": "km" },
|
||||
temperature: '°C',
|
||||
|
@ -335,8 +305,6 @@ var locales = {
|
|||
lang: "da_DK",
|
||||
decimal_point: ",",
|
||||
thousands_sep: ".",
|
||||
currency_symbol: "kr",
|
||||
int_curr_symbol: "DKK",
|
||||
speed: "km/t",
|
||||
distance: { 0: "m", 1: "km" },
|
||||
temperature: "°C",
|
||||
|
@ -353,8 +321,6 @@ var locales = {
|
|||
lang: "en_DK",
|
||||
decimal_point: ",",
|
||||
thousands_sep: ".",
|
||||
currency_symbol: "kr",
|
||||
int_curr_symbol: "DKK",
|
||||
speed: "km/h",
|
||||
distance: { 0: "m", 1: "km" },
|
||||
temperature: "°C",
|
||||
|
@ -371,8 +337,6 @@ var locales = {
|
|||
lang: "en_NZ",
|
||||
decimal_point: ".",
|
||||
thousands_sep: ",",
|
||||
currency_symbol: "$",
|
||||
int_curr_symbol: "NZD",
|
||||
speed: "kph",
|
||||
distance: { 0: "m", 1: "km" },
|
||||
temperature: "°C",
|
||||
|
@ -389,8 +353,6 @@ var locales = {
|
|||
lang: "en_AU",
|
||||
decimal_point: ".",
|
||||
thousands_sep: ",",
|
||||
currency_symbol: "$",
|
||||
int_curr_symbol: "AUD",
|
||||
speed: "kmh",
|
||||
distance: { 0: "m", 1: "km" },
|
||||
temperature: "°C",
|
||||
|
@ -407,8 +369,6 @@ var locales = {
|
|||
lang: "de_AT",
|
||||
decimal_point: ",",
|
||||
thousands_sep: ".",
|
||||
currency_symbol: "€",
|
||||
int_curr_symbol: "EUR",
|
||||
speed: "kmh",
|
||||
distance: { 0: "m", 1: "km" },
|
||||
temperature: "°C",
|
||||
|
@ -426,8 +386,6 @@ var locales = {
|
|||
lang: "en_IL",
|
||||
decimal_point: ",",
|
||||
thousands_sep: ".",
|
||||
currency_symbol: "ILS"/*"₪"*/,
|
||||
int_curr_symbol: "ILS",
|
||||
speed: "kmh",
|
||||
distance: { 0: "m", 1: "km" },
|
||||
temperature: "°C",
|
||||
|
@ -444,8 +402,6 @@ var locales = {
|
|||
lang: "es_ES",
|
||||
decimal_point: ",",
|
||||
thousands_sep: ".",
|
||||
currency_symbol: "€",
|
||||
int_curr_symbol: "EUR",
|
||||
speed: "kmh",
|
||||
distance: { 0: "m", 1: "km" },
|
||||
temperature: "°C",
|
||||
|
@ -463,8 +419,6 @@ var locales = {
|
|||
lang: "fr_BE",
|
||||
decimal_point: ",",
|
||||
thousands_sep: ".",
|
||||
currency_symbol: "€",
|
||||
int_curr_symbol: "EUR",
|
||||
speed: "kmh",
|
||||
distance: { 0: "m", 1: "km" },
|
||||
temperature: "°C",
|
||||
|
@ -481,8 +435,6 @@ var locales = {
|
|||
lang: "fi_FI",
|
||||
decimal_point: ",",
|
||||
thousands_sep: ".",
|
||||
currency_symbol: "€",
|
||||
int_curr_symbol: "EUR",
|
||||
speed: "kmh",
|
||||
distance: { 0: "m", 1: "km" },
|
||||
temperature: "°C",
|
||||
|
@ -499,8 +451,6 @@ var locales = {
|
|||
lang: "de_CH",
|
||||
decimal_point: ",",
|
||||
thousands_sep: ".",
|
||||
currency_symbol: "CHF",
|
||||
int_curr_symbol: "CHF",
|
||||
speed: "kmh",
|
||||
distance: { 0: "m", 1: "km" },
|
||||
temperature: "°C",
|
||||
|
@ -517,8 +467,6 @@ var locales = {
|
|||
lang: "fr_CH",
|
||||
decimal_point: ",",
|
||||
thousands_sep: ".",
|
||||
currency_symbol: "CHF",
|
||||
int_curr_symbol: "CHF",
|
||||
speed: "kmh",
|
||||
distance: { 0: "m", 1: "km" },
|
||||
temperature: "°C",
|
||||
|
@ -535,8 +483,6 @@ var locales = {
|
|||
lang: "it_CH",
|
||||
decimal_point: ",",
|
||||
thousands_sep: ".",
|
||||
currency_symbol: "CHF",
|
||||
int_curr_symbol: "CHF",
|
||||
speed: 'kmh',
|
||||
distance: { "0": "m", "1": "km" },
|
||||
temperature: '°C',
|
||||
|
@ -553,8 +499,6 @@ var locales = {
|
|||
lang: "it_IT",
|
||||
decimal_point: ",",
|
||||
thousands_sep: ".",
|
||||
currency_symbol: "€",
|
||||
int_curr_symbol: "EUR",
|
||||
speed: 'kmh',
|
||||
distance: { "0": "m", "1": "km" },
|
||||
temperature: '°C',
|
||||
|
@ -571,8 +515,6 @@ var locales = {
|
|||
lang: "wae_CH",
|
||||
decimal_point: ",",
|
||||
thousands_sep: ".",
|
||||
currency_symbol: "CHF",
|
||||
int_curr_symbol: "CHF",
|
||||
speed: 'kmh',
|
||||
distance: { "0": "m", "1": "km" },
|
||||
temperature: '°C',
|
||||
|
@ -589,8 +531,6 @@ var locales = {
|
|||
lang: "tr_TR",
|
||||
decimal_point: ",",
|
||||
thousands_sep: ".",
|
||||
currency_symbol: "TL",
|
||||
int_curr_symbol: "TRY",
|
||||
speed: 'kmh',
|
||||
distance: { "0": "m", "1": "km" },
|
||||
temperature: '°C',
|
||||
|
@ -607,8 +547,6 @@ var locales = {
|
|||
lang: "hu_HU",
|
||||
decimal_point: ",",
|
||||
thousands_sep: " ",
|
||||
currency_symbol: "Ft",
|
||||
int_curr_symbol: "HUF",
|
||||
speed: 'kph',
|
||||
distance: { "0": "m", "1": "km" },
|
||||
temperature: '°C',
|
||||
|
@ -625,8 +563,6 @@ var locales = {
|
|||
lang: "oc_FR",
|
||||
decimal_point: ",",
|
||||
thousands_sep: " ",
|
||||
currency_symbol: "€",
|
||||
int_curr_symbol: "EUR",
|
||||
speed: "km/h",
|
||||
distance: { 0: "m", 1: "km" },
|
||||
temperature: "°C",
|
||||
|
@ -643,8 +579,6 @@ var locales = {
|
|||
lang: "pt_BR",
|
||||
decimal_point: ",",
|
||||
thousands_sep: ".",
|
||||
currency_symbol: "R$", currency_first: true,
|
||||
int_curr_symbol: "BRL",
|
||||
speed: "kmh",
|
||||
distance: { 0: "m", 1: "km" },
|
||||
temperature: "°C",
|
||||
|
@ -661,8 +595,6 @@ var locales = {
|
|||
lang: "cs_CZ",
|
||||
decimal_point: ",",
|
||||
thousands_sep: " ",
|
||||
currency_symbol: "Kč",
|
||||
int_curr_symbol: " CZK",
|
||||
speed: 'kmh',
|
||||
distance: { "0": "m", "1": "km" },
|
||||
temperature: '°C',
|
||||
|
@ -679,8 +611,6 @@ var locales = {
|
|||
lang: "hr_HR",
|
||||
decimal_point: ",",
|
||||
thousands_sep: ".",
|
||||
currency_symbol: "€",
|
||||
int_curr_symbol: "EUR",
|
||||
speed: "km/h",
|
||||
distance: { 0: "m", 1: "km" },
|
||||
temperature: "°C",
|
||||
|
@ -697,8 +627,6 @@ var locales = {
|
|||
lang: "sl_SI",
|
||||
decimal_point: ",",
|
||||
thousands_sep: ".",
|
||||
currency_symbol: "€",
|
||||
int_curr_symbol: "EUR",
|
||||
speed: "km/h",
|
||||
distance: { 0: "m", 1: "km" },
|
||||
temperature: "°C",
|
||||
|
@ -715,8 +643,6 @@ var locales = {
|
|||
lang: "pt_PT",
|
||||
decimal_point: ",",
|
||||
thousands_sep: " ",
|
||||
currency_symbol: "€",
|
||||
int_curr_symbol: "EUR",
|
||||
speed: "kmh",
|
||||
distance: { 0: "m", 1: "km" },
|
||||
temperature: "°C",
|
||||
|
@ -733,8 +659,6 @@ var locales = {
|
|||
lang: "pl_PL",
|
||||
decimal_point: ",",
|
||||
thousands_sep: " ",
|
||||
currency_symbol: "zł",
|
||||
int_curr_symbol: "PLN",
|
||||
speed: "kmh",
|
||||
distance: { 0: "m", 1: "km" },
|
||||
temperature: "°C",
|
||||
|
@ -751,8 +675,6 @@ var locales = {
|
|||
lang: "lv_LV",
|
||||
decimal_point: ",",
|
||||
thousands_sep: " ",
|
||||
currency_symbol: "€",
|
||||
int_curr_symbol: "EUR",
|
||||
speed: "kmh",
|
||||
distance: { 0: "m", 1: "km" },
|
||||
temperature: "°C",
|
||||
|
@ -769,8 +691,6 @@ var locales = {
|
|||
lang: "nn_NO",
|
||||
decimal_point: ",",
|
||||
thousands_sep: " ",
|
||||
currency_symbol: "kr",
|
||||
int_curr_symbol: "NOK",
|
||||
speed: "kmt",
|
||||
distance: { 0: "m", 1: "km" },
|
||||
temperature: "°C",
|
||||
|
@ -787,8 +707,6 @@ var locales = {
|
|||
lang: "nb_NO",
|
||||
decimal_point: ",",
|
||||
thousands_sep: " ",
|
||||
currency_symbol: "kr",
|
||||
int_curr_symbol: "NOK",
|
||||
speed: "kmh",
|
||||
distance: { 0: "m", 1: "km" },
|
||||
temperature: "°C",
|
||||
|
@ -806,8 +724,6 @@ var locales = {
|
|||
icon: "🇪🇺",
|
||||
decimal_point: ",",
|
||||
thousands_sep: ".",
|
||||
currency_symbol: "€",
|
||||
int_curr_symbol: "EUR",
|
||||
speed: "kmh",
|
||||
distance: { 0: "m", 1: "km" },
|
||||
temperature: "°C",
|
||||
|
@ -827,8 +743,6 @@ var locales = {
|
|||
lang: "he_IL",
|
||||
decimal_point: ",",
|
||||
thousands_sep: ".",
|
||||
currency_symbol: "₪",
|
||||
int_curr_symbol: "ILS",
|
||||
speed: "קמ״ש",
|
||||
distance: { 0: "מ׳", 1: "ק״מ" },
|
||||
temperature: "°C",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"id": "locale",
|
||||
"name": "Languages",
|
||||
"version": "0.18",
|
||||
"version": "0.19",
|
||||
"description": "Translations for different countries",
|
||||
"icon": "locale.png",
|
||||
"type": "locale",
|
||||
|
|
|
@ -3,10 +3,20 @@ declare module Locale {
|
|||
|
||||
type Locale = {
|
||||
name: string,
|
||||
/**
|
||||
* @deprecated
|
||||
* There was no use case for this variable.
|
||||
* For more details, see https://github.com/espruino/BangleApps/issues/3269
|
||||
*/
|
||||
currencySym: string,
|
||||
dow(date: Date, short?: ShortBoolean): string,
|
||||
month(date: Date, short?: ShortBoolean): string,
|
||||
number(n: number): string,
|
||||
/**
|
||||
* @deprecated
|
||||
* There was no use case for this method.
|
||||
* For more details, see https://github.com/espruino/BangleApps/issues/3269
|
||||
*/
|
||||
currency(c: number): string,
|
||||
distance(d: number): string,
|
||||
speed(s: number): string,
|
||||
|
|
Loading…
Reference in New Issue