From 1d916a375b54d4645a280332c88c18f61a93f68a Mon Sep 17 00:00:00 2001 From: Iskren Chernev Date: Tue, 29 Jul 2014 09:33:24 -0700 Subject: [PATCH] Convert 4 remaining languages to locale --- {lang => locale}/af.js | 6 +++--- {lang => locale}/be.js | 6 +++--- {lang => locale}/my.js | 6 +++--- {lang => locale}/ti.js | 6 +++--- test/{lang => locale}/af.js | 14 +++----------- test/{lang => locale}/be.js | 15 ++++----------- test/{lang => locale}/my.js | 15 ++++----------- test/{lang => locale}/ti.js | 14 +++----------- 8 files changed, 26 insertions(+), 56 deletions(-) rename {lang => locale}/af.js (95%) rename {lang => locale}/be.js (98%) rename {lang => locale}/my.js (97%) rename {lang => locale}/ti.js (97%) rename test/{lang => locale}/af.js (98%) rename test/{lang => locale}/be.js (98%) rename test/{lang => locale}/my.js (98%) rename test/{lang => locale}/ti.js (98%) diff --git a/lang/af.js b/locale/af.js similarity index 95% rename from lang/af.js rename to locale/af.js index de7fc2427..2777e58e7 100644 --- a/lang/af.js +++ b/locale/af.js @@ -1,5 +1,5 @@ -// moment.js language configuration -// language : afrikaans (af) +// moment.js locale configuration +// locale : afrikaans (af) // author : Werner Mollentze : https://github.com/wernerm (function (factory) { @@ -11,7 +11,7 @@ factory(window.moment); // Browser global } }(function (moment) { - return moment.lang('af', { + return moment.defineLocale('af', { months : "Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember".split("_"), monthsShort : "Jan_Feb_Mar_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des".split("_"), weekdays : "Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag".split("_"), diff --git a/lang/be.js b/locale/be.js similarity index 98% rename from lang/be.js rename to locale/be.js index aaa5dd28f..6e0aef1b8 100644 --- a/lang/be.js +++ b/locale/be.js @@ -1,5 +1,5 @@ -// moment.js language configuration -// language : belarusian (be) +// moment.js locale configuration +// locale : belarusian (be) // author : Dmitry Demidov : https://github.com/demidov91 // author: Praleska: http://praleska.pro/ // Author : Menelion Elensúle : https://github.com/Oire @@ -63,7 +63,7 @@ return weekdays[nounCase][m.day()]; } - return moment.lang('be', { + return moment.defineLocale('be', { months : monthsCaseReplace, monthsShort : 'студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж'.split('_'), weekdays : weekdaysCaseReplace, diff --git a/lang/my.js b/locale/my.js similarity index 97% rename from lang/my.js rename to locale/my.js index b244d5f87..426e8db34 100644 --- a/lang/my.js +++ b/locale/my.js @@ -1,5 +1,5 @@ -// moment.js language configuration -// language : Burmese (mm) +// moment.js locale configuration +// locale : Burmese (mm) // author : Squar team, mysquar.com (function (factory) { @@ -34,7 +34,7 @@ '၉': '9', '၀': '0' }; - return moment.lang('my', { + return moment.defineLocale('my', { months: "ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ".split("_"), monthsShort: "ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ".split("_"), weekdays: "တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ".split("_"), diff --git a/lang/ti.js b/locale/ti.js similarity index 97% rename from lang/ti.js rename to locale/ti.js index 1a44767ae..b95d2e27c 100644 --- a/lang/ti.js +++ b/locale/ti.js @@ -1,5 +1,5 @@ -// moment.js language configuration -// language : tibetan (ti) +// moment.js locale configuration +// locale : tibetan (ti) // author : Thupten N. Chakrishar : https://github.com/vajradog (function (factory) { @@ -36,7 +36,7 @@ '༠': '0' }; - return moment.lang('ti', { + return moment.defineLocale('ti', { months : 'ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ'.split("_"), monthsShort : 'ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ'.split("_"), weekdays : 'གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་'.split("_"), diff --git a/test/lang/af.js b/test/locale/af.js similarity index 98% rename from test/lang/af.js rename to test/locale/af.js index 05d4d8780..e254c92af 100644 --- a/test/lang/af.js +++ b/test/locale/af.js @@ -5,9 +5,9 @@ var moment = require("../../moment"); Afrikaans *************************************************/ -exports["lang:af"] = { +exports["locale:af"] = { setUp : function (cb) { - moment.lang('af'); + moment.locale('af'); moment.createFromInputFallback = function () { throw new Error("input not handled by moment"); }; @@ -15,7 +15,7 @@ exports["lang:af"] = { }, tearDown : function (cb) { - moment.lang('en'); + moment.locale('en'); cb(); }, @@ -314,14 +314,6 @@ exports["lang:af"] = { test.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2de', "Jan 9 2012 should be week 2"); test.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2de', "Jan 15 2012 should be week 2"); - test.done(); - }, - - "returns the name of the language" : function (test) { - if (typeof module !== 'undefined' && module.exports) { - test.equal(require('../../lang/af'), 'af', "module should export af"); - } - test.done(); } }; diff --git a/test/lang/be.js b/test/locale/be.js similarity index 98% rename from test/lang/be.js rename to test/locale/be.js index 51dfa77e7..e63f28969 100644 --- a/test/lang/be.js +++ b/test/locale/be.js @@ -5,9 +5,9 @@ var moment = require("../../moment"); Belarusian *************************************************/ -exports["lang:be"] = { +exports["locale:be"] = { setUp : function (cb) { - moment.lang('be'); + moment.locale('be'); moment.createFromInputFallback = function () { throw new Error("input not handled by moment"); }; @@ -15,7 +15,7 @@ exports["lang:be"] = { }, tearDown : function (cb) { - moment.lang('en'); + moment.locale('en'); cb(); }, @@ -372,14 +372,7 @@ exports["lang:be"] = { test.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2-і', "Jan 8 2012 should be week 2"); test.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3-і', "Jan 9 2012 should be week 3"); - test.done(); - }, - - "returns the name of the language" : function (test) { - if (typeof module !== 'undefined' && module.exports) { - test.equal(require('../../lang/be'), 'be', "module should export be"); - } - test.done(); } + }; diff --git a/test/lang/my.js b/test/locale/my.js similarity index 98% rename from test/lang/my.js rename to test/locale/my.js index d5e9882ff..aa5331db8 100644 --- a/test/lang/my.js +++ b/test/locale/my.js @@ -5,9 +5,9 @@ var moment = require("../../moment"); Myanmar Burmese *************************************************/ -exports["lang:my"] = { +exports["locale:my"] = { setUp: function (cb) { - moment.lang('my'); + moment.locale('my'); moment.createFromInputFallback = function () { throw new Error("input not handled by moment"); }; @@ -15,7 +15,7 @@ exports["lang:my"] = { }, tearDown: function (cb) { - moment.lang('en'); + moment.locale('en'); cb(); }, @@ -435,14 +435,7 @@ exports["lang:my"] = { test.equal(moment([2012, 0, 9]).format('w ww wo'), '၂ ၀၂ ၂', "Jan 9 2012 should be week 2"); test.equal(moment([2012, 0, 15]).format('w ww wo'), '၂ ၀၂ ၂', "Jan 15 2012 should be week 2"); - test.done(); - }, - - "returns the name of the language": function (test) { - if (typeof module !== 'undefined' && module.exports) { - test.equal(require('../../lang/my'), 'my', "module should export my"); - } - test.done(); } + }; diff --git a/test/lang/ti.js b/test/locale/ti.js similarity index 98% rename from test/lang/ti.js rename to test/locale/ti.js index 81bf496d5..b9b7a6320 100644 --- a/test/lang/ti.js +++ b/test/locale/ti.js @@ -5,9 +5,9 @@ var moment = require("../../moment"); Tibetan *************************************************/ -exports["lang:ti"] = { +exports["locale:ti"] = { setUp : function (cb) { - moment.lang('ti'); + moment.locale('ti'); moment.createFromInputFallback = function () { throw new Error("input not handled by moment"); }; @@ -15,7 +15,7 @@ exports["lang:ti"] = { }, tearDown : function (cb) { - moment.lang('en'); + moment.locale('en'); cb(); }, @@ -332,14 +332,6 @@ exports["lang:ti"] = { test.equal(moment([2012, 0, 14]).format('w ww wo'), '༢ ༠༢ ༢', "Jan 14 2012 should be week 2"); test.equal(moment([2012, 0, 15]).format('w ww wo'), '༣ ༠༣ ༣', "Jan 15 2012 should be week 3"); - test.done(); - }, - - "returns the name of the language" : function (test) { - if (typeof module !== 'undefined' && module.exports) { - test.equal(require('../../lang/ti'), 'ti', "module should export ti"); - } - test.done(); } }; -- 2.47.2