Skip to content

Commit

Permalink
Merge pull request joaomatossilva#202 from keyzzrivas/es-sv-culture
Browse files Browse the repository at this point in the history
Implement es-SV culture
  • Loading branch information
joaomatossilva authored Oct 7, 2024
2 parents ff708f3 + 415f389 commit 4deb0e7
Show file tree
Hide file tree
Showing 5 changed files with 143 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -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;
}
}
}
}
39 changes: 37 additions & 2 deletions src/DateTimeExtensions/WorkingDays/HolidayNames.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 15 additions & 3 deletions src/DateTimeExtensions/WorkingDays/HolidayNames.es.resx
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="AllSaints" xml:space="preserve">
<value>Todos los Santos</value>
Expand All @@ -127,11 +127,14 @@
<value>Carnaval</value>
</data>
<data name="Christmas" xml:space="preserve">
<value>Natividad</value>
<value>Navidad</value>
</data>
<data name="CorpusChristi" xml:space="preserve">
<value>Corpus Cristi</value>
</data>
<data name="Divine Saviour of the World" xml:space="preserve">
<value>Divino Salvador del Mundo</value>
</data>
<data name="Easter" xml:space="preserve">
<value>Pascua</value>
</data>
Expand All @@ -147,18 +150,27 @@
<data name="Espanha_NationalDay" xml:space="preserve">
<value>Fiesta Nacional de España</value>
</data>
<data name="Father's Day" xml:space="preserve">
<value>Día del padre</value>
</data>
<data name="GoodFriday" xml:space="preserve">
<value>Viernes Santo</value>
</data>
<data name="ImaculateConception" xml:space="preserve">
<value>La Inmaculada Concepción</value>
</data>
<data name="Independence Day" xml:space="preserve">
<value>Día de la Independencia</value>
</data>
<data name="InternationalWorkerDay" xml:space="preserve">
<value>Fiesta del Trabajo</value>
</data>
<data name="MaundyThursday" xml:space="preserve">
<value>Jueves Santo</value>
</data>
<data name="Mother's Day" xml:space="preserve">
<value>Día de la madre</value>
</data>
<data name="NewYear" xml:space="preserve">
<value>Año Nuevo</value>
</data>
Expand Down
12 changes: 12 additions & 0 deletions src/DateTimeExtensions/WorkingDays/HolidayNames.resx
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@
<data name="DayOfTheDead" xml:space="preserve">
<value>Day of the Dead</value>
</data>
<data name="Divine Saviour of the World" xml:space="preserve">
<value>Divine Saviour of the World</value>
</data>
<data name="Easter" xml:space="preserve">
<value>Easter</value>
</data>
Expand All @@ -159,6 +162,9 @@
<data name="Espanha_NationalDay" xml:space="preserve">
<value>National Day</value>
</data>
<data name="Father's Day" xml:space="preserve">
<value>Father's Day</value>
</data>
<data name="GermanUnityDay" xml:space="preserve">
<value>German Unity Day</value>
</data>
Expand All @@ -171,6 +177,9 @@
<data name="IndependanceDay" xml:space="preserve">
<value>Independance Day</value>
</data>
<data name="Independence Day" xml:space="preserve">
<value>Independence Day</value>
</data>
<data name="InternationalWorkerDay" xml:space="preserve">
<value>International Workers' day</value>
</data>
Expand All @@ -180,6 +189,9 @@
<data name="MayDay" xml:space="preserve">
<value>May Day</value>
</data>
<data name="Mother's Day" xml:space="preserve">
<value>Mother's Day</value>
</data>
<data name="NewYear" xml:space="preserve">
<value>New Year</value>
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 4deb0e7

Please sign in to comment.