]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
corrected some assertions in the Tibetan Localization
authorvajradog <vajradog@gmail.com>
Tue, 22 Jul 2014 03:11:26 +0000 (23:11 -0400)
committervajradog <vajradog@gmail.com>
Tue, 22 Jul 2014 03:11:26 +0000 (23:11 -0400)
Date formatting in Tibetan can be a bit tricky

test/lang/ti.js

index 83da358b4ff905ebccd9ffaec9057ddf13dc2479..04eb6183df125c4401ce54e8569cb2b6a4e37413 100644 (file)
@@ -40,12 +40,12 @@ exports["lang:ti"] = {
 
     "format" : function (test) {
         var a = [
-                ['dddd, Do MMMM YYYY, a h:mm:ss à¤¬à¤\9cà¥\87',  'གཟའ་ཉི་མ་, ༡༤ ཟླ་བ་གཉིས་པ ༢༠༡༠, ཉིན་གུང ༣:२༢༥:༥༠ ལ་'],
-                ['ddd, a h à¤¬à¤\9cà¥\87',                       'གཟའ་ཉི་མ་, ཉིན་གུང ༣ ལ་'],
+                ['dddd, Do MMMM YYYY, a h:mm:ss à½£à¼\8b',  'གཟའ་ཉི་མ་, ༡༤ ཟླ་བ་གཉིས་པ ༢༠༡༠, ཉིན་གུང ༣:२༢༥:༥༠ ལ་'],
+                ['ddd, a h à½£à¼\8b',                       'གཟའ་ཉི་མ་, ཉིན་གུང ༣ ལ་'],
                 ['M Mo MM MMMM MMM',                   '༢ ༢ ༠༢ ཟླ་བ་གཉིས་པ ཟླ་བ་གཉིས་པ'],
                 ['YYYY YY',                            '༢༠༡༠ ༡༠'],
                 ['D Do DD',                            '༡༤ ༡༤ ༡༤'],
-                ['d do dddd ddd dd',                   '༠ à¼  à½\82à½\9fའà¼\8bà½\89ིà¼\8bà½\98à¼\8b à½\82à½\9fའà¼\8bཉི་མ་'],
+                ['d do dddd ddd dd',                   '༠ à¼  à½\82à½\9fའà¼\8bà½\89ིà¼\8bà½\98à¼\8b à½\89ིà¼\8bà½\98à¼\8b ཉི་མ་'],
                 ['DDD DDDo DDDD',                      '༤༥ ༤༥ ༠༤༥'],
                 ['w wo ww',                            '༨ ༨ ༠༨'],
                 ['h hh',                               '༣ ༠༣'],
@@ -55,12 +55,12 @@ exports["lang:ti"] = {
                 ['a A',                                'ཉིན་གུང ཉིན་གུང'],
                 ['L',                                  '༡༤/༠༢/༢༠༡༠'],
                 ['LL',                                 '༡༤ ཟླ་བ་གཉིས་པ ༢༠༡༠'],
-                ['LLL',                                '༡༤ ཟླ་བ་གཉིས་པ ༢༠༡༠, ཉིན་གུང ༣:༢༥ ལ་'],
-                ['LLLL',                               'གཟའ་ཉི་མ་, ༡༤ ཟླ་བ་གཉིས་པ ༢༠༡༠, ཉིན་གུང ༣:༢༥ ལ་'],
+                ['LLL',                                '༡༤ ཟླ་བ་གཉིས་པ ༢༠༡༠, ཉིན་གུང ༣:༢༥'],
+                ['LLLL',                               'གཟའ་ཉི་མ་, ༡༤ ཟླ་བ་གཉིས་པ ༢༠༡༠, ཉིན་གུང ༣:༢༥'],
                 ['l',                                  '༡༤/༢/༢༠༡༠'],
                 ['ll',                                 '༡༤ ཟླ་བ་གཉིས་པ ༢༠༡༠'],
-                ['lll',                                '༡༤ ཟླ་བ་གཉིས་པ ༢༠༡༠, ཉིན་གུང ༣:༢༥ ལ་'],
-                ['llll',                               'à½\82à½\9fའà¼\8bà½\89ིà¼\8bà½\98à¼\8b, à¼¡à¼¤ à½\9fླà¼\8bà½\96à¼\8bà½\82à½\89ིསà¼\8bà½\94 à¼¢à¼ à¼¡à¼ , à½\89ིà½\93à¼\8bà½\82ུà½\84 à¼£:༢༥ à½£à¼\8b']
+                ['lll',                                '༡༤ ཟླ་བ་གཉིས་པ ༢༠༡༠, ཉིན་གུང ༣:༢༥'],
+                ['llll',                               'à½\89ིà¼\8bà½\98à¼\8b, à¼¡à¼¤ à½\9fླà¼\8bà½\96à¼\8bà½\82à½\89ིསà¼\8bà½\94 à¼¢à¼ à¼¡à¼ , à½\89ིà½\93à¼\8bà½\82ུà½\84 à¼£:༢༥']
             ],
             b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
             i;
@@ -109,7 +109,7 @@ exports["lang:ti"] = {
     },
 
     "format month" : function (test) {
-        var expected = 'ཟླ་བ་དང་པོ ཟླ་བ་དང་པོ._ཟླ་བ་གཉིས་པ ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ ཟླ་བ་བཅུ་གཉིས་པ'.split("_"), i;
+        var expected = 'ཟླ་བ་དང་པོ ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ ཟླ་བ་བཅུ་གཉིས་པ'.split("_"), i;
         for (i = 0; i < expected.length; i++) {
             test.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);
         }
@@ -126,39 +126,39 @@ exports["lang:ti"] = {
 
     "from" : function (test) {
         var start = moment([2007, 1, 28]);
-        test.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  "à¤\95à¥\81à¤\9b à¤¹à¥\80 à¤\95à¥\8dषण", "44 seconds = a few seconds");
-        test.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  "སྐར་མ་ གཅིག",      "45 seconds = a minute");
-        test.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  "སྐར་མ་ གཅིག",      "89 seconds = a minute");
-        test.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  "སà¾\90རà¼\8bà½\98à¼\8b à¼¡",     "90 seconds = 2 minutes");
-        test.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  "སà¾\90རà¼\8bà½\98à¼\8b à¼¤à¼¤",    "44 minutes = 44 minutes");
-        test.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  "ཆུ་ཚོད་ གཅིག",       "45 minutes = an hour");
-        test.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  "ཆུ་ཚོད་ གཅིག",       "89 minutes = an hour");
-        test.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  "à½\86ུà¼\8bà½\9aོà½\91à¼\8b à¼¢",       "90 minutes = 2 hours");
-        test.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   "à½\86ུà¼\8bà½\9aོà½\91à¼\8b à¼¥",       "5 hours = 5 hours");
-        test.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  "à½\86ུà¼\8bà½\9aོà½\91à¼\8b à¼¢à¼¡",      "21 hours = 21 hours");
-        test.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  "ཉིན་ གཅིག",         "22 hours = a day");
-        test.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  "ཉིན་ གཅིག",         "35 hours = a day");
-        test.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  "à½\89ིà½\93à¼\8b à¼¢",        "36 hours = 2 days");
-        test.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   "ཉིན་ གཅིག",         "1 day = a day");
-        test.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   "à½\89ིà½\93à¼\8b à¼¥",        "5 days = 5 days");
-        test.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  "à½\89ིà½\93à¼\8b à¼¢à¼¥",       "25 days = 25 days");
-        test.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  "ཟླ་བ་ གཅིག",       "26 days = a month");
-        test.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  "ཟླ་བ་ གཅིག",       "30 days = a month");
-        test.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  "ཟླ་བ་ གཅིག",       "43 days = a month");
+        test.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  "ལà½\98à¼\8bསà½\84", "44 seconds = a few seconds");
+        test.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  "སྐར་མ་གཅིག",      "45 seconds = a minute");
+        test.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  "སྐར་མ་གཅིག",      "89 seconds = a minute");
+        test.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  "༡ à½¦à¾\90རà¼\8bà½\98",     "90 seconds = 2 minutes");
+        test.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  "༤༤ à½¦à¾\90རà¼\8bà½\98",    "44 minutes = 44 minutes");
+        test.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  "ཆུ་ཚོད་གཅིག",       "45 minutes = an hour");
+        test.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  "ཆུ་ཚོད་གཅིག",       "89 minutes = an hour");
+        test.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  "༢ à½\86ུà¼\8bà½\9aོà½\91",       "90 minutes = 2 hours");
+        test.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   "༥ à½\86ུà¼\8bà½\9aོà½\91",       "5 hours = 5 hours");
+        test.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  "༢༡ à½\86ུà¼\8bà½\9aོà½\91",      "21 hours = 21 hours");
+        test.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  "ཉིན་གཅིག",         "22 hours = a day");
+        test.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  "ཉིན་གཅིག",         "35 hours = a day");
+        test.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  "༢ à½\89ིà½\93",        "36 hours = 2 days");
+        test.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   "ཉིན་གཅིག",         "1 day = a day");
+        test.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   "༥ à½\89ིà½\93à¼\8b",        "5 days = 5 days");
+        test.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  "༢༥ à½\89ིà½\93",       "25 days = 25 days");
+        test.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  "ཟླ་བ་གཅིག",       "26 days = a month");
+        test.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  "ཟླ་བ་གཅིག",       "30 days = a month");
+        test.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  "ཟླ་བ་གཅིག",       "43 days = a month");
         test.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  "ཟླ་བ་ ༢",      "46 days = 2 months");
