(feature): Add basic streamalerts.

This commit is contained in:
2024-08-02 20:45:18 +10:00
parent 850c5d7abb
commit c3c8baa4b2
25 changed files with 5471 additions and 0 deletions

20
src/babel/utils.py Normal file
View File

@@ -0,0 +1,20 @@
from .translator import ctx_translator
from . import babel
_, _p, _np = babel._, babel._p, babel._np
MONTHS = _p(
'utils|months',
"January,February,March,April,May,June,July,August,September,October,November,December"
)
SHORT_MONTHS = _p(
'utils|short_months',
"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec"
)
def local_month(month, short=False):
string = MONTHS if not short else SHORT_MONTHS
return ctx_translator.get().t(string).split(',')[month-1]