From: Félix Bellanger Date: Thu, 20 Oct 2011 00:46:54 +0000 (+0200) Subject: Modified french prefix, and fixed tests related to seconds X-Git-Tag: 1.1.0~10^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=365ebd2dda1d09add1352ca60f9921ab771f357b;p=thirdparty%2Fmoment.git Modified french prefix, and fixed tests related to seconds --- diff --git a/lang/all.min.js b/lang/all.min.js index 375a6c585..299f978de 100644 --- a/lang/all.min.js +++ b/lang/all.min.js @@ -1 +1 @@ -(function(){var a={months:"Janvier_Février_Mars_Avril_Mai_Juin_Juillet_Aout_Septembre_Octobre_Novembre_Décembre".split("_"),monthsShort:"Jan_Fev_Mar_Avr_Mai_Juin_Juil_Aou_Sep_Oct_Nov_Dec".split("_"),weekdays:"Dimanche_Lundi_Mardi_Mercredi_Jeudi_Vendredi_Samedi".split("_"),weekdaysShort:"Dim_Lun_Mar_Mer_Jeu_Ven_Sam".split("_"),relativeTime:{future:"in %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"une année",yy:"%d années"},ordinal:function(a){return~~(a%100/10)===1?"er":"ème"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("fr",a)})(),function(){var a={months:"Gennaio_Febbraio_Marzo_Aprile_Maggio_Giugno_Luglio_Agosto_Settebre_Ottobre_Novembre_Dicembre".split("_"),monthsShort:"Gen_Feb_Mar_Apr_Mag_Giu_Lug_Ago_Set_Ott_Nov_Dic".split("_"),weekdays:"Domenica_Lunedi_Martedi_Mercoledi_Giovedi_Venerdi_Sabato".split("_"),weekdaysShort:"Dom_Lun_Mar_Mer_Gio_Ven_Sab".split("_"),relativeTime:{future:"in %s",past:"%s fa",s:"secondi",m:"un minuto",mm:"%d minuti",h:"un ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinal:function(){return"º"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("it",a)}(),function(){var a={months:"Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),monthsShort:"Jan_Feb_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),relativeTime:{future:"em %s",past:"%s atrás",s:"segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},ordinal:function(a){return"º"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("pt",a)}() \ No newline at end of file +(function(){var a={months:"Janvier_Février_Mars_Avril_Mai_Juin_Juillet_Aout_Septembre_Octobre_Novembre_Décembre".split("_"),monthsShort:"Jan_Fev_Mar_Avr_Mai_Juin_Juil_Aou_Sep_Oct_Nov_Dec".split("_"),weekdays:"Dimanche_Lundi_Mardi_Mercredi_Jeudi_Vendredi_Samedi".split("_"),weekdaysShort:"Dim_Lun_Mar_Mer_Jeu_Ven_Sam".split("_"),relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"une année",yy:"%d années"},ordinal:function(a){return~~(a%100/10)===1?"er":"ème"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("fr",a)})(),function(){var a={months:"Gennaio_Febbraio_Marzo_Aprile_Maggio_Giugno_Luglio_Agosto_Settebre_Ottobre_Novembre_Dicembre".split("_"),monthsShort:"Gen_Feb_Mar_Apr_Mag_Giu_Lug_Ago_Set_Ott_Nov_Dic".split("_"),weekdays:"Domenica_Lunedi_Martedi_Mercoledi_Giovedi_Venerdi_Sabato".split("_"),weekdaysShort:"Dom_Lun_Mar_Mer_Gio_Ven_Sab".split("_"),relativeTime:{future:"in %s",past:"%s fa",s:"secondi",m:"un minuto",mm:"%d minuti",h:"un ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinal:function(){return"º"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("it",a)}(),function(){var a={months:"Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),monthsShort:"Jan_Feb_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),relativeTime:{future:"em %s",past:"%s atrás",s:"segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},ordinal:function(a){return"º"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("pt",a)}() \ No newline at end of file diff --git a/lang/fr.js b/lang/fr.js index 763292c98..dec0b61fc 100644 --- a/lang/fr.js +++ b/lang/fr.js @@ -5,7 +5,7 @@ weekdays : "Dimanche_Lundi_Mardi_Mercredi_Jeudi_Vendredi_Samedi".split("_"), weekdaysShort : "Dim_Lun_Mar_Mer_Jeu_Ven_Sam".split("_"), relativeTime : { - future : "in %s", + future : "dans %s", past : "il y a %s", s : "quelques secondes", m : "une minute", diff --git a/lang/fr.min.js b/lang/fr.min.js index 521069ba0..6c12eafc6 100644 --- a/lang/fr.min.js +++ b/lang/fr.min.js @@ -1 +1 @@ -(function(){var a={months:"Janvier_Février_Mars_Avril_Mai_Juin_Juillet_Aout_Septembre_Octobre_Novembre_Décembre".split("_"),monthsShort:"Jan_Fev_Mar_Avr_Mai_Juin_Juil_Aou_Sep_Oct_Nov_Dec".split("_"),weekdays:"Dimanche_Lundi_Mardi_Mercredi_Jeudi_Vendredi_Samedi".split("_"),weekdaysShort:"Dim_Lun_Mar_Mer_Jeu_Ven_Sam".split("_"),relativeTime:{future:"in %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"une année",yy:"%d années"},ordinal:function(a){return~~(a%100/10)===1?"er":"ème"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("fr",a)})() \ No newline at end of file +(function(){var a={months:"Janvier_Février_Mars_Avril_Mai_Juin_Juillet_Aout_Septembre_Octobre_Novembre_Décembre".split("_"),monthsShort:"Jan_Fev_Mar_Avr_Mai_Juin_Juil_Aou_Sep_Oct_Nov_Dec".split("_"),weekdays:"Dimanche_Lundi_Mardi_Mercredi_Jeudi_Vendredi_Samedi".split("_"),weekdaysShort:"Dim_Lun_Mar_Mer_Jeu_Ven_Sam".split("_"),relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"une année",yy:"%d années"},ordinal:function(a){return~~(a%100/10)===1?"er":"ème"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("fr",a)})() \ No newline at end of file diff --git a/test/lang.js b/test/lang.js index c92e2e1e0..9c4cbdb04 100644 --- a/test/lang.js +++ b/test/lang.js @@ -90,47 +90,47 @@ test("format week", 7, function() { test("from", 30, function() { moment.lang('en'); var start = moment([2007, 1, 28]); - equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "seconds", "44 seconds = seconds"); - equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "a minute", "45 seconds = a minute"); - equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "a minute", "89 seconds = a minute"); - equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutes", "90 seconds = 2 minutes"); - equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutes", "44 minutes = 44 minutes"); - equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "an hour", "45 minutes = an hour"); - equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "an hour", "89 minutes = an hour"); - equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 hours", "90 minutes = 2 hours"); - equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 hours", "5 hours = 5 hours"); - equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 hours", "21 hours = 21 hours"); - equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "a day", "22 hours = a day"); - equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "a day", "35 hours = a day"); - equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 days", "36 hours = 2 days"); - equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "a day", "1 day = a day"); - equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 days", "5 days = 5 days"); - equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 days", "25 days = 25 days"); - equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "a month", "26 days = a month"); - equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "a month", "30 days = a month"); - equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "a month", "45 days = a month"); - equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 months", "46 days = 2 months"); - equal(start.from(moment([2007, 1, 28]).add({d:75}), true), "2 months", "75 days = 2 months"); - equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 months", "76 days = 3 months"); - equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "a month", "1 month = a month"); - equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 months", "5 months = 5 months"); - equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 months", "344 days = 11 months"); - equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "a year", "345 days = a year"); - equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "a year", "547 days = a year"); - equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 years", "548 days = 2 years"); - equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "a year", "1 year = a year"); - equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 years", "5 years = 5 years"); + equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "a few seconds", "44 seconds = a few seconds"); + equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "a minute", "45 seconds = a minute"); + equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "a minute", "89 seconds = a minute"); + equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutes", "90 seconds = 2 minutes"); + equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutes", "44 minutes = 44 minutes"); + equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "an hour", "45 minutes = an hour"); + equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "an hour", "89 minutes = an hour"); + equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 hours", "90 minutes = 2 hours"); + equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 hours", "5 hours = 5 hours"); + equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 hours", "21 hours = 21 hours"); + equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "a day", "22 hours = a day"); + equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "a day", "35 hours = a day"); + equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 days", "36 hours = 2 days"); + equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "a day", "1 day = a day"); + equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 days", "5 days = 5 days"); + equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 days", "25 days = 25 days"); + equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "a month", "26 days = a month"); + equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "a month", "30 days = a month"); + equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "a month", "45 days = a month"); + equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 months", "46 days = 2 months"); + equal(start.from(moment([2007, 1, 28]).add({d:75}), true), "2 months", "75 days = 2 months"); + equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 months", "76 days = 3 months"); + equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "a month", "1 month = a month"); + equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 months", "5 months = 5 months"); + equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 months", "344 days = 11 months"); + equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "a year", "345 days = a year"); + equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "a year", "547 days = a year"); + equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 years", "548 days = 2 years"); + equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "a year", "1 year = a year"); + equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 years", "5 years = 5 years"); }); test("suffix", 2, function() { moment.lang('en'); - equal(moment(30000).from(0), "in seconds", "prefix"); - equal(moment(0).from(30000), "seconds ago", "suffix"); + equal(moment(30000).from(0), "in a few seconds", "prefix"); + equal(moment(0).from(30000), "a few seconds ago", "suffix"); }); test("fromNow", 2, function() { moment.lang('en'); - equal(moment().add({s:30}).fromNow(), "in seconds", "in seconds"); + equal(moment().add({s:30}).fromNow(), "in a few seconds", "in a few seconds"); equal(moment().add({d:5}).fromNow(), "in 5 days", "in 5 days"); }); @@ -225,7 +225,7 @@ test("format week", 7, function() { test("from", 30, function() { moment.lang('fr'); var start = moment([2007, 1, 28]); - equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "secondes", "44 seconds = seconds"); + equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "quelques secondes", "44 seconds = a few seconds"); equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "une minute", "45 seconds = a minute"); equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "une minute", "89 seconds = a minute"); equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutes", "90 seconds = 2 minutes"); @@ -259,14 +259,14 @@ test("from", 30, function() { test("suffix", 2, function() { moment.lang('fr'); - equal(moment(30000).from(0), "in secondes", "prefix"); - equal(moment(0).from(30000), "il y a secondes", "suffix"); + equal(moment(30000).from(0), "dans quelques secondes", "prefix"); + equal(moment(0).from(30000), "il y a quelques secondes", "suffix"); }); test("fromNow", 2, function() { moment.lang('fr'); - equal(moment().add({s:30}).fromNow(), "in secondes", "in seconds"); - equal(moment().add({d:5}).fromNow(), "in 5 jours", "in 5 days"); + equal(moment().add({s:30}).fromNow(), "dans quelques secondes", "in a few seconds"); + equal(moment().add({d:5}).fromNow(), "dans 5 jours", "in 5 days"); }); /************************************************** Italian diff --git a/test/lang/en.js b/test/lang/en.js index 77f7451c6..ff08bec77 100644 --- a/test/lang/en.js +++ b/test/lang/en.js @@ -90,46 +90,46 @@ test("format week", 7, function() { test("from", 30, function() { moment.lang('en'); var start = moment([2007, 1, 28]); - equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "seconds", "44 seconds = seconds"); - equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "a minute", "45 seconds = a minute"); - equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "a minute", "89 seconds = a minute"); - equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutes", "90 seconds = 2 minutes"); - equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutes", "44 minutes = 44 minutes"); - equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "an hour", "45 minutes = an hour"); - equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "an hour", "89 minutes = an hour"); - equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 hours", "90 minutes = 2 hours"); - equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 hours", "5 hours = 5 hours"); - equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 hours", "21 hours = 21 hours"); - equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "a day", "22 hours = a day"); - equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "a day", "35 hours = a day"); - equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 days", "36 hours = 2 days"); - equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "a day", "1 day = a day"); - equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 days", "5 days = 5 days"); - equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 days", "25 days = 25 days"); - equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "a month", "26 days = a month"); - equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "a month", "30 days = a month"); - equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "a month", "45 days = a month"); - equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 months", "46 days = 2 months"); - equal(start.from(moment([2007, 1, 28]).add({d:75}), true), "2 months", "75 days = 2 months"); - equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 months", "76 days = 3 months"); - equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "a month", "1 month = a month"); - equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 months", "5 months = 5 months"); - equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 months", "344 days = 11 months"); - equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "a year", "345 days = a year"); - equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "a year", "547 days = a year"); - equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 years", "548 days = 2 years"); - equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "a year", "1 year = a year"); - equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 years", "5 years = 5 years"); + equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "a few seconds", "44 seconds = a few seconds"); + equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "a minute", "45 seconds = a minute"); + equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "a minute", "89 seconds = a minute"); + equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutes", "90 seconds = 2 minutes"); + equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutes", "44 minutes = 44 minutes"); + equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "an hour", "45 minutes = an hour"); + equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "an hour", "89 minutes = an hour"); + equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 hours", "90 minutes = 2 hours"); + equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 hours", "5 hours = 5 hours"); + equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 hours", "21 hours = 21 hours"); + equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "a day", "22 hours = a day"); + equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "a day", "35 hours = a day"); + equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 days", "36 hours = 2 days"); + equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "a day", "1 day = a day"); + equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 days", "5 days = 5 days"); + equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 days", "25 days = 25 days"); + equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "a month", "26 days = a month"); + equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "a month", "30 days = a month"); + equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "a month", "45 days = a month"); + equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 months", "46 days = 2 months"); + equal(start.from(moment([2007, 1, 28]).add({d:75}), true), "2 months", "75 days = 2 months"); + equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 months", "76 days = 3 months"); + equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "a month", "1 month = a month"); + equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 months", "5 months = 5 months"); + equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 months", "344 days = 11 months"); + equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "a year", "345 days = a year"); + equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "a year", "547 days = a year"); + equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 years", "548 days = 2 years"); + equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "a year", "1 year = a year"); + equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 years", "5 years = 5 years"); }); test("suffix", 2, function() { moment.lang('en'); - equal(moment(30000).from(0), "in seconds", "prefix"); - equal(moment(0).from(30000), "seconds ago", "suffix"); + equal(moment(30000).from(0), "in a few seconds", "prefix"); + equal(moment(0).from(30000), "a few seconds ago", "suffix"); }); test("fromNow", 2, function() { moment.lang('en'); - equal(moment().add({s:30}).fromNow(), "in seconds", "in seconds"); + equal(moment().add({s:30}).fromNow(), "in a few seconds", "in a few seconds"); equal(moment().add({d:5}).fromNow(), "in 5 days", "in 5 days"); }); diff --git a/test/lang/fr.js b/test/lang/fr.js index d8c54c6a0..904f78d8d 100644 --- a/test/lang/fr.js +++ b/test/lang/fr.js @@ -90,7 +90,7 @@ test("format week", 7, function() { test("from", 30, function() { moment.lang('fr'); var start = moment([2007, 1, 28]); - equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "secondes", "44 seconds = seconds"); + equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "quelques secondes", "44 seconds = a few seconds"); equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "une minute", "45 seconds = a minute"); equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "une minute", "89 seconds = a minute"); equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutes", "90 seconds = 2 minutes"); @@ -124,12 +124,12 @@ test("from", 30, function() { test("suffix", 2, function() { moment.lang('fr'); - equal(moment(30000).from(0), "in secondes", "prefix"); - equal(moment(0).from(30000), "il y a secondes", "suffix"); + equal(moment(30000).from(0), "dans quelques secondes", "prefix"); + equal(moment(0).from(30000), "il y a quelques secondes", "suffix"); }); test("fromNow", 2, function() { moment.lang('fr'); - equal(moment().add({s:30}).fromNow(), "in secondes", "in seconds"); - equal(moment().add({d:5}).fromNow(), "in 5 jours", "in 5 days"); + equal(moment().add({s:30}).fromNow(), "dans quelques secondes", "in a few seconds"); + equal(moment().add({d:5}).fromNow(), "dans 5 jours", "in 5 days"); }); \ No newline at end of file