-        test.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  "à½\9fླà¼\8bà½\96à¼\8b à¼¢",      "75 days = 2 months");
-        test.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  "à½\9fླà¼\8bà½\96à¼\8b à¼£",      "76 days = 3 months");
-        test.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   "ཟླ་བ་ གཅིག",       "1 month = a month");
-        test.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   "à½\9fླà¼\8bà½\96à¼\8b à¼¥",      "5 months = 5 months");
-        test.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), "ལོ་ གཅིག",        "345 days = a year");
-        test.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), "ལོà¼\8b à¼¢",       "548 days = 2 years");
-        test.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   "ལོ་ གཅིག",        "1 year = a year");
-        test.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   "ལོà¼\8b à¼¥",       "5 years = 5 years");
+        test.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  "༢ à½\9fླà¼\8bà½\96",      "75 days = 2 months");
+        test.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  "༣ à½\9fླà¼\8bà½\96",      "76 days = 3 months");
+        test.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   "ཟླ་བ་གཅིག",       "1 month = a month");
+        test.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   "༥ à½\9fླà¼\8bà½\96",      "5 months = 5 months");
+        test.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), "ལོ་གཅིག",        "345 days = a year");
+        test.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), "༢ à½£à½¼",       "548 days = 2 years");
+        test.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   "ལོ་གཅིག",        "1 year = a year");
+        test.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   "༥ à½£à½¼",       "5 years = 5 years");
         test.done();
     },
 
     "suffix" : function (test) {
-        test.equal(moment(30000).from(0), "ལམ་སང",  "prefix");
+        test.equal(moment(30000).from(0), "ལམ་སང ལ་",  "prefix");
         test.equal(moment(0).from(30000), "ལམ་སང སྔན་ལ", "suffix");
         test.done();
     },
