mirror of
https://github.com/nikdoof/ohayodash.git
synced 2025-12-13 10:02:17 +00:00
Add a subtext to the greeting
This commit is contained in:
@@ -77,7 +77,7 @@ def get_bookmarks() -> list:
|
||||
return bookmarks
|
||||
|
||||
|
||||
def get_greeting():
|
||||
def get_greeting() -> tuple:
|
||||
"""Generate the greeting string based on the defined timezone."""
|
||||
try:
|
||||
tz = zoneinfo.ZoneInfo(os.environ.get('TZ', 'UTC'))
|
||||
@@ -88,10 +88,10 @@ def get_greeting():
|
||||
current_time = datetime.datetime.now(tz)
|
||||
|
||||
if 0 < current_time.hour < 12:
|
||||
return 'おはようございます!'
|
||||
return 'おはようございます!', "Thats 'Good morning' in Japanese"
|
||||
elif current_time.hour >= 19:
|
||||
return 'こんばんは'
|
||||
return 'こんにちは'
|
||||
return 'こんばんは', "Thats 'Good evening' in Japanese"
|
||||
return 'こんにちは', "Thats 'Good day' in Japanese"
|
||||
|
||||
|
||||
@base.app_template_filter()
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
</section>
|
||||
|
||||
<section id="header">
|
||||
<h1>{{ greeting | default("Welcome")}}</h1>
|
||||
<h1><span title="{{ greeting[1] }}">{{ greeting[0] | default("Welcome")}}</span></h1>
|
||||
<h2>{{ now | format_datetime }}</h2>
|
||||
</section>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user