diff --git a/src/DateTimeExtensions/WorkingDays/CultureStrategies/ES_SVHolidayStrategy.cs b/src/DateTimeExtensions/WorkingDays/CultureStrategies/ES_SVHolidayStrategy.cs new file mode 100644 index 0000000..c099282 --- /dev/null +++ b/src/DateTimeExtensions/WorkingDays/CultureStrategies/ES_SVHolidayStrategy.cs @@ -0,0 +1,78 @@ +using DateTimeExtensions.Common; + +namespace DateTimeExtensions.WorkingDays.CultureStrategies +{ + [Locale("es-SV")] + public class ES_SVHolidayStrategy : HolidayStrategyBase, IHolidayStrategy + { + public ES_SVHolidayStrategy() + { + this.InnerHolidays.Add(GlobalHolidays.NewYear); + this.InnerHolidays.Add(ChristianHolidays.MaundyThursday); + this.InnerHolidays.Add(ChristianHolidays.GoodFriday); + this.InnerHolidays.Add(ChristianHolidays.EasterSaturday); + this.InnerHolidays.Add(GlobalHolidays.InternationalWorkersDay); + this.InnerHolidays.Add(MothersDay); + this.InnerHolidays.Add(FathersDay); + this.InnerHolidays.Add(DivineSaviourOfTheWorld); + this.InnerHolidays.Add(ChristianHolidays.DayOfTheDead); + this.InnerHolidays.Add(ChristianHolidays.Christmas); + } + + private static Holiday _mothersDay; + private static Holiday _fathersDay; + private static Holiday _divineSaviourOfTheWorld; + private static Holiday _independenceDay; + + public static Holiday MothersDay + { + get + { + if (_mothersDay == null) + { + _mothersDay = new FixedHoliday("Mother's Day", 5, 10); + } + + return _mothersDay; + } + } + public static Holiday FathersDay + { + get + { + if (_fathersDay == null) + { + _fathersDay = new FixedHoliday("Father's Day", 6, 17); + } + + return _fathersDay; + } + } + + public static Holiday DivineSaviourOfTheWorld + { + get + { + if (_divineSaviourOfTheWorld == null) + { + _divineSaviourOfTheWorld = new FixedHoliday("Divine Saviour of the World", 8, 6); + } + + return _divineSaviourOfTheWorld; + } + } + + public static Holiday IndependenceDay + { + get + { + if (_independenceDay == null) + { + _independenceDay = new FixedHoliday("Independence Day", 9, 15); + } + + return _independenceDay; + } + } + } +} diff --git a/src/DateTimeExtensions/WorkingDays/HolidayNames.Designer.cs b/src/DateTimeExtensions/WorkingDays/HolidayNames.Designer.cs index 19e1c93..754955e 100644 --- a/src/DateTimeExtensions/WorkingDays/HolidayNames.Designer.cs +++ b/src/DateTimeExtensions/WorkingDays/HolidayNames.Designer.cs @@ -10,7 +10,6 @@ namespace DateTimeExtensions.WorkingDays { using System; - using System.Reflection; /// @@ -40,7 +39,7 @@ internal HolidayNames() { public static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DateTimeExtensions.WorkingDays.HolidayNames", typeof(HolidayNames).GetTypeInfo().Assembly); + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DateTimeExtensions.WorkingDays.HolidayNames", typeof(HolidayNames).Assembly); resourceMan = temp; } return resourceMan; @@ -133,6 +132,15 @@ public static string DayOfTheDead { } } + /// + /// Looks up a localized string similar to Divine Saviour of the World. + /// + public static string Divine_Saviour_of_the_World { + get { + return ResourceManager.GetString("Divine Saviour of the World", resourceCulture); + } + } + /// /// Looks up a localized string similar to Easter. /// @@ -187,6 +195,15 @@ public static string Espanha_NationalDay { } } + /// + /// Looks up a localized string similar to Father's Day. + /// + public static string Father_s_Day { + get { + return ResourceManager.GetString("Father\'s Day", resourceCulture); + } + } + /// /// Looks up a localized string similar to German Unity Day. /// @@ -223,6 +240,15 @@ public static string IndependanceDay { } } + /// + /// Looks up a localized string similar to Independence Day. + /// + public static string Independence_Day { + get { + return ResourceManager.GetString("Independence Day", resourceCulture); + } + } + /// /// Looks up a localized string similar to International Workers' day. /// @@ -250,6 +276,15 @@ public static string MayDay { } } + /// + /// Looks up a localized string similar to Mother's Day. + /// + public static string Mother_s_Day { + get { + return ResourceManager.GetString("Mother\'s Day", resourceCulture); + } + } + /// /// Looks up a localized string similar to New Year. /// diff --git a/src/DateTimeExtensions/WorkingDays/HolidayNames.es.resx b/src/DateTimeExtensions/WorkingDays/HolidayNames.es.resx index 0219fec..daec74e 100644 --- a/src/DateTimeExtensions/WorkingDays/HolidayNames.es.resx +++ b/src/DateTimeExtensions/WorkingDays/HolidayNames.es.resx @@ -112,10 +112,10 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Todos los Santos @@ -127,11 +127,14 @@ Carnaval - Natividad + Navidad Corpus Cristi + + Divino Salvador del Mundo + Pascua @@ -147,18 +150,27 @@ Fiesta Nacional de España + + Día del padre + Viernes Santo La Inmaculada Concepción + + Día de la Independencia + Fiesta del Trabajo Jueves Santo + + Día de la madre + Año Nuevo diff --git a/src/DateTimeExtensions/WorkingDays/HolidayNames.resx b/src/DateTimeExtensions/WorkingDays/HolidayNames.resx index 49b9dc3..7743e32 100644 --- a/src/DateTimeExtensions/WorkingDays/HolidayNames.resx +++ b/src/DateTimeExtensions/WorkingDays/HolidayNames.resx @@ -141,6 +141,9 @@ Day of the Dead + + Divine Saviour of the World + Easter @@ -159,6 +162,9 @@ National Day + + Father's Day + German Unity Day @@ -171,6 +177,9 @@ Independance Day + + Independence Day + International Workers' day @@ -180,6 +189,9 @@ May Day + + Mother's Day + New Year diff --git a/tests/DateTimeExtensions.Tests/HolidaysTranslations/SpanishHolidaysNamesTest.cs b/tests/DateTimeExtensions.Tests/HolidaysTranslations/SpanishHolidaysNamesTest.cs index 1fbd25b..e50de4d 100644 --- a/tests/DateTimeExtensions.Tests/HolidaysTranslations/SpanishHolidaysNamesTest.cs +++ b/tests/DateTimeExtensions.Tests/HolidaysTranslations/SpanishHolidaysNamesTest.cs @@ -32,7 +32,7 @@ public void AssertSpanishHolidaysAreTranslated() Assert.AreEqual(ES_ESHolidayStrategy.NationalDay.Name, "Fiesta Nacional de España"); Assert.AreEqual(ES_ESHolidayStrategy.ConstitutionDay.Name, "Día de la Constitución"); - Assert.AreEqual(ChristianHolidays.Christmas.Name, "Natividad"); + Assert.AreEqual(ChristianHolidays.Christmas.Name, "Navidad"); Assert.AreEqual(GlobalHolidays.NewYear.Name, "Año Nuevo"); Assert.AreEqual(ChristianHolidays.Epiphany.Name, "Epifanía del Señor"); Assert.AreEqual(ChristianHolidays.Carnival.Name, "Carnaval");