Group news items by month year and localize

A quick question: I want to create headers on the news page indicating which month year articles have been created - something like grouped by month year. I did it in the template passing variables from the previous article when iterating batch. Is there a better way?

November 2019
article 5
article 4

October 2019
article 3
article 2

September 2019
article 1

Currently, I am overriding the template:

<tal:block tal:define="...;
    item_month_created python:item.effective.strftime('%B %Y');
    item_month_visible python:True if item_month_created != item_month_previous else False;

<h3 class="month" tal:condition="python: item_month_visible" tal:content="python: item_month_created.capitalize()">November 2019</h3>
<?python  item_month_previous = item_month_created ?>

And while doing that, I noticed the month names don't get localized. I had to set locale.setlocale(locale.LC_TIME, "sl_SI") in the view to activate the Slovenian localization - it is set to ('en_US', 'UTF-8') by default although I have the language set to Slovenian in Site settings.