Skip to content

Commit

Permalink
Fix estimated label for multiple holiday group entities (#1512)
Browse files Browse the repository at this point in the history
  • Loading branch information
arkid15r committed Oct 12, 2023
1 parent 54f09bc commit 91c8bfc
Show file tree
Hide file tree
Showing 5 changed files with 569 additions and 569 deletions.
4 changes: 2 additions & 2 deletions holidays/groups/buddhist.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class BuddhistCalendarHolidays:

def __init__(self, calendar=_BuddhistLunisolar(), show_estimated=False) -> None:
self._buddhist_calendar = calendar
self._show_estimated = show_estimated
self._buddhist_calendar_show_estimated = show_estimated

def _add_buddhist_calendar_holiday(
self, name: str, dt_estimated: Tuple[date, bool]
Expand All @@ -38,7 +38,7 @@ def _add_buddhist_calendar_holiday(

return self._add_holiday(
self.tr(estimated_label) % self.tr(name)
if is_estimated and self._show_estimated
if is_estimated and self._buddhist_calendar_show_estimated
else name,
dt,
)
Expand Down
4 changes: 2 additions & 2 deletions holidays/groups/chinese.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class ChineseCalendarHolidays:

def __init__(self, calendar=_ChineseLunisolar(), show_estimated=False) -> None:
self._chinese_calendar = calendar
self._show_estimated = show_estimated
self._chinese_calendar_show_estimated = show_estimated

@property
def _chinese_new_year(self):
Expand Down Expand Up @@ -64,7 +64,7 @@ def _add_chinese_calendar_holiday(

return self._add_holiday(
self.tr(estimated_label) % self.tr(name)
if is_estimated and self._show_estimated
if is_estimated and self._chinese_calendar_show_estimated
else name,
dt,
)
Expand Down
4 changes: 2 additions & 2 deletions holidays/groups/hindu.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class HinduCalendarHolidays:

def __init__(self, calendar=_HinduLunisolar(), show_estimated=False) -> None:
self._hindu_calendar = calendar
self._show_estimated = show_estimated
self._hindu_calendar_show_estimated = show_estimated

def _add_hindu_calendar_holiday(
self, name: str, dt_estimated: Tuple[date, bool]
Expand All @@ -38,7 +38,7 @@ def _add_hindu_calendar_holiday(

return self._add_holiday(
self.tr(estimated_label) % self.tr(name)
if is_estimated and self._show_estimated
if is_estimated and self._hindu_calendar_show_estimated
else name,
dt,
)
Expand Down
Loading

0 comments on commit 91c8bfc

Please sign in to comment.