From 850a9c373877cde36ac06e799d34ea2dfa72bc9c Mon Sep 17 00:00:00 2001 From: Ahmed Ejaz Date: Mon, 9 Oct 2023 04:31:09 +0500 Subject: [PATCH 01/16] #11606, adds langage locales for the German for Germany --- config/locales/de_CH.yml | 5 +++++ 1 file changed, 5 insertions(+) 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 From adcca684bf62ab691a1bf2e460ae5baf53f77919 Mon Sep 17 00:00:00 2001 From: Ahmed Ejaz Date: Mon, 9 Oct 2023 13:14:33 +0500 Subject: [PATCH 02/16] #11606, adds date locales for German (Germany) --- config/locales/de_DE.yml | 5 +++++ 1 file changed, 5 insertions(+) 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 From 315dfe7d38486979223e7eb8c129a9c71486dae1 Mon Sep 17 00:00:00 2001 From: Ahmed Ejaz Date: Mon, 9 Oct 2023 14:08:17 +0500 Subject: [PATCH 03/16] #11606, adds date locales for Espanol (Colombia) --- config/locales/es_CO.yml | 5 +++++ 1 file changed, 5 insertions(+) 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 From afa172bfa238a2fcfe7ced2c216f88fa886e1ee0 Mon Sep 17 00:00:00 2001 From: Ahmed Ejaz Date: Mon, 9 Oct 2023 14:12:47 +0500 Subject: [PATCH 04/16] #11606, adds date locales for Espanol (Costa Rica) --- config/locales/es_CR.yml | 5 +++++ 1 file changed, 5 insertions(+) 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 From 295ad230c27a6ef9e4d1f94264747d6be34aa044 Mon Sep 17 00:00:00 2001 From: Ahmed Ejaz Date: Mon, 9 Oct 2023 14:14:57 +0500 Subject: [PATCH 05/16] #11606, adds date locales for Espanol (United States) --- config/locales/es_US.yml | 5 +++++ 1 file changed, 5 insertions(+) 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 From e0ed5ef9f03703704d1dcc5983e64b4c60923817 Mon Sep 17 00:00:00 2001 From: Ahmed Ejaz Date: Mon, 9 Oct 2023 14:19:49 +0500 Subject: [PATCH 06/16] #11606, adds date locales for Filipino (Philippines) --- config/locales/fil_PH.yml | 5 +++++ 1 file changed, 5 insertions(+) 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 From c3bc2d1087f58d081b97db884538672ebc665d23 Mon Sep 17 00:00:00 2001 From: Ahmed Ejaz Date: Mon, 9 Oct 2023 14:25:32 +0500 Subject: [PATCH 07/16] =?UTF-8?q?#11606,=20adds=20date=20locales=20for=20F?= =?UTF-8?q?ran=C3=A7ais=20(Belgium)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/locales/fr_BE.yml | 5 +++++ 1 file changed, 5 insertions(+) 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 From 6a0588e6a23eaac63aef8627de303733c4759810 Mon Sep 17 00:00:00 2001 From: Ahmed Ejaz Date: Mon, 9 Oct 2023 14:28:24 +0500 Subject: [PATCH 08/16] =?UTF-8?q?#11606,=20adds=20date=20locales=20for=20F?= =?UTF-8?q?ran=C3=A7ais=20(Canada)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/locales/fr_CA.yml | 5 +++++ 1 file changed, 5 insertions(+) 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 From ec7c77af68df12429497600e5348a97f61ee7baf Mon Sep 17 00:00:00 2001 From: Ahmed Ejaz Date: Mon, 9 Oct 2023 14:36:21 +0500 Subject: [PATCH 09/16] =?UTF-8?q?#11606,=20adds=20date=20locales=20for=20F?= =?UTF-8?q?ran=C3=A7ais=20(Switzerland)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/locales/fr_CH.yml | 5 +++++ 1 file changed, 5 insertions(+) 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 From a35dcde0e3c37fa9da86b25a4b1c6f70ff20bb79 Mon Sep 17 00:00:00 2001 From: Ahmed Ejaz Date: Mon, 9 Oct 2023 14:56:20 +0500 Subject: [PATCH 10/16] =?UTF-8?q?#11606,=20adds=20date=20locales=20for=20F?= =?UTF-8?q?ran=C3=A7ais=20(Cameroon)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/locales/fr_CM.yml | 5 +++++ 1 file changed, 5 insertions(+) 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 From 6a889d80844a6a09c919eb6c14b9f823fff4edcf Mon Sep 17 00:00:00 2001 From: Ahmed Ejaz Date: Mon, 9 Oct 2023 15:05:19 +0500 Subject: [PATCH 11/16] #11606, adds date locales for Italiano (Switzerland) --- config/locales/it_CH.yml | 5 +++++ 1 file changed, 5 insertions(+) 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 From 4639a002f28946228c241dd6cf0adfd66aea5e05 Mon Sep 17 00:00:00 2001 From: Ahmed Ejaz Date: Mon, 9 Oct 2023 15:09:49 +0500 Subject: [PATCH 12/16] #11606, adds date locales for Nederlands (Belgium) --- config/locales/nl_BE.yml | 5 +++++ 1 file changed, 5 insertions(+) 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 From dddb777cea0367b3628f7bf80b3a28e46cdd65f6 Mon Sep 17 00:00:00 2001 From: Ahmed Ejaz Date: Mon, 9 Oct 2023 15:15:39 +0500 Subject: [PATCH 13/16] =?UTF-8?q?#11606,=20adds=20date=20locales=20for=20P?= =?UTF-8?q?ortugu=C3=AAs=20do=20Brasil?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/locales/pt_BR.yml | 5 +++++ 1 file changed, 5 insertions(+) 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 From edc827bdc8e28dfd54fac5f61d27554618390214 Mon Sep 17 00:00:00 2001 From: Ahmed Ejaz Date: Tue, 10 Oct 2023 16:02:04 +0500 Subject: [PATCH 14/16] #11606, adds long time formatting for en.yml --- app/helpers/spree/base_helper.rb | 3 +-- config/locales/en.yml | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) 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/en.yml b/config/locales/en.yml index b91dee854b..f9a15e2683 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" # %l adds a single space to the left activerecord: models: spree/product: Product From 4040dc0a52c92f4a627a0b537003f3f0e517f919 Mon Sep 17 00:00:00 2001 From: Ahmed Ejaz Date: Fri, 13 Oct 2023 18:20:16 +0500 Subject: [PATCH 15/16] #11606, add and fix specs for pretty_time method --- config/locales/en.yml | 2 +- spec/helpers/spree/base_helper_spec.rb | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index f9a15e2683..d7ce26bfc6 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -23,7 +23,7 @@ en: language_name: "English" # Localised name of this language time: formats: - long: "%B %d, %Y%l:%M %p" # %l adds a single space to the left + long: "%B %d, %Y %-l:%M %p" activerecord: models: spree/product: Product diff --git a/spec/helpers/spree/base_helper_spec.rb b/spec/helpers/spree/base_helper_spec.rb index 0908ecb059..741a2f817d 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, 00))).to eq "May 06, 2012 12:00 PM" end end end From fc59c9397d38ad905a0296b2463082cda77fcc20 Mon Sep 17 00:00:00 2001 From: Ahmed Ejaz Date: Fri, 13 Oct 2023 18:27:56 +0500 Subject: [PATCH 16/16] 11606, fix lint issues --- spec/helpers/spree/base_helper_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/helpers/spree/base_helper_spec.rb b/spec/helpers/spree/base_helper_spec.rb index 741a2f817d..54d965f1cf 100644 --- a/spec/helpers/spree/base_helper_spec.rb +++ b/spec/helpers/spree/base_helper_spec.rb @@ -56,7 +56,7 @@ describe Spree::BaseHelper do end it "prints in a format with double digit time" do - expect(pretty_time(DateTime.new(2012, 5, 6, 12, 00))).to eq "May 06, 2012 12:00 PM" + expect(pretty_time(DateTime.new(2012, 5, 6, 12, 33))).to eq "May 06, 2012 12:33 PM" end end end