diff --git a/app/helpers/spree/base_helper.rb b/app/helpers/spree/base_helper.rb index 92e38aa8a1..77e8378fac 100644 --- a/app/helpers/spree/base_helper.rb +++ b/app/helpers/spree/base_helper.rb @@ -36,8 +36,7 @@ module Spree end def pretty_time(time) - [I18n.l(time.to_date, format: :long), - time.strftime("%l:%M %p")].join(" ") + I18n.l(time, format: :long) end end end diff --git a/config/locales/de_CH.yml b/config/locales/de_CH.yml index e229d58159..1a674e2a91 100644 --- a/config/locales/de_CH.yml +++ b/config/locales/de_CH.yml @@ -1,5 +1,10 @@ de_CH: language_name: "Deutsch" + date: + day_names: [Sonntag, Montag, Dienstag, Mittwoch, Donnerstag, Freitag, Samstag] + abbr_day_names: [So, Mo, Di, Mi, Do, Fr, Sa] + month_names: [~, Januar, Februar, März, April, Mai, Juni, Juli, August, September, Oktober, November, Dezember] + abbr_month_names: [~, Jan, Feb, Mär, Apr, Mai, Jun, Jul, Aug, Sep, Okt, Nov, Dez] activerecord: models: spree/product: Produkt diff --git a/config/locales/de_DE.yml b/config/locales/de_DE.yml index 9293af7da9..7dc883ee60 100644 --- a/config/locales/de_DE.yml +++ b/config/locales/de_DE.yml @@ -1,5 +1,10 @@ de_DE: language_name: "Deutsch" + date: + day_names: [Sonntag, Montag, Dienstag, Mittwoch, Donnerstag, Freitag, Samstag] + abbr_day_names: [So, Mo, Di, Mi, Do, Fr, Sa] + month_names: [~, Januar, Februar, März, April, Mai, Juni, Juli, August, September, Oktober, November, Dezember] + abbr_month_names: [~, Jan, Feb, Mär, Apr, Mai, Jun, Jul, Aug, Sep, Okt, Nov, Dez] activerecord: models: spree/product: Produkt diff --git a/config/locales/en.yml b/config/locales/en.yml index b91dee854b..d7ce26bfc6 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -21,6 +21,9 @@ en: # Overridden here due to a bug in spree i18n (Issue #870, and issue #1800) language_name: "English" # Localised name of this language + time: + formats: + long: "%B %d, %Y %-l:%M %p" activerecord: models: spree/product: Product diff --git a/config/locales/es_CO.yml b/config/locales/es_CO.yml index febbe46d98..c7522f8416 100644 --- a/config/locales/es_CO.yml +++ b/config/locales/es_CO.yml @@ -1,5 +1,10 @@ es_CO: language_name: "Español" + date: + day_names: [domingo, lunes, martes, miércoles, jueves, viernes, sábado] + abbr_day_names: [dom, lun, mar, mié, jue, vie, sáb] + month_names: [~, enero, febrero, marzo, abril, mayo, junio, julio, agosto, septiembre, octubre, noviembre, diciembre] + abbr_month_names: [ ~, ene, feb, mar, abr, may, jun, jul, ago, sep, oct, nov, dic] activerecord: models: spree/product: Producto diff --git a/config/locales/es_CR.yml b/config/locales/es_CR.yml index 12f91924c9..9c5ec8b9fc 100644 --- a/config/locales/es_CR.yml +++ b/config/locales/es_CR.yml @@ -1,5 +1,10 @@ es_CR: language_name: "Español" + date: + day_names: [domingo, lunes, martes, miércoles, jueves, viernes, sábado] + abbr_day_names: [dom, lun, mar, mié, jue, vie, sáb] + month_names: [~, enero, febrero, marzo, abril, mayo, junio, julio, agosto, septiembre, octubre, noviembre, diciembre] + abbr_month_names: [~, ene, feb, mar, abr, may, jun, jul, ago, sep, oct, nov, dic] activerecord: models: spree/product: Producto diff --git a/config/locales/es_US.yml b/config/locales/es_US.yml index cf27824b38..120de6edde 100644 --- a/config/locales/es_US.yml +++ b/config/locales/es_US.yml @@ -1,5 +1,10 @@ es_US: language_name: "Español" + date: + day_names: [domingo, lunes, martes, miércoles, jueves, viernes, sábado] + abbr_day_names: [dom, lun, mar, mié, jue, vie, sáb] + month_names: [~, enero, febrero, marzo, abril, mayo, junio, julio, agosto, septiembre, octubre, noviembre, diciembre] + abbr_month_names: [~, ene, feb, mar, abr, may, jun, jul, ago, sep, oct, nov, dic] activerecord: models: spree/product: Producto diff --git a/config/locales/fil_PH.yml b/config/locales/fil_PH.yml index fe3474a59d..76fb72be24 100644 --- a/config/locales/fil_PH.yml +++ b/config/locales/fil_PH.yml @@ -1,5 +1,10 @@ fil_PH: language_name: "Filipino" + date: + day_names: [Linggo, Lunes, Martes, Miyerkoles, Huwebes, Biyernes, Sabado] + abbr_day_names: [Lin, Lun, Mar, Miy, Huw, Biy, Sab] + month_names: [~, Enero, Pebrero, Marso, Abril, Mayo, Hunyo, Hulyo, Agosto, Setyembre, Oktubre, Nobyembre, Disyembre] + abbr_month_names: [~, Ene, Peb, Mar, Abr, May, Hun, Hul, Ago, Set, Okt, Nob, Dis] activerecord: models: spree/product: Produkto diff --git a/config/locales/fr_BE.yml b/config/locales/fr_BE.yml index 0210c6a4f6..8ae7394aca 100644 --- a/config/locales/fr_BE.yml +++ b/config/locales/fr_BE.yml @@ -1,5 +1,10 @@ fr_BE: language_name: "Français" + date: + day_names: [dimanche, lundi, mardi, mercredi, jeudi, vendredi, samedi] + abbr_day_names: [dim, lun, mar, mer, jeu, ven, sam] + month_names: [~, janvier, février, mars, avril, mai, juin, juillet, août, septembre, octobre, novembre, décembre] + abbr_month_names: [~, jan, fév, mar, avr, mai, jun, jui, aoû, sep, oct, nov, déc] activerecord: models: spree/product: Produit diff --git a/config/locales/fr_CA.yml b/config/locales/fr_CA.yml index dd2fa765df..cb11b1c853 100644 --- a/config/locales/fr_CA.yml +++ b/config/locales/fr_CA.yml @@ -1,5 +1,10 @@ fr_CA: language_name: "Français" + date: + day_names: [dimanche, lundi, mardi, mercredi, jeudi, vendredi, samedi] + abbr_day_names: [dim, lun, mar, mer, jeu, ven, sam] + month_names: [~, janvier, février, mars, avril, mai, juin, juillet, août, septembre, octobre, novembre, décembre] + abbr_month_names: [~, jan, fév, mar, avr, mai, jun, jui, aoû, sep, oct, nov, déc] activerecord: models: spree/product: Produit diff --git a/config/locales/fr_CH.yml b/config/locales/fr_CH.yml index e594bb1d81..910458747b 100644 --- a/config/locales/fr_CH.yml +++ b/config/locales/fr_CH.yml @@ -1,5 +1,10 @@ fr_CH: language_name: "Français" + date: + day_names: [dimanche, lundi, mardi, mercredi, jeudi, vendredi, samedi] + abbr_day_names: [dim, lun, mar, mer, jeu, ven, sam] + month_names: [~, janvier, février, mars, avril, mai, juin, juillet, août, septembre, octobre, novembre, décembre] + abbr_month_names: [~, jan, fév, mar, avr, mai, jun, jui, aoû, sep, oct, nov, déc] activerecord: models: spree/product: Produit diff --git a/config/locales/fr_CM.yml b/config/locales/fr_CM.yml index 09ea06d8fa..ec7b0e23f7 100644 --- a/config/locales/fr_CM.yml +++ b/config/locales/fr_CM.yml @@ -1,5 +1,10 @@ fr_CM: language_name: "Français" + date: + day_names: [dimanche, lundi, mardi, mercredi, jeudi, vendredi, samedi] + abbr_day_names: [dim, lun, mar, mer, jeu, ven, sam] + month_names: [~, janvier, février, mars, avril, mai, juin, juillet, août, septembre, octobre, novembre, décembre] + abbr_month_names: [~, jan, fév, mar, avr, mai, jun, jui, aoû, sep, oct, nov, déc] activerecord: models: spree/product: Produit diff --git a/config/locales/it_CH.yml b/config/locales/it_CH.yml index 817650f90d..5d134c4c93 100644 --- a/config/locales/it_CH.yml +++ b/config/locales/it_CH.yml @@ -1,5 +1,10 @@ it_CH: language_name: "Italiano" + date: + day_names: [domenica, lunedì, martedì, mercoledì, giovedì, venerdì, sabato] + abbr_day_names: [dom, lun, mar, mer, gio, ven, sab] + month_names: [~, gennaio, febbraio, marzo, aprile, maggio, giugno, luglio, agosto, settembre, ottobre, novembre, dicembre] + abbr_month_names: [~, gen, feb, mar, apr, mag, giu, lug, ago, set, ott, nov, dic] activerecord: models: spree/product: Prodotto diff --git a/config/locales/nl_BE.yml b/config/locales/nl_BE.yml index fc39d0b6d2..e24eb20bf3 100644 --- a/config/locales/nl_BE.yml +++ b/config/locales/nl_BE.yml @@ -1,5 +1,10 @@ nl_BE: language_name: "Nederlands" + date: + day_names: [zondag, maandag, dinsdag, woensdag, donderdag, vrijdag, zaterdag] + abbr_day_names: [zo, ma, di, wo, do, vr, za] + month_names: [~, januari, februari, maart, april, mei, juni, juli, augustus, september, oktober, november, december] + abbr_month_names: [~, jan, feb, mrt, apr, mei, jun, jul, aug, sep, okt, nov, dec] activerecord: models: spree/product: Product diff --git a/config/locales/pt_BR.yml b/config/locales/pt_BR.yml index eeb1a0055e..efc19adce1 100644 --- a/config/locales/pt_BR.yml +++ b/config/locales/pt_BR.yml @@ -1,5 +1,10 @@ pt_BR: language_name: "Português do Brasil" + date: + day_names: [domingo, segunda, terça, quarta, quinta, sexta, sábado] + abbr_day_names: [dom, seg, ter, qua, qui, sex, sáb] + month_names: [~, janeiro, fevereiro, março, abril, maio, junho, julho, agosto, setembro, outubro, novembro, dezembro] + abbr_month_names: [~, jan, fev, mar, abr, mai, jun, jul, ago, set, out, nov, dez] activerecord: models: spree/product: Produto diff --git a/spec/helpers/spree/base_helper_spec.rb b/spec/helpers/spree/base_helper_spec.rb index 0908ecb059..54d965f1cf 100644 --- a/spec/helpers/spree/base_helper_spec.rb +++ b/spec/helpers/spree/base_helper_spec.rb @@ -51,8 +51,12 @@ describe Spree::BaseHelper do end context "pretty_time" do - it "prints in a format" do - expect(pretty_time(DateTime.new(2012, 5, 6, 13, 33))).to eq "May 06, 2012 1:33 PM" + it "prints in a format with single digit time" do + expect(pretty_time(DateTime.new(2012, 5, 6, 13, 33))).to eq "May 06, 2012 1:33 PM" + end + + it "prints in a format with double digit time" do + expect(pretty_time(DateTime.new(2012, 5, 6, 12, 33))).to eq "May 06, 2012 12:33 PM" end end end