@@ -170,19 +170,19 @@ exports["lang:ti"] = {
 
     "fromNow" : function (test) {
         test.equal(moment().add({s: 30}).fromNow(), "ལམ་སང", "ལམ་སང");
-        test.equal(moment().add({d: 5}).fromNow(), "à½\89ིà½\93à¼\8bà¤\82 à¼¥ à½£à¼\8b", "à½\89ིà½\93à¼\8bà¤\82 à¼¥ ལ་");
+        test.equal(moment().add({d: 5}).fromNow(), "༥ à½\89ིà½\93à¼\8b à½£à¼\8b", "༥ à½\89ིà½\93à¼\8b ལ་");
         test.done();
     },
 
     "calendar day" : function (test) {
         var a = moment().hours(2).minutes(0).seconds(0);
 
-        test.equal(moment(a).calendar(),                     "དི་རིང མཚན་མོ ༢:༠༠ ལ་",     "today at the same time");
-        test.equal(moment(a).add({m: 25}).calendar(),      "དི་རིང མཚན་མོ ༢:༢༥ ལ་",     "Now plus 25 min");
-        test.equal(moment(a).add({h: 3}).calendar(),       "དི་རིང ཞོགས་ཀས ༥:༠༠ ལ་",     "Now plus 3 hour");
-        test.equal(moment(a).add({d: 1}).calendar(),       "སང་ཉིན མཚན་མོ ༢:༠༠ ལ་",  "tomorrow at the same time");
-        test.equal(moment(a).subtract({h: 1}).calendar(),  "དི་རིང མཚན་མོ ༡:༠༠ ལ་",     "Now minus 1 hour");
-        test.equal(moment(a).subtract({d: 1}).calendar(),  "ཁ་སང མཚན་མོ २:०० ལ་", "yesterday at the same time");
+        test.equal(moment(a).calendar(),                     "དི་རིང མཚན་མོ ༢:༠༠",     "today at the same time");
+        test.equal(moment(a).add({m: 25}).calendar(),      "དི་རིང མཚན་མོ ༢:༢༥",     "Now plus 25 min");
+        test.equal(moment(a).add({h: 3}).calendar(),       "དི་རིང ཞོགས་ཀས ༥:༠༠",     "Now plus 3 hour");
+        test.equal(moment(a).add({d: 1}).calendar(),       "སང་ཉིན མཚན་མོ ༢:༠༠་",  "tomorrow at the same time");
+        test.equal(moment(a).subtract({h: 1}).calendar(),  "དི་རིང མཚན་མོ ༡:༠༠",     "Now minus 1 hour");
+        test.equal(moment(a).subtract({d: 1}).calendar(),  "ཁ་སང མཚན་མོ २:००", "yesterday at the same time");
         test.done();
     },
 
@@ -190,11 +190,11 @@ exports["lang:ti"] = {
         var i, m;
         for (i = 2; i < 7; i++) {
             m = moment().add({d: i});
-            test.equal(m.calendar(),       m.format('dddd[,] LT'),  "Today + " + i + " days current time");
+            test.equal(m.calendar(),       m.format('[བདུན་ཕྲག་རྗེས་མ ] dddd[,] LT'),  "Today + " + i + " days current time");
             m.hours(0).minutes(0).seconds(0).milliseconds(0);
-            test.equal(m.calendar(),       m.format('dddd[,] LT'),  "Today + " + i + " days beginning of day");
+            test.equal(m.calendar(),       m.format('[བདུན་ཕྲག་རྗེས་མ ] dddd[,] LT'),  "Today + " + i + " days beginning of day");
             m.hours(23).minutes(59).seconds(59).milliseconds(999);
-            test.equal(m.calendar(),       m.format('dddd[,] LT'),  "Today + " + i + " days end of day");
+            test.equal(m.calendar(),       m.format('[བདུན་ཕྲག་རྗེས་མ ] dddd[,] LT'),  "Today + " + i + " days end of day");
         }
         test.done();
     },
@@ -204,11 +204,11 @@ exports["lang:ti"] = {
 
         for (i = 2; i < 7; i++) {
             m = moment().subtract({d: i});
-            test.equal(m.calendar(),       m.format('[à½\82à½\9eུà½\82à¼\8bལ ] dddd[,] LT'),  "Today - " + i + " days current time");
+            test.equal(m.calendar(),       m.format('[à½\96à½\91ུà½\93à¼\8bà½\95ྲà½\82à¼\8bà½\98à½\90འà¼\8bà½\98 ] dddd[,] LT'),  "Today - " + i + " days current time");
             m.hours(0).minutes(0).seconds(0).milliseconds(0);
-            test.equal(m.calendar(),       m.format('[à½\82à½\9eུà½\82à¼\8bལ ] dddd[,] LT'),  "Today - " + i + " days beginning of day");
+            test.equal(m.calendar(),       m.format('[à½\96à½\91ུà½\93à¼\8bà½\95ྲà½\82à¼\8bà½\98à½\90འà¼\8bà½\98 ] dddd[,] LT'),  "Today - " + i + " days beginning of day");
             m.hours(23).minutes(59).seconds(59).milliseconds(999);
-            test.equal(m.calendar(),       m.format('[à½\82à½\9eུà½\82à¼\8bལ ] dddd[,] LT'),  "Today - " + i + " days end of day");
+            test.equal(m.calendar(),       m.format('[à½\96à½\91ུà½\93à¼\8bà½\95ྲà½\82à¼\8bà½\98à½\90འà¼\8bà½\98 ] dddd[,] LT'),  "Today - " + i + " days end of day");
         }
         test.done();
     },
@@ -328,9 +328,9 @@ exports["lang:ti"] = {
     "weeks year starting sunday formatted" : function (test) {
         test.equal(moment([2012, 0,  1]).format('w ww wo'), '༡ ༠༡ ༡', "Jan  1 2012 should be week 1");
         test.equal(moment([2012, 0,  7]).format('w ww wo'), '༡ ༠༡ ༡', "Jan  7 2012 should be week 1");
-        test.equal(moment([2012, 0,  8]).format('w ww wo'), '༢ à¼ à¼¢ à¼ à¼¢', "Jan  8 2012 should be week 2");
+        test.equal(moment([2012, 0,  8]).format('w ww wo'), '༢ ༠༢ ༢', "Jan  8 2012 should be week 2");
         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.equal(moment([2012, 0, 15]).format('w ww wo'), '༣ ༠༣ ༣', "Jan 15 2012 should be week 3");
 
         test.done();
     },