Skip to content

Commit

Permalink
chore: fix locale key and typing
Browse files Browse the repository at this point in the history
  • Loading branch information
alissonlauffer committed Oct 19, 2024
1 parent bfe117a commit 7aecda6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion eduu/database/localization.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ async def set_db_lang(chat_id: int, chat_type: str, lang_code: str):
raise TypeError(f"Unknown chat type '{chat_type}'.")


async def get_db_lang(chat_id: int, chat_type: str) -> str:
async def get_db_lang(chat_id: int, chat_type: ChatType) -> str:
if chat_type == ChatType.PRIVATE:
cursor = await conn.execute("SELECT chat_lang FROM users WHERE user_id = ?", (chat_id,))
ul = await cursor.fetchone()
Expand All @@ -42,4 +42,5 @@ async def get_db_lang(chat_id: int, chat_type: str) -> str:
ul = await cursor.fetchone()
else:
raise TypeError(f"Unknown chat type '{chat_type}'.")

return ul[0] if ul else None
2 changes: 1 addition & 1 deletion locales/en-GB.json
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@
"run_err_string": "Error: The language <b>{language}</b> was not found. Supported languages list: {supported_langs}",
"run_inline_send": "Language: {language}",
"run_tio_res_string_err": "<b>Language:</b> <code>{language}</code>\n\n<b>Code:</b>\n<pre language=\"{pre_language}\">{code}</pre>\n\n<b>Results:</b>\n<code>{results}</code>\n\n<b>Errors:</b>\n<code>{errors}</code>",
"run_tio_res_string_no_err": "<b>Language:</b> <code>{language}</code>\n\n<b>Code:</b>\n<pre lang=\"{language}\">{code}</pre>\n\n<b>Results:</b>\n<code>{results}</code>\n\n<b>Stats:</b><code>{stats}</code>",
"run_tio_res_string_no_err": "<b>Language:</b> <code>{language}</code>\n\n<b>Code:</b>\n<pre language=\"{pre_language}\">{code}</pre>\n\n<b>Results:</b>\n<code>{results}</code>\n\n<b>Stats:</b><code>{stats}</code>",
"sed_regex_timeout": "Oops, your regex pattern has run for too long.",
"start_add_to_chat_btn": "➕ Add to a chat",
"start_chat": "🤖 Start a chat",
Expand Down

0 comments on commit 7aecda6

Please sign in to comment.