]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Convert 4 remaining languages to locale 1807/head
authorIskren Chernev <iskren.chernev@gmail.com>
Tue, 29 Jul 2014 16:33:24 +0000 (09:33 -0700)
committerIskren Chernev <iskren.chernev@gmail.com>
Wed, 30 Jul 2014 04:48:42 +0000 (21:48 -0700)
locale/af.js [moved from lang/af.js with 95% similarity]
locale/be.js [moved from lang/be.js with 98% similarity]
locale/my.js [moved from lang/my.js with 97% similarity]
locale/ti.js [moved from lang/ti.js with 97% similarity]
test/locale/af.js [moved from test/lang/af.js with 98% similarity]
test/locale/be.js [moved from test/lang/be.js with 98% similarity]
test/locale/my.js [moved from test/lang/my.js with 98% similarity]
test/locale/ti.js [moved from test/lang/ti.js with 98% similarity]

similarity index 95%
rename from lang/af.js
rename to locale/af.js
index de7fc24270b462108d54a9eecb17450a11c5a385..2777e58e77f124bfd7f26317b462ba340641909f 100644 (file)
@@ -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("_"),
similarity index 98%
rename from lang/be.js
rename to locale/be.js
index aaa5dd28fed72db33c540f7d438978a1d3d4fe8c..6e0aef1b8d18acec13696ff27072f2ddd431c66a 100644 (file)
@@ -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,
similarity index 97%
rename from lang/my.js
rename to locale/my.js
index b244d5f87508e42fded43d2eb6b34670b374ddb1..426e8db342623aac832b5ec3747ed9102e64b7f3 100644 (file)
@@ -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("_"),
similarity index 97%
rename from lang/ti.js
rename to locale/ti.js
index 1a44767ae13b1395cb628c6355a54818c05daf63..b95d2e27ce464bc8302de46a3653407f2e091efb 100644 (file)
@@ -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("_"),
similarity index 98%
rename from test/lang/af.js
rename to test/locale/af.js
index 05d4d8780b3aa0af7012b3f908d6bca9269737c7..e254c92afa1f86649248bf0bbd06ecde2f3bcafd 100644 (file)
@@ -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();
     }
 };
similarity index 98%
rename from test/lang/be.js
rename to test/locale/be.js
index 51dfa77e7deffac81be3d65141f26740d7bbf052..e63f289696f236a6f8d6be0a92da6d4a646f8e2f 100644 (file)
@@ -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();
     }
+
 };
similarity index 98%
rename from test/lang/my.js
rename to test/locale/my.js
index d5e9882ff6cbb22ffad289ac45ff88c84aac4397..aa5331db8b03b37b79763c732762cb23c07ec737 100644 (file)
@@ -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();
     }
+
 };
similarity index 98%
rename from test/lang/ti.js
rename to test/locale/ti.js
index 81bf496d54664aefab9143c68380048e9bc66177..b9b7a632069d9a810d7e06588ebf246d4328f392 100644 (file)
@@ -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();
     }
 };