Updated locale strings
This commit is contained in:
@@ -17,8 +17,10 @@ async def command_set_offset(app: PyroClient, message: Message):
|
||||
user = await app.find_user(message.from_user)
|
||||
|
||||
await message.reply_text(
|
||||
"Alright. Please, send how many days in advance do you want to get a notification about the collection.",
|
||||
reply_markup=ForceReply(placeholder="Number of days"),
|
||||
app._("set_offset", "messages", locale=user.locale),
|
||||
reply_markup=ForceReply(
|
||||
placeholder=app._("set_offset", "force_replies", locale=user.locale)
|
||||
),
|
||||
)
|
||||
|
||||
while True:
|
||||
@@ -39,7 +41,9 @@ async def command_set_offset(app: PyroClient, message: Message):
|
||||
)
|
||||
except (ValueError, TypeError):
|
||||
await answer.reply_text(
|
||||
"Please, provide a valid integer number of days in range 0 to 7 (inclusive). Use /cancel if you want to cancel this operation."
|
||||
app._("set_offset_invalid", "messages", locale=user.locale).format(
|
||||
cancel_notice=app._("cancel", "messages", locale=user.locale)
|
||||
)
|
||||
)
|
||||
continue
|
||||
|
||||
@@ -51,13 +55,17 @@ async def command_set_offset(app: PyroClient, message: Message):
|
||||
|
||||
logger.info("User %s has set offset to %s", user.id, offset)
|
||||
|
||||
notice = "" if user.enabled else "Execute /toggle to enable notifications."
|
||||
|
||||
garbage_time = datetime(
|
||||
1970, 1, 1, hour=user.time_hour, minute=user.time_minute
|
||||
).strftime(app._("time", "formats"))
|
||||
|
||||
await answer.reply_text(
|
||||
f"Notifications time has been updated! You will now receive notification about collection **{offset} d.** before the collection at {garbage_time}. {notice}",
|
||||
app._("set_offset_finished", "messages", locale=user.locale).format(
|
||||
offset=offset,
|
||||
time=garbage_time,
|
||||
toggle_notice=""
|
||||
if user.enabled
|
||||
else app._("toggle", "messages", locale=user.locale),
|
||||
),
|
||||
reply_markup=ReplyKeyboardRemove(),
|
||||
)
|
||||
|
Reference in New Issue
Block a user