From 0e500ee2c1ca6aa6a8704901c4d1521a3953fd39 Mon Sep 17 00:00:00 2001 From: Adam Draper Date: Sat, 17 Dec 2016 08:48:28 -0800 Subject: [PATCH] add locales dir with unmagnified --- Gruntfile.js | 18 ++++++++++++- locales/be-nl.js | 34 +++++++++++++++++++++++++ locales/bg.js | 40 +++++++++++++++++++++++++++++ locales/chs.js | 32 +++++++++++++++++++++++ locales/cs.js | 32 +++++++++++++++++++++++ locales/da-dk.js | 32 +++++++++++++++++++++++ locales/de-ch.js | 32 +++++++++++++++++++++++ locales/de.js | 32 +++++++++++++++++++++++ locales/en-au.js | 36 ++++++++++++++++++++++++++ locales/en-gb.js | 36 ++++++++++++++++++++++++++ locales/en-za.js | 36 ++++++++++++++++++++++++++ locales/es-es.js | 37 +++++++++++++++++++++++++++ locales/es.js | 37 +++++++++++++++++++++++++++ locales/et.js | 33 ++++++++++++++++++++++++ locales/fi.js | 32 +++++++++++++++++++++++ locales/fr-ca.js | 32 +++++++++++++++++++++++ locales/fr-ch.js | 32 +++++++++++++++++++++++ locales/fr.js | 32 +++++++++++++++++++++++ locales/hu.js | 32 +++++++++++++++++++++++ locales/it.js | 32 +++++++++++++++++++++++ locales/ja.js | 32 +++++++++++++++++++++++ locales/lv.js | 32 +++++++++++++++++++++++ locales/nl-nl.js | 33 ++++++++++++++++++++++++ locales/no.js | 32 +++++++++++++++++++++++ locales/pl.js | 32 +++++++++++++++++++++++ locales/pt-br.js | 32 +++++++++++++++++++++++ locales/pt-pt.js | 32 +++++++++++++++++++++++ locales/ru-ua.js | 35 +++++++++++++++++++++++++ locales/ru.js | 35 +++++++++++++++++++++++++ locales/sk.js | 32 +++++++++++++++++++++++ locales/sl.js | 32 +++++++++++++++++++++++ locales/th.js | 34 +++++++++++++++++++++++++ locales/tr.js | 66 ++++++++++++++++++++++++++++++++++++++++++++++++ locales/uk-ua.js | 35 +++++++++++++++++++++++++ package.json | 1 + 35 files changed, 1153 insertions(+), 1 deletion(-) create mode 100644 locales/be-nl.js create mode 100644 locales/bg.js create mode 100644 locales/chs.js create mode 100644 locales/cs.js create mode 100644 locales/da-dk.js create mode 100644 locales/de-ch.js create mode 100644 locales/de.js create mode 100644 locales/en-au.js create mode 100644 locales/en-gb.js create mode 100644 locales/en-za.js create mode 100644 locales/es-es.js create mode 100644 locales/es.js create mode 100644 locales/et.js create mode 100644 locales/fi.js create mode 100644 locales/fr-ca.js create mode 100644 locales/fr-ch.js create mode 100644 locales/fr.js create mode 100644 locales/hu.js create mode 100644 locales/it.js create mode 100644 locales/ja.js create mode 100644 locales/lv.js create mode 100644 locales/nl-nl.js create mode 100644 locales/no.js create mode 100644 locales/pl.js create mode 100644 locales/pt-br.js create mode 100644 locales/pt-pt.js create mode 100644 locales/ru-ua.js create mode 100644 locales/ru.js create mode 100644 locales/sk.js create mode 100644 locales/sl.js create mode 100644 locales/th.js create mode 100644 locales/tr.js create mode 100644 locales/uk-ua.js diff --git a/Gruntfile.js b/Gruntfile.js index bfd187e3..71133c20 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -78,6 +78,20 @@ module.exports = function(grunt) { configFile: 'karma-ci.conf.js' } }, + copy: { + locales: { + files: [ + { + expand: true, + cwd: 'src/', + src: [ + 'locales/*.js' + ], + dest: './' + } + ] + } + }, compile: { locales: { type: 'locales' @@ -138,6 +152,7 @@ module.exports = function(grunt) { } }); + grunt.loadNpmTasks('grunt-contrib-copy'); grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-mocha-test'); @@ -154,7 +169,8 @@ module.exports = function(grunt) { grunt.registerTask('build', [ 'jshint', 'compile', - 'compile:numeral' + 'compile:numeral', + 'copy' ]); grunt.registerTask('test', [ diff --git a/locales/be-nl.js b/locales/be-nl.js new file mode 100644 index 00000000..15d948f5 --- /dev/null +++ b/locales/be-nl.js @@ -0,0 +1,34 @@ +// numeral.js locale configuration +// locale : belgium-dutch (be-nl) +// author : Dieter Luypaert : https://github.com/moeriki + +(function (global, factory) { + if (typeof define === 'function' && define.amd) { + define(['../numeral'], factory); + } else if (typeof module === 'object' && module.exports) { + factory(require('../numeral')); + } else { + factory(global.numeral); + } +}(this, function (numeral) { + numeral.register('locale', 'be-nl', { + delimiters: { + thousands: ' ', + decimal : ',' + }, + abbreviations: { + thousand : 'k', + million : ' mln', + billion : ' mld', + trillion : ' bln' + }, + ordinal : function (number) { + var remainder = number % 100; + + return (number !== 0 && remainder <= 1 || remainder === 8 || remainder >= 20) ? 'ste' : 'de'; + }, + currency: { + symbol: '€ ' + } + }); +})); diff --git a/locales/bg.js b/locales/bg.js new file mode 100644 index 00000000..ef71941c --- /dev/null +++ b/locales/bg.js @@ -0,0 +1,40 @@ +// numeral.js locale configuration +// locale : Bulgarian +// author : Don Vince : https://github.com/donvince/ + +(function (global, factory) { + if (typeof define === 'function' && define.amd) { + define(['../numeral'], factory); + } else if (typeof module === 'object' && module.exports) { + factory(require('../numeral')); + } else { + factory(global.numeral); + } +}(this, function (numeral) { + numeral.register('locale', 'bg', { + delimiters: { + thousands: ' ', + decimal: ',' + }, + abbreviations: { // I found these here http://www.unicode.org/cldr/charts/28/verify/numbers/bg.html + thousand: 'хил', + million: 'млн', + billion: 'млрд', + trillion: 'трлн' + }, + ordinal: function (number) { + // google translate suggests: + // 1st=1-ви; 2nd=2-ри; 7th=7-ми; + // 8th=8-ми and many others end with -ти + // for example 3rd=3-ти + // However since I've seen suggestions that in + // Bulgarian the ordinal can be taken in + // different forms (masculine, feminine, neuter) + // I've opted to wimp out on commiting that to code + return ''; + }, + currency: { + symbol: 'лв' + } + }); +})); diff --git a/locales/chs.js b/locales/chs.js new file mode 100644 index 00000000..1bcc9462 --- /dev/null +++ b/locales/chs.js @@ -0,0 +1,32 @@ +// numeral.js locale configuration +// locale : simplified chinese (chs) +// author : badplum : https://github.com/badplum + +(function (global, factory) { + if (typeof define === 'function' && define.amd) { + define(['../numeral'], factory); + } else if (typeof module === 'object' && module.exports) { + factory(require('../numeral')); + } else { + factory(global.numeral); + } +}(this, function (numeral) { + numeral.register('locale', 'chs', { + delimiters: { + thousands: ',', + decimal: '.' + }, + abbreviations: { + thousand: '千', + million: '百万', + billion: '十亿', + trillion: '兆' + }, + ordinal: function (number) { + return '.'; + }, + currency: { + symbol: '¥' + } + }); +})); diff --git a/locales/cs.js b/locales/cs.js new file mode 100644 index 00000000..316051f2 --- /dev/null +++ b/locales/cs.js @@ -0,0 +1,32 @@ +// numeral.js locale configuration +// locale : czech (cs) +// author : Anatoli Papirovski : https://github.com/apapirovski + +(function (global, factory) { + if (typeof define === 'function' && define.amd) { + define(['../numeral'], factory); + } else if (typeof module === 'object' && module.exports) { + factory(require('../numeral')); + } else { + factory(global.numeral); + } +}(this, function (numeral) { + numeral.register('locale', 'cs', { + delimiters: { + thousands: ' ', + decimal: ',' + }, + abbreviations: { + thousand: 'tis.', + million: 'mil.', + billion: 'b', + trillion: 't' + }, + ordinal: function () { + return '.'; + }, + currency: { + symbol: 'Kč' + } + }); +})); diff --git a/locales/da-dk.js b/locales/da-dk.js new file mode 100644 index 00000000..c21e5a78 --- /dev/null +++ b/locales/da-dk.js @@ -0,0 +1,32 @@ +// numeral.js locale configuration +// locale : danish denmark (dk) +// author : Michael Storgaard : https://github.com/mstorgaard + +(function (global, factory) { + if (typeof define === 'function' && define.amd) { + define(['../numeral'], factory); + } else if (typeof module === 'object' && module.exports) { + factory(require('../numeral')); + } else { + factory(global.numeral); + } +}(this, function (numeral) { + numeral.register('locale', 'da-dk', { + delimiters: { + thousands: '.', + decimal: ',' + }, + abbreviations: { + thousand: 'k', + million: 'mio', + billion: 'mia', + trillion: 'b' + }, + ordinal: function (number) { + return '.'; + }, + currency: { + symbol: 'DKK' + } + }); +})); diff --git a/locales/de-ch.js b/locales/de-ch.js new file mode 100644 index 00000000..5921e46c --- /dev/null +++ b/locales/de-ch.js @@ -0,0 +1,32 @@ +// numeral.js locale configuration +// locale : German in Switzerland (de-ch) +// author : Michael Piefel : https://github.com/piefel (based on work from Marco Krage : https://github.com/sinky) + +(function (global, factory) { + if (typeof define === 'function' && define.amd) { + define(['../numeral'], factory); + } else if (typeof module === 'object' && module.exports) { + factory(require('../numeral')); + } else { + factory(global.numeral); + } +}(this, function (numeral) { + numeral.register('locale', 'de-ch', { + delimiters: { + thousands: ' ', + decimal: ',' + }, + abbreviations: { + thousand: 'k', + million: 'm', + billion: 'b', + trillion: 't' + }, + ordinal: function (number) { + return '.'; + }, + currency: { + symbol: 'CHF' + } + }); +})); diff --git a/locales/de.js b/locales/de.js new file mode 100644 index 00000000..87f87880 --- /dev/null +++ b/locales/de.js @@ -0,0 +1,32 @@ +// numeral.js locale configuration +// locale : German (de) – generally useful in Germany, Austria, Luxembourg, Belgium +// author : Marco Krage : https://github.com/sinky + +(function (global, factory) { + if (typeof define === 'function' && define.amd) { + define(['../numeral'], factory); + } else if (typeof module === 'object' && module.exports) { + factory(require('../numeral')); + } else { + factory(global.numeral); + } +}(this, function (numeral) { + numeral.register('locale', 'de', { + delimiters: { + thousands: ' ', + decimal: ',' + }, + abbreviations: { + thousand: 'k', + million: 'm', + billion: 'b', + trillion: 't' + }, + ordinal: function (number) { + return '.'; + }, + currency: { + symbol: '€' + } + }); +})); diff --git a/locales/en-au.js b/locales/en-au.js new file mode 100644 index 00000000..6202c842 --- /dev/null +++ b/locales/en-au.js @@ -0,0 +1,36 @@ +// numeral.js locale configuration +// locale : English Australia +// author : Don Vince : https://github.com/donvince/ + +(function (global, factory) { + if (typeof define === 'function' && define.amd) { + define(['../numeral'], factory); + } else if (typeof module === 'object' && module.exports) { + factory(require('../numeral')); + } else { + factory(global.numeral); + } +}(this, function (numeral) { + numeral.register('locale', 'en-au', { + delimiters: { + thousands: ',', + decimal: '.' + }, + abbreviations: { + thousand: 'k', + million: 'm', + billion: 'b', + trillion: 't' + }, + ordinal: function (number) { + var b = number % 10; + return (~~ (number % 100 / 10) === 1) ? 'th' : + (b === 1) ? 'st' : + (b === 2) ? 'nd' : + (b === 3) ? 'rd' : 'th'; + }, + currency: { + symbol: '$' + } + }); +})); diff --git a/locales/en-gb.js b/locales/en-gb.js new file mode 100644 index 00000000..a51190eb --- /dev/null +++ b/locales/en-gb.js @@ -0,0 +1,36 @@ +// numeral.js locale configuration +// locale : english united kingdom (uk) +// author : Dan Ristic : https://github.com/dristic + +(function (global, factory) { + if (typeof define === 'function' && define.amd) { + define(['../numeral'], factory); + } else if (typeof module === 'object' && module.exports) { + factory(require('../numeral')); + } else { + factory(global.numeral); + } +}(this, function (numeral) { + numeral.register('locale', 'en-gb', { + delimiters: { + thousands: ',', + decimal: '.' + }, + abbreviations: { + thousand: 'k', + million: 'm', + billion: 'b', + trillion: 't' + }, + ordinal: function (number) { + var b = number % 10; + return (~~ (number % 100 / 10) === 1) ? 'th' : + (b === 1) ? 'st' : + (b === 2) ? 'nd' : + (b === 3) ? 'rd' : 'th'; + }, + currency: { + symbol: '£' + } + }); +})); diff --git a/locales/en-za.js b/locales/en-za.js new file mode 100644 index 00000000..8417268d --- /dev/null +++ b/locales/en-za.js @@ -0,0 +1,36 @@ +// numeral.js locale configuration +// locale : english south africa (uk) +// author : Etienne Boshoff : etienne@zailab.com + +(function (global, factory) { + if (typeof define === 'function' && define.amd) { + define(['../numeral'], factory); + } else if (typeof module === 'object' && module.exports) { + factory(require('../numeral')); + } else { + factory(global.numeral); + } +}(this, function (numeral) { + numeral.register('locale', 'en-za', { + delimiters: { + thousands: ' ', + decimal: ',' + }, + abbreviations: { + thousand: 'k', + million: 'm', + billion: 'b', + trillion: 't' + }, + ordinal: function (number) { + var b = number % 10; + return (~~ (number % 100 / 10) === 1) ? 'th' : + (b === 1) ? 'st' : + (b === 2) ? 'nd' : + (b === 3) ? 'rd' : 'th'; + }, + currency: { + symbol: 'R' + } + }); +})); diff --git a/locales/es-es.js b/locales/es-es.js new file mode 100644 index 00000000..31e7de5b --- /dev/null +++ b/locales/es-es.js @@ -0,0 +1,37 @@ +// numeral.js locale configuration +// locale : spanish Spain +// author : Hernan Garcia : https://github.com/hgarcia + +(function (global, factory) { + if (typeof define === 'function' && define.amd) { + define(['../numeral'], factory); + } else if (typeof module === 'object' && module.exports) { + factory(require('../numeral')); + } else { + factory(global.numeral); + } +}(this, function (numeral) { + numeral.register('locale', 'es-es', { + delimiters: { + thousands: '.', + decimal: ',' + }, + abbreviations: { + thousand: 'k', + million: 'mm', + billion: 'b', + trillion: 't' + }, + ordinal: function (number) { + var b = number % 10; + return (b === 1 || b === 3) ? 'er' : + (b === 2) ? 'do' : + (b === 7 || b === 0) ? 'mo' : + (b === 8) ? 'vo' : + (b === 9) ? 'no' : 'to'; + }, + currency: { + symbol: '€' + } + }); +})); diff --git a/locales/es.js b/locales/es.js new file mode 100644 index 00000000..7ca71950 --- /dev/null +++ b/locales/es.js @@ -0,0 +1,37 @@ +// numeral.js locale configuration +// locale : spanish +// author : Hernan Garcia : https://github.com/hgarcia + +(function (global, factory) { + if (typeof define === 'function' && define.amd) { + define(['../numeral'], factory); + } else if (typeof module === 'object' && module.exports) { + factory(require('../numeral')); + } else { + factory(global.numeral); + } +}(this, function (numeral) { + numeral.register('locale', 'es', { + delimiters: { + thousands: '.', + decimal: ',' + }, + abbreviations: { + thousand: 'k', + million: 'mm', + billion: 'b', + trillion: 't' + }, + ordinal: function (number) { + var b = number % 10; + return (b === 1 || b === 3) ? 'er' : + (b === 2) ? 'do' : + (b === 7 || b === 0) ? 'mo' : + (b === 8) ? 'vo' : + (b === 9) ? 'no' : 'to'; + }, + currency: { + symbol: '$' + } + }); +})); diff --git a/locales/et.js b/locales/et.js new file mode 100644 index 00000000..f8269e12 --- /dev/null +++ b/locales/et.js @@ -0,0 +1,33 @@ +// numeral.js locale configuration +// locale : Estonian +// author : Illimar Tambek : https://github.com/ragulka +// Note: in Estonian, abbreviations are always separated from numbers with a space + +(function (global, factory) { + if (typeof define === 'function' && define.amd) { + define(['../numeral'], factory); + } else if (typeof module === 'object' && module.exports) { + factory(require('../numeral')); + } else { + factory(global.numeral); + } +}(this, function (numeral) { + numeral.register('locale', 'et', { + delimiters: { + thousands: ' ', + decimal: ',' + }, + abbreviations: { + thousand: ' tuh', + million: ' mln', + billion: ' mld', + trillion: ' trl' + }, + ordinal: function (number) { + return '.'; + }, + currency: { + symbol: '€' + } + }); +})); diff --git a/locales/fi.js b/locales/fi.js new file mode 100644 index 00000000..25eaa7fd --- /dev/null +++ b/locales/fi.js @@ -0,0 +1,32 @@ +// numeral.js locale configuration +// locale : Finnish +// author : Sami Saada : https://github.com/samitheberber + +(function (global, factory) { + if (typeof define === 'function' && define.amd) { + define(['../numeral'], factory); + } else if (typeof module === 'object' && module.exports) { + factory(require('../numeral')); + } else { + factory(global.numeral); + } +}(this, function (numeral) { + numeral.register('locale', 'fi', { + delimiters: { + thousands: ' ', + decimal: ',' + }, + abbreviations: { + thousand: 'k', + million: 'M', + billion: 'G', + trillion: 'T' + }, + ordinal: function (number) { + return '.'; + }, + currency: { + symbol: '€' + } + }); +})); diff --git a/locales/fr-ca.js b/locales/fr-ca.js new file mode 100644 index 00000000..f8dd2061 --- /dev/null +++ b/locales/fr-ca.js @@ -0,0 +1,32 @@ +// numeral.js locale configuration +// locale : french (Canada) (fr-ca) +// author : Léo Renaud-Allaire : https://github.com/renaudleo + +(function (global, factory) { + if (typeof define === 'function' && define.amd) { + define(['../numeral'], factory); + } else if (typeof module === 'object' && module.exports) { + factory(require('../numeral')); + } else { + factory(global.numeral); + } +}(this, function (numeral) { + numeral.register('locale', 'fr-ca', { + delimiters: { + thousands: ' ', + decimal: ',' + }, + abbreviations: { + thousand: 'k', + million: 'M', + billion: 'G', + trillion: 'T' + }, + ordinal : function (number) { + return number === 1 ? 'er' : 'e'; + }, + currency: { + symbol: '$' + } + }); +})); diff --git a/locales/fr-ch.js b/locales/fr-ch.js new file mode 100644 index 00000000..ea29b39c --- /dev/null +++ b/locales/fr-ch.js @@ -0,0 +1,32 @@ +// numeral.js locale configuration +// locale : french (fr-ch) +// author : Adam Draper : https://github.com/adamwdraper + +(function (global, factory) { + if (typeof define === 'function' && define.amd) { + define(['../numeral'], factory); + } else if (typeof module === 'object' && module.exports) { + factory(require('../numeral')); + } else { + factory(global.numeral); + } +}(this, function (numeral) { + numeral.register('locale', 'fr-ch', { + delimiters: { + thousands: '\'', + decimal: '.' + }, + abbreviations: { + thousand: 'k', + million: 'm', + billion: 'b', + trillion: 't' + }, + ordinal : function (number) { + return number === 1 ? 'er' : 'e'; + }, + currency: { + symbol: 'CHF' + } + }); +})); diff --git a/locales/fr.js b/locales/fr.js new file mode 100644 index 00000000..5ddc609d --- /dev/null +++ b/locales/fr.js @@ -0,0 +1,32 @@ +// numeral.js locale configuration +// locale : french (fr) +// author : Adam Draper : https://github.com/adamwdraper + +(function (global, factory) { + if (typeof define === 'function' && define.amd) { + define(['../numeral'], factory); + } else if (typeof module === 'object' && module.exports) { + factory(require('../numeral')); + } else { + factory(global.numeral); + } +}(this, function (numeral) { + numeral.register('locale', 'fr', { + delimiters: { + thousands: ' ', + decimal: ',' + }, + abbreviations: { + thousand: 'k', + million: 'm', + billion: 'b', + trillion: 't' + }, + ordinal : function (number) { + return number === 1 ? 'er' : 'e'; + }, + currency: { + symbol: '€' + } + }); +})); diff --git a/locales/hu.js b/locales/hu.js new file mode 100644 index 00000000..a3d7638a --- /dev/null +++ b/locales/hu.js @@ -0,0 +1,32 @@ +// numeral.js locale configuration +// locale : Hungarian (hu) +// author : Peter Bakondy : https://github.com/pbakondy + +(function (global, factory) { + if (typeof define === 'function' && define.amd) { + define(['../numeral'], factory); + } else if (typeof module === 'object' && module.exports) { + factory(require('../numeral')); + } else { + factory(global.numeral); + } +}(this, function (numeral) { + numeral.register('locale', 'hu', { + delimiters: { + thousands: ' ', + decimal: ',' + }, + abbreviations: { + thousand: 'E', // ezer + million: 'M', // millió + billion: 'Mrd', // milliárd + trillion: 'T' // trillió + }, + ordinal: function (number) { + return '.'; + }, + currency: { + symbol: ' Ft' + } + }); +})); diff --git a/locales/it.js b/locales/it.js new file mode 100644 index 00000000..a5d3406e --- /dev/null +++ b/locales/it.js @@ -0,0 +1,32 @@ +// numeral.js locale configuration +// locale : italian Italy (it) +// author : Giacomo Trombi : http://cinquepunti.it + +(function (global, factory) { + if (typeof define === 'function' && define.amd) { + define(['../numeral'], factory); + } else if (typeof module === 'object' && module.exports) { + factory(require('../numeral')); + } else { + factory(global.numeral); + } +}(this, function (numeral) { + numeral.register('locale', 'it', { + delimiters: { + thousands: '.', + decimal: ',' + }, + abbreviations: { + thousand: 'mila', + million: 'mil', + billion: 'b', + trillion: 't' + }, + ordinal: function (number) { + return 'º'; + }, + currency: { + symbol: '€' + } + }); +})); diff --git a/locales/ja.js b/locales/ja.js new file mode 100644 index 00000000..bb6c8a1e --- /dev/null +++ b/locales/ja.js @@ -0,0 +1,32 @@ +// numeral.js locale configuration +// locale : japanese +// author : teppeis : https://github.com/teppeis + +(function (global, factory) { + if (typeof define === 'function' && define.amd) { + define(['../numeral'], factory); + } else if (typeof module === 'object' && module.exports) { + factory(require('../numeral')); + } else { + factory(global.numeral); + } +}(this, function (numeral) { + numeral.register('locale', 'ja', { + delimiters: { + thousands: ',', + decimal: '.' + }, + abbreviations: { + thousand: '千', + million: '百万', + billion: '十億', + trillion: '兆' + }, + ordinal: function (number) { + return '.'; + }, + currency: { + symbol: '¥' + } + }); +})); diff --git a/locales/lv.js b/locales/lv.js new file mode 100644 index 00000000..cc46c0e7 --- /dev/null +++ b/locales/lv.js @@ -0,0 +1,32 @@ +// numeral.js locale configuration +// locale : Latvian (lv) +// author : Lauris Bukšis-Haberkorns : https://github.com/Lafriks + +(function (global, factory) { + if (typeof define === 'function' && define.amd) { + define(['../numeral'], factory); + } else if (typeof module === 'object' && module.exports) { + factory(require('../numeral')); + } else { + factory(global.numeral); + } +}(this, function (numeral) { + numeral.register('locale', 'lv', { + delimiters: { + thousands: ' ', + decimal: ',' + }, + abbreviations: { + thousand: ' tūkst.', + million: ' milj.', + billion: ' mljrd.', + trillion: ' trilj.' + }, + ordinal: function (number) { + return '.'; + }, + currency: { + symbol: '€' + } + }); +})); diff --git a/locales/nl-nl.js b/locales/nl-nl.js new file mode 100644 index 00000000..00f70f7c --- /dev/null +++ b/locales/nl-nl.js @@ -0,0 +1,33 @@ +// numeral.js locale configuration +// locale : netherlands-dutch (nl-nl) +// author : Dave Clayton : https://github.com/davedx + +(function (global, factory) { + if (typeof define === 'function' && define.amd) { + define(['../numeral'], factory); + } else if (typeof module === 'object' && module.exports) { + factory(require('../numeral')); + } else { + factory(global.numeral); + } +}(this, function (numeral) { + numeral.register('locale', 'nl-nl', { + delimiters: { + thousands: '.', + decimal : ',' + }, + abbreviations: { + thousand : 'k', + million : 'mln', + billion : 'mrd', + trillion : 'bln' + }, + ordinal : function (number) { + var remainder = number % 100; + return (number !== 0 && remainder <= 1 || remainder === 8 || remainder >= 20) ? 'ste' : 'de'; + }, + currency: { + symbol: '€ ' + } + }); +})); diff --git a/locales/no.js b/locales/no.js new file mode 100644 index 00000000..2a2b06c8 --- /dev/null +++ b/locales/no.js @@ -0,0 +1,32 @@ +// numeral.js locale configuration +// locale : norwegian (bokmål) +// author : Ove Andersen : https://github.com/azzlack + +(function (global, factory) { + if (typeof define === 'function' && define.amd) { + define(['../numeral'], factory); + } else if (typeof module === 'object' && module.exports) { + factory(require('../numeral')); + } else { + factory(global.numeral); + } +}(this, function (numeral) { + numeral.register('locale', 'no', { + delimiters: { + thousands: ' ', + decimal: ',' + }, + abbreviations: { + thousand: 'k', + million: 'm', + billion: 'b', + trillion: 't' + }, + ordinal: function (number) { + return '.'; + }, + currency: { + symbol: 'kr' + } + }); +})); diff --git a/locales/pl.js b/locales/pl.js new file mode 100644 index 00000000..b336c090 --- /dev/null +++ b/locales/pl.js @@ -0,0 +1,32 @@ +// numeral.js locale configuration +// locale : polish (pl) +// author : Dominik Bulaj : https://github.com/dominikbulaj + +(function (global, factory) { + if (typeof define === 'function' && define.amd) { + define(['../numeral'], factory); + } else if (typeof module === 'object' && module.exports) { + factory(require('../numeral')); + } else { + factory(global.numeral); + } +}(this, function (numeral) { + numeral.register('locale', 'pl', { + delimiters: { + thousands: ' ', + decimal: ',' + }, + abbreviations: { + thousand: 'tys.', + million: 'mln', + billion: 'mld', + trillion: 'bln' + }, + ordinal: function (number) { + return '.'; + }, + currency: { + symbol: 'PLN' + } + }); +})); diff --git a/locales/pt-br.js b/locales/pt-br.js new file mode 100644 index 00000000..94d384b3 --- /dev/null +++ b/locales/pt-br.js @@ -0,0 +1,32 @@ +// numeral.js locale configuration +// locale : portuguese brazil (pt-br) +// author : Ramiro Varandas Jr : https://github.com/ramirovjr + +(function (global, factory) { + if (typeof define === 'function' && define.amd) { + define(['../numeral'], factory); + } else if (typeof module === 'object' && module.exports) { + factory(require('../numeral')); + } else { + factory(global.numeral); + } +}(this, function (numeral) { + numeral.register('locale', 'pt-br', { + delimiters: { + thousands: '.', + decimal: ',' + }, + abbreviations: { + thousand: 'mil', + million: 'milhões', + billion: 'b', + trillion: 't' + }, + ordinal: function (number) { + return 'º'; + }, + currency: { + symbol: 'R$' + } + }); +})); diff --git a/locales/pt-pt.js b/locales/pt-pt.js new file mode 100644 index 00000000..9bf59770 --- /dev/null +++ b/locales/pt-pt.js @@ -0,0 +1,32 @@ +// numeral.js locale configuration +// locale : portuguese (pt-pt) +// author : Diogo Resende : https://github.com/dresende + +(function (global, factory) { + if (typeof define === 'function' && define.amd) { + define(['../numeral'], factory); + } else if (typeof module === 'object' && module.exports) { + factory(require('../numeral')); + } else { + factory(global.numeral); + } +}(this, function (numeral) { + numeral.register('locale', 'pt-pt', { + delimiters: { + thousands: ' ', + decimal: ',' + }, + abbreviations: { + thousand: 'k', + million: 'm', + billion: 'b', + trillion: 't' + }, + ordinal : function (number) { + return 'º'; + }, + currency: { + symbol: '€' + } + }); +})); diff --git a/locales/ru-ua.js b/locales/ru-ua.js new file mode 100644 index 00000000..798f94f4 --- /dev/null +++ b/locales/ru-ua.js @@ -0,0 +1,35 @@ +// numeral.js locale configuration +// locale : Russian for the Ukraine (ru-ua) +// author : Anatoli Papirovski : https://github.com/apapirovski + +(function (global, factory) { + if (typeof define === 'function' && define.amd) { + define(['../numeral'], factory); + } else if (typeof module === 'object' && module.exports) { + factory(require('../numeral')); + } else { + factory(global.numeral); + } +}(this, function (numeral) { + numeral.register('locale', 'ru-ua', { + delimiters: { + thousands: ' ', + decimal: ',' + }, + abbreviations: { + thousand: 'тыс.', + million: 'млн', + billion: 'b', + trillion: 't' + }, + ordinal: function () { + // not ideal, but since in Russian it can taken on + // different forms (masculine, feminine, neuter) + // this is all we can do + return '.'; + }, + currency: { + symbol: '\u20B4' + } + }); +})); diff --git a/locales/ru.js b/locales/ru.js new file mode 100644 index 00000000..34dfb7f9 --- /dev/null +++ b/locales/ru.js @@ -0,0 +1,35 @@ +// numeral.js locale configuration +// locale : russian (ru) +// author : Anatoli Papirovski : https://github.com/apapirovski + +(function (global, factory) { + if (typeof define === 'function' && define.amd) { + define(['../numeral'], factory); + } else if (typeof module === 'object' && module.exports) { + factory(require('../numeral')); + } else { + factory(global.numeral); + } +}(this, function (numeral) { + numeral.register('locale', 'ru', { + delimiters: { + thousands: ' ', + decimal: ',' + }, + abbreviations: { + thousand: 'тыс.', + million: 'млн.', + billion: 'млрд.', + trillion: 'трлн.' + }, + ordinal: function () { + // not ideal, but since in Russian it can taken on + // different forms (masculine, feminine, neuter) + // this is all we can do + return '.'; + }, + currency: { + symbol: 'руб.' + } + }); +})); diff --git a/locales/sk.js b/locales/sk.js new file mode 100644 index 00000000..cb0e898d --- /dev/null +++ b/locales/sk.js @@ -0,0 +1,32 @@ +// numeral.js locale configuration +// locale : slovak (sk) +// author : Ahmed Al Hafoudh : http://www.freevision.sk + +(function (global, factory) { + if (typeof define === 'function' && define.amd) { + define(['../numeral'], factory); + } else if (typeof module === 'object' && module.exports) { + factory(require('../numeral')); + } else { + factory(global.numeral); + } +}(this, function (numeral) { + numeral.register('locale', 'sk', { + delimiters: { + thousands: ' ', + decimal: ',' + }, + abbreviations: { + thousand: 'tis.', + million: 'mil.', + billion: 'b', + trillion: 't' + }, + ordinal: function () { + return '.'; + }, + currency: { + symbol: '€' + } + }); +})); diff --git a/locales/sl.js b/locales/sl.js new file mode 100644 index 00000000..2f1117eb --- /dev/null +++ b/locales/sl.js @@ -0,0 +1,32 @@ +// numeral.js locale configuration +// locale : slovenian (sl) +// author : Boštjan Pišler : https://github.com/BostjanPisler + +(function (global, factory) { + if (typeof define === 'function' && define.amd) { + define(['../numeral'], factory); + } else if (typeof module === 'object' && module.exports) { + factory(require('../numeral')); + } else { + factory(global.numeral); + } +}(this, function (numeral) { + numeral.register('locale', 'sl', { + delimiters: { + thousands: '.', + decimal: ',' + }, + abbreviations: { + thousand: 'k', + million: 'mio', + billion: 'mrd', + trillion: 'trilijon' + }, + ordinal: function () { + return '.'; + }, + currency: { + symbol: '€' + } + }); +})); diff --git a/locales/th.js b/locales/th.js new file mode 100644 index 00000000..d3e08d00 --- /dev/null +++ b/locales/th.js @@ -0,0 +1,34 @@ +// numeral.js locale configuration +// locale : thai (th) +// author : Sathit Jittanupat : https://github.com/jojosati + +(function (global, factory) { + if (typeof define === 'function' && define.amd) { + define(['../numeral'], factory); + } else if (typeof module === 'object' && module.exports) { + factory(require('../numeral')); + } else { + factory(global.numeral); + } +}(this, function (numeral) { + + + numeral.register('locale', 'th', { + delimiters: { + thousands: ',', + decimal: '.' + }, + abbreviations: { + thousand: 'พัน', + million: 'ล้าน', + billion: 'พันล้าน', + trillion: 'ล้านล้าน' + }, + ordinal: function (number) { + return '.'; + }, + currency: { + symbol: '฿' + } + }); +})); diff --git a/locales/tr.js b/locales/tr.js new file mode 100644 index 00000000..07f7ffdd --- /dev/null +++ b/locales/tr.js @@ -0,0 +1,66 @@ +// numeral.js locale configuration +// locale : turkish (tr) +// author : Ecmel Ercan : https://github.com/ecmel, Erhan Gundogan : https://github.com/erhangundogan, Burak Yiğit Kaya: https://github.com/BYK + +(function (global, factory) { + if (typeof define === 'function' && define.amd) { + define(['../numeral'], factory); + } else if (typeof module === 'object' && module.exports) { + factory(require('../numeral')); + } else { + factory(global.numeral); + } +}(this, function (numeral) { + var suffixes = { + 1: '\'inci', + 5: '\'inci', + 8: '\'inci', + 70: '\'inci', + 80: '\'inci', + + 2: '\'nci', + 7: '\'nci', + 20: '\'nci', + 50: '\'nci', + + 3: '\'üncü', + 4: '\'üncü', + 100: '\'üncü', + + 6: '\'ncı', + + 9: '\'uncu', + 10: '\'uncu', + 30: '\'uncu', + + 60: '\'ıncı', + 90: '\'ıncı' + }; + + numeral.register('locale', 'tr', { + delimiters: { + thousands: '.', + decimal: ',' + }, + abbreviations: { + thousand: 'bin', + million: 'milyon', + billion: 'milyar', + trillion: 'trilyon' + }, + ordinal: function (number) { + if (number === 0) { // special case for zero + return '\'ıncı'; + } + + var a = number % 10, + b = number % 100 - a, + c = number >= 100 ? 100 : null; + + return suffixes[a] || suffixes[b] || suffixes[c]; + }, + currency: { + symbol: '\u20BA' + } + }); +})); diff --git a/locales/uk-ua.js b/locales/uk-ua.js new file mode 100644 index 00000000..34b31037 --- /dev/null +++ b/locales/uk-ua.js @@ -0,0 +1,35 @@ +// numeral.js locale configuration +// locale : Ukrainian for the Ukraine (uk-ua) +// author : Michael Piefel : https://github.com/piefel (with help from Tetyana Kuzmenko) + +(function (global, factory) { + if (typeof define === 'function' && define.amd) { + define(['../numeral'], factory); + } else if (typeof module === 'object' && module.exports) { + factory(require('../numeral')); + } else { + factory(global.numeral); + } +}(this, function (numeral) { + numeral.register('locale', 'uk-ua', { + delimiters: { + thousands: ' ', + decimal: ',' + }, + abbreviations: { + thousand: 'тис.', + million: 'млн', + billion: 'млрд', + trillion: 'блн' + }, + ordinal: function () { + // not ideal, but since in Ukrainian it can taken on + // different forms (masculine, feminine, neuter) + // this is all we can do + return ''; + }, + currency: { + symbol: '\u20B4' + } + }); +})); diff --git a/package.json b/package.json index 68291891..0fa11856 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "devDependencies": { "chai": "^3.5.0", "grunt": "latest", + "grunt-contrib-copy": "^1.0.0", "grunt-contrib-jshint": "latest", "grunt-contrib-nodeunit": "1.0.0", "grunt-contrib-uglify": "latest",