From d55155af89458ce516cc45cfd66d23ab537b03af Mon Sep 17 00:00:00 2001 From: Pedro Vieira Date: Sat, 5 Aug 2017 13:11:11 -0300 Subject: [PATCH 1/5] added_extra_time_format --- lib/calendar_translations/translations.ex | 106 ++++++++++++++++++++++ 1 file changed, 106 insertions(+) diff --git a/lib/calendar_translations/translations.ex b/lib/calendar_translations/translations.ex index 30632dd..b5d0c3e 100644 --- a/lib/calendar_translations/translations.ex +++ b/lib/calendar_translations/translations.ex @@ -535,6 +535,112 @@ defmodule CalendarTranslations.Translations do def date_format(:"zh-TW"), do: {:ok, "%Y-%m-%d"} def date_format(:"zh-YUE"), do: {:ok, "%Y-%m-%d"} + def time_format(:af), do: {:ok, "%H:%M"} + def time_format(:ar), do: {:ok, "%H:%M"} + def time_format(:az), do: {:ok, "%H:%M"} + def time_format(:be), do: {:ok, "%H:%M"} + def time_format(:bg), do: {:ok, "%H:%M"} + def time_format(:bn), do: {:ok, "%H:%M"} + def time_format(:bs), do: {:ok, "%H:%M:%S"} + def time_format(:ca), do: {:ok, "%H:%M"} + def time_format(:cs), do: {:ok, "%H:%M"} + def time_format(:csb), do: {:ok, "%H:%M"} + def time_format(:cy), do: {:ok, "%H:%M"} + def time_format(:da), do: {:ok, "%H.%M"} + def time_format(:de), do: {:ok, "%H:%M Uhr"} + def time_format(:"de-AT"), do: {:ok, "%H:%M Uhr"} + def time_format(:"de-CH"), do: {:ok, "%H:%M Uhr"} + def time_format(:dsb), do: {:ok, "%H:%M góź."} + def time_format(:el), do: {:ok, "%H:%M:%S"} + def time_format(:en), do: {:ok, "%H:%M"} + def time_format(:"en-AU"), do: {:ok, "%H:%M"} + def time_format(:"en-CA"), do: {:ok, "%I:%M %p"} + def time_format(:"en-GB"), do: {:ok, "%H:%M"} + def time_format(:"en-IE"), do: {:ok, "%H:%M"} + def time_format(:"en-IN"), do: {:ok, "%H:%M"} + def time_format(:"en-NZ"), do: {:ok, "%H:%M"} + def time_format(:"en-US"), do: {:ok, "%I:%M %p"} + def time_format(:"en-ZA"), do: {:ok, "%H:%M"} + def time_format(:eo), do: {:ok, "%H:%M"} + def time_format(:es), do: {:ok, "%H:%M"} + def time_format(:"es-419"), do: {:ok, "%I:%M %p"} + def time_format(:"es-AR"), do: {:ok, "%I:%M %p"} + def time_format(:"es-CL"), do: {:ok, "%H:%M"} + def time_format(:"es-CO"), do: {:ok, "%I:%M %p"} + def time_format(:"es-CR"), do: {:ok, "%I:%M %p"} + def time_format(:"es-EC"), do: {:ok, "%-I:%M %p"} + def time_format(:"es-MX"), do: {:ok, "%I:%M %p"} + def time_format(:"es-PA"), do: {:ok, "%-I:%M %p"} + def time_format(:"es-PE"), do: {:ok, "%I:%M %p"} + def time_format(:"es-US"), do: {:ok, "%I:%M %p"} + def time_format(:"es-VE"), do: {:ok, "%I:%M%p"} + def time_format(:et), do: {:ok, "%H:%M:%S"} + def time_format(:eu), do: {:ok, "%H:%M"} + def time_format(:fa), do: {:ok, "%H:%M"} + def time_format(:fi), do: {:ok, "%H.%M"} + def time_format(:fr), do: {:ok, "%Hh%M"} + def time_format(:"fr-CA"), do: {:ok, "%H h %M"} + def time_format(:"fr-CH"), do: {:ok, "%H h %M min %S s"} + def time_format(:fur), do: {:ok, "%H:%M"} + def time_format(:gl), do: {:ok, "%H:%M"} + def time_format(:"gsw-CH"), do: {:ok, "%H:%M Uhr"} + def time_format(:he), do: {:ok, "%H:%M"} + def time_format(:hi), do: {:ok, "%H:%M"} + def time_format(:"hi-IN"), do: {:ok, "%H:%M"} + def time_format(:hr), do: {:ok, "%e. %B %Y. %H:%M"} + def time_format(:hsb), do: {:ok, "%H:%M hodź."} + def time_format(:hu), do: {:ok, "%H:%M"} + def time_format(:id), do: {:ok, "%H.%M"} + def time_format(:is), do: {:ok, "%H:%M"} + def time_format(:it), do: {:ok, "%H:%M"} + def time_format(:"it-CH"), do: {:ok, "%H:%M"} + def time_format(:ja), do: {:ok, "%H時%M分%S秒"} + def time_format(:km), do: {:ok, "%H:%M"} + def time_format(:kn), do: {:ok, "%H:%M"} + def time_format(:ko), do: {:ok, "%H시 %M분 %S초"} + def time_format(:lb), do: {:ok, "%H:%M Auer"} + def time_format(:lo), do: {:ok, "%H:%M น."} + def time_format(:lt), do: {:ok, "%H:%M"} + def time_format(:lv), do: {:ok, "%H:%M:%S"} + def time_format(:mk), do: {:ok, "%H:%M"} + def time_format(:mn), do: {:ok, "%H:%M:%S"} + def time_format(:"mr-IN"), do: {:ok, "%H:%M"} + def time_format(:ms), do: {:ok, "%H:%M"} + def time_format(:nb), do: {:ok, "%H:%M"} + def time_format(:ne), do: {:ok, "%H:%M"} + def time_format(:nl), do: {:ok, "%H:%M"} + def time_format(:nn), do: {:ok, "%H:%M"} + def time_format(:or), do: {:ok, "%H:%M"} + def time_format(:pa), do: {:ok, "%H:%M"} + def time_format(:"pap-AW"), do: {:ok, "%H.%M"} + def time_format(:"pap-CW"), do: {:ok, "%H.%M"} + def time_format(:pl), do: {:ok, "%H:%M"} + def time_format(:pt), do: {:ok, "%H:%Mh"} + def time_format(:"pt-BR"), do: {:ok, "%H:%M"} + def time_format(:rm), do: {:ok, "%H:%M"} + def time_format(:ro), do: {:ok, "%H:%M"} + def time_format(:ru), do: {:ok, "%H:%M"} + def time_format(:scr), do: {:ok, "%H:%M"} + def time_format(:sk), do: {:ok, "%H:%M"} + def time_format(:sl), do: {:ok, "%H:%M"} + def time_format(:sr), do: {:ok, "%H:%M"} + def time_format(:sv), do: {:ok, "%H:%M"} + def time_format(:sw), do: {:ok, "%H:%M:%S"} + def time_format(:ta), do: {:ok, "%H:%M"} + def time_format(:th), do: {:ok, "%H:%M น."} + def time_format(:tl), do: {:ok, "%H:%M"} + def time_format(:tr), do: {:ok, "%H:%M"} + def time_format(:tt), do: {:ok, "%H:%M"} + def time_format(:ug), do: {:ok, "%H:%M"} + def time_format(:uk), do: {:ok, "%H:%M"} + def time_format(:ur), do: {:ok, "%H:%M"} + def time_format(:uz), do: {:ok, "%H:%M"} + def time_format(:vi), do: {:ok, "%H:%M"} + def time_format(:wo), do: {:ok, "%H:%M"} + def time_format(:"zh-CN"), do: {:ok, "%H:%M"} + def time_format(:"zh-HK"), do: {:ok, "%H:%M"} + def time_format(:"zh-TW"), do: {:ok, "%H:%M"} + def time_format(:"zh-YUE"), do: {:ok, "%H:%M"} def time_format(_), do: {:ok, "%H:%M:%S"} def date_time_format(:af), do: {:ok, "%B %d, %Y %H:%M"} From 4f559a6e1a51d85eb405f256b445f89082e47194 Mon Sep 17 00:00:00 2001 From: Pedro Vieira Date: Sat, 5 Aug 2017 13:35:17 -0300 Subject: [PATCH 2/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4c1dc47..d4cae21 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Add `:calendar_translations` to your list of dependencies in `mix.exs`: ```elixir def deps do - [{:calendar_translations, "~> 0.0.4"}] + [{:calendar_translations, "~> 0.0.5"}] end ``` From 79e00971aa9ff242aa272a97788086fdf97dde37 Mon Sep 17 00:00:00 2001 From: Pedro Vieira Date: Tue, 8 Aug 2017 13:19:14 -0300 Subject: [PATCH 3/5] updated_test_time_format --- test/calendar_translations_test.exs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/calendar_translations_test.exs b/test/calendar_translations_test.exs index 263990f..9518198 100644 --- a/test/calendar_translations_test.exs +++ b/test/calendar_translations_test.exs @@ -23,7 +23,7 @@ defmodule CalendarTranslationsTest do end test "time_format" do - assert Strftime.strftime!({{2014,9,6},{17,10,20}}, "%X", :de) == "17:10:20" + assert Strftime.strftime!({{2014,9,6},{17,10,20}}, "%X", :de) == "17:10:20 Uhr" end test "date_time_format" do From b52c791119df6b5e2d69a09fc30fb23dcb8d486e Mon Sep 17 00:00:00 2001 From: Pedro Vieira Date: Tue, 8 Aug 2017 13:26:43 -0300 Subject: [PATCH 4/5] updated_test --- test/calendar_translations_test.exs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/calendar_translations_test.exs b/test/calendar_translations_test.exs index 9518198..a0f6bd4 100644 --- a/test/calendar_translations_test.exs +++ b/test/calendar_translations_test.exs @@ -23,7 +23,7 @@ defmodule CalendarTranslationsTest do end test "time_format" do - assert Strftime.strftime!({{2014,9,6},{17,10,20}}, "%X", :de) == "17:10:20 Uhr" + assert Strftime.strftime!({{2014,9,6},{17,10,20}}, "%X", :de) == "17:10 Uhr" end test "date_time_format" do From 9d0f8f2170922bed7713be7f1f40b0e829f5c992 Mon Sep 17 00:00:00 2001 From: Pedro Vieira Date: Wed, 21 Feb 2018 18:45:21 -0300 Subject: [PATCH 5/5] locale_pt --- lib/calendar_translations/translations.ex | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/calendar_translations/translations.ex b/lib/calendar_translations/translations.ex index b5d0c3e..aca29fd 100644 --- a/lib/calendar_translations/translations.ex +++ b/lib/calendar_translations/translations.ex @@ -615,7 +615,8 @@ defmodule CalendarTranslations.Translations do def time_format(:"pap-AW"), do: {:ok, "%H.%M"} def time_format(:"pap-CW"), do: {:ok, "%H.%M"} def time_format(:pl), do: {:ok, "%H:%M"} - def time_format(:pt), do: {:ok, "%H:%Mh"} + #def time_format(:pt), do: {:ok, "%H:%Mh"} + def time_format(:"pt"), do: {:ok, "%H:%M"} def time_format(:"pt-BR"), do: {:ok, "%H:%M"} def time_format(:rm), do: {:ok, "%H:%M"} def time_format(:ro), do: {:ok, "%H:%M"} @@ -723,7 +724,8 @@ defmodule CalendarTranslations.Translations do def date_time_format(:"pap-AW"), do: {:ok, "%B %d, %Y %H.%M"} def date_time_format(:"pap-CW"), do: {:ok, "%B %d, %Y %H.%M"} def date_time_format(:pl), do: {:ok, "%B %d, %Y %H:%M"} - def date_time_format(:pt), do: {:ok, "%A, %d de %B de %Y, %H:%Mh"} + #def date_time_format(:pt), do: {:ok, "%A, %d de %B de %Y, %H:%Mh"} + def date_time_format(:"pt"), do: {:ok, "%d de %B de %Y, %H:%M"} def date_time_format(:"pt-BR"), do: {:ok, "%d de %B de %Y, %H:%M"} def date_time_format(:rm), do: {:ok, "%A, %d. %B %Y, %H:%M Uhr"} def date_time_format(:ro), do: {:ok, "%d %B %Y %H:%M"}