add cenhomes addons

This commit is contained in:
2025-03-04 16:53:07 +07:00
parent 081505ce33
commit 4b8cd12232
144 changed files with 19868 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
import calendar
import json
import os
path_file = os.path.dirname(__file__)
dict_languages = {
'de': json.load(open(f'{path_file}/../static/lang/de.json'))
}
def convert_month(month: int):
if month < 1 or month > 12:
return None
return calendar.month_name[month]
def convert_common(text: str, lang: str = 'de'):
if lang not in dict_languages or text is None or text == False:
return None
return dict_languages.get(lang).get(text.lower())
if __name__ == '__main__':
print(convert_month(0))
print(convert_month(3))
print(convert_common('english'))