Skip to content

Commit

Permalink
Convert 4 remaining languages to locale
Browse files Browse the repository at this point in the history
  • Loading branch information
ichernev committed Jul 30, 2014
1 parent 34ba8b6 commit 1d916a3
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 56 deletions.
6 changes: 3 additions & 3 deletions lang/af.js → locale/af.js
Original file line number Diff line number Diff line change
@@ -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) {
Expand All @@ -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("_"),
Expand Down
6 changes: 3 additions & 3 deletions lang/be.js → locale/be.js
Original file line number Diff line number Diff line change
@@ -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: https://praleska.pro/
// Author : Menelion Elensúle : https://github.com/Oire
Expand Down Expand Up @@ -63,7 +63,7 @@
return weekdays[nounCase][m.day()];
}

return moment.lang('be', {
return moment.defineLocale('be', {
months : monthsCaseReplace,
monthsShort : 'студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж'.split('_'),
weekdays : weekdaysCaseReplace,
Expand Down
6 changes: 3 additions & 3 deletions lang/my.js → locale/my.js
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down Expand Up @@ -34,7 +34,7 @@
'၉': '9',
'၀': '0'
};
return moment.lang('my', {
return moment.defineLocale('my', {
months: "ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ".split("_"),
monthsShort: "ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ".split("_"),
weekdays: "တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ".split("_"),
Expand Down
6 changes: 3 additions & 3 deletions lang/ti.js → locale/ti.js
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down Expand Up @@ -36,7 +36,7 @@
'༠': '0'
};

return moment.lang('ti', {
return moment.defineLocale('ti', {
months : 'ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ'.split("_"),
monthsShort : 'ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ'.split("_"),
weekdays : 'གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་'.split("_"),
Expand Down
14 changes: 3 additions & 11 deletions test/lang/af.js → test/locale/af.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ 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");
};
cb();
},

tearDown : function (cb) {
moment.lang('en');
moment.locale('en');
cb();
},

Expand Down Expand Up @@ -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();
}
};
15 changes: 4 additions & 11 deletions test/lang/be.js → test/locale/be.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ 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");
};
cb();
},

tearDown : function (cb) {
moment.lang('en');
moment.locale('en');
cb();
},

Expand Down Expand Up @@ -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();
}

};
15 changes: 4 additions & 11 deletions test/lang/my.js → test/locale/my.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ 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");
};
cb();
},

tearDown: function (cb) {
moment.lang('en');
moment.locale('en');
cb();
},

Expand Down Expand Up @@ -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();
}

};
14 changes: 3 additions & 11 deletions test/lang/ti.js → test/locale/ti.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ 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");
};
cb();
},

tearDown : function (cb) {
moment.lang('en');
moment.locale('en');
cb();
},

Expand Down Expand Up @@ -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();
}
};

0 comments on commit 1d916a3

Please sign in to comment.