from configurator import config

strings = {
    "en": {
        "error_no_reply": "This command must be sent as a reply to one's message!",
        "error_report_admin": "Whoa! Don't report admins üòà",
        "error_restrict_admin": "You cannot restrict an admin.",
        "error_wrong_time_format": "Wrong time forman. Use a number + symbols 'h', 'm' or 'd'. F.ex. 4h",
        "error_message_too_short": "Please avoid short useless greetings. "
                                   "If you have a question or some information, put it in one message. Thanks in "
                                   "advance! ü§ì",

        "report_date_format": "%d.%m.%Y at %H:%M (server time)",
        "report_message": 'üëÜ Sent {date}\n'
                          '<a href="https://t.me/c/{chat_id}/{msg_id}">Go to message</a>',
        "report_note": "\n\nNote:{note}",
        "report_delivered": "<i>Report sent</i>",

        "action_del_msg": "Delete message",
        "action_del_and_ban": "Delete and ban",
        "action_del_and_readonly": "Set user readonly for 24 hours",
        "action_del_and_readonly2": "Set user readonly for 7 days",

        "action_deleted": "\n\nüóë <b>Deleted</b>",
        "action_deleted_banned": "\n\nüóë‚ùå <b>Deleted, user banned</b>",
        "action_deleted_readonly": "\n\nüóëüôä <b>Deleted, set readonly for 2 hours</b>",
        "action_deleted_readonly2": "\n\nüóëüôä <b>Deleted, set readonly for 2 hours</b>",

        "resolved_readonly": "<i>User set to read-only mode ({restriction_time})</i>",
        "resolved_nomedia": "<i>User set to text-only mode ({restriction_time})</i>",

        "restriction_forever": "forever",
        "need_admins_attention": 'Dear admins, your presence in chat is needed!\n\n'
                                 '<a href="https://t.me/c/{chat_id}/{msg_id}">Go to message</a>',

        "greetings_words": ("hi", "q", "hello", "hey")  # Bot will react to short messages with these words
    },
    "ru": {
        "error_no_reply": "–≠—Ç–∞ –∫–æ–º–∞–Ω–¥–∞ –¥–æ–ª–∂–Ω–∞ –±—ã—Ç—å –æ—Ç–≤–µ—Ç–æ–º –Ω–∞ –∫–∞–∫–æ–µ-–ª–∏–±–æ —Å–æ–æ–±—â–µ–Ω–∏–µ!",
        "error_report_admin": "–ê–¥–º–∏–Ω–æ–≤ —Ä–µ–ø–æ—Ä—Ç–∏—à—å? –ê–π-–∞–π-–∞–π üòà",
        "error_report_self": "–ù–µ–ª—å–∑—è —Ä–µ–ø–æ—Ä—Ç–∏—Ç—å —Å–∞–º–æ–≥–æ —Å–µ–±—è ü§™",
        "error_restrict_admin": "–ù–µ–≤–æ–∑–º–æ–∂–Ω–æ –æ–≥—Ä–∞–Ω–∏—á–∏—Ç—å –∞–¥–º–∏–Ω–∏—Å—Ç—Ä–∞—Ç–æ—Ä–∞.",
        "error_wrong_time_format": "–ù–µ–ø—Ä–∞–≤–∏–ª—å–Ω—ã–π —Ñ–æ—Ä–º–∞—Ç –≤—Ä–µ–º–µ–Ω–∏. –ò—Å–ø–æ–ª—å–∑—É–π—Ç–µ —á–∏—Å–ª–æ + —Å–∏–º–≤–æ–ª h, m –∏–ª–∏ d. –ù–∞–ø—Ä–∏–º–µ—Ä, 4h",
        "error_message_too_short": "–ü–æ–∂–∞–ª—É–π—Å—Ç–∞, –∏–∑–±–µ–≥–∞–π—Ç–µ –±–µ—Å—Å–º—ã—Å–ª–µ–Ω–Ω—ã—Ö –∫–æ—Ä–æ—Ç–∫–∏—Ö –ø—Ä–∏–≤–µ—Ç—Å—Ç–≤–∏–π. "
                                   "–ï—Å–ª–∏ —É –í–∞—Å –µ—Å—Ç—å –≤–æ–ø—Ä–æ—Å –∏–ª–∏ –∏–Ω—Ñ–æ—Ä–º–∞—Ü–∏—è, –Ω–∞–ø–∏—à–∏—Ç–µ –≤—Å—ë –≤ –æ–¥–Ω–æ–º —Å–æ–æ–±—â–µ–Ω–∏–∏. –ó–∞—Ä–∞–Ω–µ–µ "
                                   "—Å–ø–∞—Å–∏–±–æ! ü§ì",

        "report_date_format": "%d.%m.%Y –≤ %H:%M (–≤—Ä–µ–º—è —Å–µ—Ä–≤–µ—Ä–∞)",
        "report_message": 'üëÜ –û—Ç–ø—Ä–∞–≤–ª–µ–Ω–æ {date}\n'
                          '<a href="https://t.me/c/{chat_id}/{msg_id}">–ü–µ—Ä–µ–π—Ç–∏ –∫ —Å–æ–æ–±—â–µ–Ω–∏—é</a>',
        "report_note": "\n\n–ü—Ä–∏–º–µ—á–∞–Ω–∏–µ:{note}",
        "report_delivered": "<i>–†–µ–ø–æ—Ä—Ç –æ—Ç–ø—Ä–∞–≤–ª–µ–Ω.</i>",

        "action_del_msg": "üóë –£–¥–∞–ª–∏—Ç—å —Å–æ–æ–±—â–µ–Ω–∏–µ",
        "action_del_and_ban": "üóë –£–¥–∞–ª–∏—Ç—å + ‚ùå –±–∞–Ω –Ω–∞–≤—Å–µ–≥–¥–∞",
        "action_del_and_readonly": "üóë –£–¥–∞–ª–∏—Ç—å + üôä –º—É—Ç –Ω–∞ –¥–µ–Ω—å",
        "action_del_and_readonly2": "üóë –£–¥–∞–ª–∏—Ç—å + üôä –º—É—Ç –Ω–∞ –Ω–µ–¥–µ–ª—é",

        "action_false_alarm": "‚ùé –ù–∞—Ä—É—à–µ–Ω–∏–π –Ω–µ—Ç",
        "action_false_alarm_2": "‚ùé –ù–∞—Ä—É—à–µ–Ω–∏–π –Ω–µ—Ç (üôä –º—É—Ç —Ä–µ–ø–æ—Ä—Ç–µ—Ä–∞ –Ω–∞ –¥–µ–Ω—å)",
        "action_false_alarm_3": "‚ùé –ù–∞—Ä—É—à–µ–Ω–∏–π –Ω–µ—Ç (üôä –º—É—Ç —Ä–µ–ø–æ—Ä—Ç–µ—Ä–∞ –Ω–∞ –Ω–µ–¥–µ–ª—é)",
        "action_false_alarm_4": "‚ùé –ù–∞—Ä—É—à–µ–Ω–∏–π –Ω–µ—Ç (‚ùå –±–∞–Ω —Ä–µ–ø–æ—Ä—Ç–µ—Ä–∞)",
 
        "action_deleted": "\n\nüóë <b>–£–¥–∞–ª–µ–Ω–æ</b>",
        "action_deleted_banned": "\n\nüóë‚ùå <b>–£–¥–∞–ª–µ–Ω–æ, —é–∑–µ—Ä –∑–∞–±–∞–Ω–µ–Ω</b>",
        "action_deleted_readonly": "\n\nüóëüôä <b>–£–¥–∞–ª–µ–Ω–æ, + –≤—ã–¥–∞–Ω –º—É—Ç –Ω–∞ –¥–µ–Ω—å.</b>",
        "action_deleted_readonly2": "\n\nüóëüôä <b>–£–¥–∞–ª–µ–Ω–æ, + –≤—ã–¥–∞–Ω –º—É—Ç –Ω–∞ –Ω–µ–¥–µ–ª—é.</b>",

        "action_dismissed": "\n\n‚ùé <b>–ù–∞—Ä—É—à–µ–Ω–∏–π –Ω–µ –æ–±–Ω–∞—Ä—É–∂–µ–Ω–æ.</b>",
        "action_deleted_dismissed2": "\n\n‚ùé <b>–ù–∞—Ä—É—à–µ–Ω–∏–π –Ω–µ –æ–±–Ω–∞—Ä—É–∂–µ–Ω–æ (üôä —Ä–µ–ø–æ—Ä—Ç–µ—Ä—É –≤—ã–¥–∞–Ω –º—É—Ç –Ω–∞ 1 –¥–µ–Ω—å).</b>",
        "action_deleted_dismissed3": "\n\n‚ùé <b>–ù–∞—Ä—É—à–µ–Ω–∏–π –Ω–µ –æ–±–Ω–∞—Ä—É–∂–µ–Ω–æ (üôä —Ä–µ–ø–æ—Ä—Ç–µ—Ä—É –≤—ã–¥–∞–Ω –º—É—Ç –Ω–∞ 7 –¥–Ω–µ–π).</b>",
        "action_deleted_dismissed4": "\n\n‚ùé <b>–ù–∞—Ä—É—à–µ–Ω–∏–π –Ω–µ –æ–±–Ω–∞—Ä—É–∂–µ–Ω–æ (‚ùå —Ä–µ–ø–æ—Ä—Ç–µ—Ä –∑–∞–±–∞–Ω–µ–Ω).</b>",

        "resolved_readonly": "<i>–í—ã–¥–∞–Ω –º—É—Ç –Ω–∞ ({restriction_time})</i>",
        "resolved_nomedia": "<i>–ó–∞–ø—Ä–µ—â–µ–Ω–æ –æ—Ç–ø—Ä–∞–≤–ª—è—Ç—å –º–µ–¥–∏–∞ –Ω–∞ ({restriction_time})</i>",
        "resolved_nomedia_forever": "<i>–ó–∞–ø—Ä–µ—â–µ–Ω–æ –æ—Ç–ø—Ä–∞–≤–ª—è—Ç—å –º–µ–¥–∏–∞ –Ω–∞–≤—Å–µ–≥–¥–∞.</i>",

        "resolved_givemedia": "<i>–†–∞–∑—Ä–µ—à–µ–Ω–æ –æ—Ç–ø—Ä–∞–≤–ª—è—Ç—å –º–µ–¥–∏–∞ –Ω–∞ ({restriction_time})</i>",
        "resolved_givemedia_forever": "<i>–†–∞–∑—Ä–µ—à–µ–Ω–æ –æ—Ç–ø—Ä–∞–≤–ª—è—Ç—å –º–µ–¥–∏–∞ –Ω–∞–≤—Å–µ–≥–¥–∞.</i>",
        "error_givemedia_admin": "<i>–ê–¥–º–∏–Ω–∞–º –∏—Ç–∞–∫ —Ä–∞–∑—Ä–µ—à–µ–Ω–æ –æ—Ç–ø—Ä–∞–≤–ª—è—Ç—å –º–µ–¥–∏–∞!</i>",

        "resolved_givestickers": "<i>–†–∞–∑—Ä–µ—à–µ–Ω–æ –æ—Ç–ø—Ä–∞–≤–ª—è—Ç—å —Å—Ç–∏–∫–µ—Ä—ã –Ω–∞ ({restriction_time})</i>",
        "resolved_givestickers_forever": "<i>–†–∞–∑—Ä–µ—à–µ–Ω–æ –æ—Ç–ø—Ä–∞–≤–ª—è—Ç—å —Å—Ç–∏–∫–µ—Ä—ã –Ω–∞–≤—Å–µ–≥–¥–∞.</i>",
        "error_givestickers_admin": "<i>–ê–¥–º–∏–Ω–∞–º –∏—Ç–∞–∫ —Ä–∞–∑—Ä–µ—à–µ–Ω–æ –æ—Ç–ø—Ä–∞–≤–ª—è—Ç—å —Å—Ç–∏–∫–µ—Ä—ã!</i>",

        "resolved_revokestickers": "<i>–ó–∞–ø—Ä–µ—â–µ–Ω–æ –æ—Ç–ø—Ä–∞–≤–ª—è—Ç—å —Å—Ç–∏–∫–µ—Ä—ã –Ω–∞ ({restriction_time})</i>",
        "resolved_revokestickers_forever": "<i>–ó–∞–ø—Ä–µ—â–µ–Ω–æ –æ—Ç–ø—Ä–∞–≤–ª—è—Ç—å —Å—Ç–∏–∫–µ—Ä—ã –Ω–∞–≤—Å–µ–≥–¥–∞.</i>",
        "error_givestickers_admin": "<i>–ê–¥–º–∏–Ω–∞–º –∏—Ç–∞–∫ —Ä–∞–∑—Ä–µ—à–µ–Ω–æ –æ—Ç–ø—Ä–∞–≤–ª—è—Ç—å —Å—Ç–∏–∫–µ—Ä—ã!</i>",

        "user_unmuted": "<i>–ú—É—Ç —Å–Ω—è—Ç.</i>",

        "restriction_forever": "<i>–í—ã–¥–∞–Ω –º—É—Ç –Ω–∞–≤—Å–µ–≥–¥–∞.</i>",
        "need_admins_attention": '–¢–æ–≤–∞—Ä–∏—â–∏ –∞–¥–º–∏–Ω—ã, –≤ —á–∞—Ç–µ –Ω—É–∂–Ω–æ –≤–∞—à–µ –ø—Ä–∏—Å—É—Ç—Å—Ç–≤–∏–µ!\n\n'
                                 '<a href="https://t.me/c/{chat_id}/{msg_id}">–ü–µ—Ä–µ–π—Ç–∏ –∫ —Å–æ–æ–±—â–µ–Ω–∏—é</a>',

        "resolved_ban": "<i>–£—á–∞—Å—Ç–Ω–∏–∫ –∑–∞–±–ª–æ–∫–∏—Ä–æ–≤–∞–Ω.</i>",
        "resolved_unban": "<i>–£—á–∞—Å—Ç–Ω–∏–∫ —Ä–∞–∑–±–ª–æ–∫–∏—Ä–æ–≤–∞–Ω.</i>",

        "error_checkperms_admin": "‚úÖ –£ –∞–¥–º–∏–Ω–æ–≤ –Ω–µ—Ç –Ω–∏–∫–∞–∫–∏—Ö –æ–≥—Ä–∞–Ω–∏—á–µ–Ω–∏–π.",
        "error_ban_admin": "üò° –¢—ã —á—ë, –ø—ë—Å? –ê–¥–º–∏–Ω–∞ –Ω–µ–ª—å–∑—è –∑–∞–±–∞–Ω–∏—Ç—å!",

        "enabled_ro": "<i>–†–µ–∂–∏–º ¬´—Ç–æ–ª—å–∫–æ-—á—Ç–µ–Ω–∏–µ¬ª –≤–∫–ª—é—á–µ–Ω.</i>",
        "disabled_ro": "<i>–†–µ–∂–∏–º ¬´—Ç–æ–ª—å–∫–æ-—á—Ç–µ–Ω–∏–µ¬ª –æ—Ç–∫–ª—é—á–µ–Ω.</i>",

        "profanity_user_kicked": "–í–∞—à–µ –∏–º—è –≤ Telegram —Å–æ–¥–µ—Ä–∂–∏—Ç –Ω–µ–Ω–æ—Ä–º–∞—Ç–∏–≤–Ω—É—é –ª–µ–∫—Å–∏–∫—É.\n–ü–æ —ç—Ç–æ–π –ø—Ä–∏—á–∏–Ω–µ –≤—ã –±—ã–ª–∏ –∫–∏–∫–Ω—É—Ç—ã –∏–∑ —á–∞—Ç–∞.\n\n–ü–æ–∂–∞–ª—É–π—Å—Ç–∞, –æ—Ç—Ä–µ–¥–∞–∫—Ç–∏—Ä—É–π—Ç–µ –æ—Ç–æ–±—Ä–∞–∂–∞–µ–º–æ–µ –∏–º—è –∏ –ø–æ–ø—Ä–æ–±—É–π—Ç–µ –∑–∞–Ω–æ–≤–æ.\n–ù–∞—Ä—É—à–µ–Ω–∏–µ –Ω–∞–π–¥–µ–Ω–æ –≤ —Å–ª–æ–≤–µ: <u>{word}</u>",

        "voice_message_reaction": "—Ñ—É! –§–£ –Ø –°–ö–ê–ó–ê–õ, –ù–ï–õ–¨–ó–Ø. –ë–†–û–°–¨ –ö–ê–ö–£. –ü–ò–®–ò –¢–ï–ö–°–¢–û–ú.",

        "greetings_words": ("–ø—Ä–∏–≤–µ—Ç", "—Ö–∞–π", "–∫—É", "–∑–¥–∞—Ä–æ–≤–∞"),  # –ë–æ—Ç —Å—Ä–µ–∞–≥–∏—Ä—É–µ—Ç –Ω–∞ –∫–æ—Ä–æ—Ç–∫–∏–µ —Å–æ–æ–±—â–µ–Ω–∏—è —Å —ç—Ç–∏–º–∏ —Å–ª–æ–≤–∞–º–∏

        "announcements" : (
            {
                "message" : "‚ùï –ù–µ –∑–∞–±—ã–≤–∞–π—Ç–µ –ø—Ä–æ –∫–æ–º–∞–Ω–¥—É <b>!report</b> –±–ª–∞–≥–æ–¥–∞—Ä—è –∫–æ—Ç–æ—Ä–æ–π –í—ã –º–æ–∂–µ—Ç–µ –æ–±—Ä–∞—Ç–∏—Ç—å –≤–Ω–∏–º–∞–Ω–∏–µ –∞–¥–º–∏–Ω–∏—Å—Ç—Ä–∞—Ü–∏–∏ –Ω–∞ <u>–Ω–∞—Ä—É—à–∏—Ç–µ–ª—è –≤ —á–∞—Ç–µ</u>.\n\n<tg-spoiler><i>–°–ø–∞–º –¥–∞–Ω–Ω–æ–π –∫–æ–º–∞–Ω–¥–æ–π –∫–∞—Ä–∞–µ—Ç—Å—è –≤–µ—á–Ω—ã–º –±–∞–Ω–æ–º.</i></tg-spoiler>",
                "every" : 10900 * 1.5
            },
            {
                "message" : "<b>üìÅ –≠—Ç–æ —á–∞—Ç –∫–∞–Ω–∞–ª–∞ @howdyho_official</b>\n–û–±—â–∞–π—Ç–µ—Å—å –≤–µ–∂–ª–∏–≤–æ –∏ –Ω–µ –Ω–∞—Ä—É—à–∞–π—Ç–µ –ø—Ä–∞–≤–∏–ª–∞!\n\nü§¨ –ú–∞—Ç <u>—É–¥–∞–ª—è–µ—Ç—Å—è –∞–≤—Ç–æ–º–∞—Ç–∏—á–µ—Å–∫–∏</u>\nüëπ –û—Ñ—Ñ—Ç–æ–ø/—Å–ø–∞–º –Ω–∞–∫–∞–∑—ã–≤–∞–µ—Ç—Å—è üçå –±–∞–Ω–∞–Ω–∞–º–∏\n\n<b>–í—Å–µ–º –º–∏—Ä–∞ ü§û</b>",
                "every" : 10800 * 1.5
            },
            {
                "message" : "<b>ü´∞ –î–æ–Ω–∞—Ç –∞–≤—Ç–æ—Ä—É –∫–∞–Ω–∞–ª–∞:</b>\n\n<i>–ú–æ–π Boosty:</i> https://boosty.to/howdyho\n<i>–ú–æ–π Patreon:</i> <a href='https://www.patreon.com/user?u=22843414'>https://www.patreon.com/howdyho</a>\n<i>–ù–∞—à Discord:</i> <a href='https://discord.gg/6khaudi-kho-1123002520072097953'>https://discord.gg/howdyho</a>",
                "every" : 7200 * 3
            },
            {
                "message" : "<b>üòà –£ –Ω–∞—Å –µ—Å—Ç—å —Å–∞–π—Ç, —Ç—ã –∑–Ω–∞–ª?</b>\n\n–í–æ—Ç–± –æ–Ω - https://howdyho.net\n–ú—ã —Ç–∞–º –ø–æ—Å—Ç–∏–º —Ç–æ–ø–æ–≤—ã–π —Å–æ—Ñ—Ç, –æ–±–æ–∏, –∏–≥—Ä—ã, –∏ –∫—É—á—É –≤—Å–µ–≥–æ –¥–ª—è –ü–ö!\n\n<i>–ó–∞—Ö–æ–¥–∏, —Ç–µ–±–µ —Ç–∞–º –≤—Å–µ–≥–¥–∞ —Ä–∞–¥—ã!</i>",
                "every" : 9000 * 2
            },
            {
                "message" : "<b>ü´∞ –•–æ—á–µ—à—å —á—Ç–æ–±—ã —Ç–≤–æ–π –º–µ–º/–ø–æ—Å—Ç –∑–∞–∫–∏–Ω—É–ª–∏ –≤ –∫–∞–Ω–∞–ª?</b>\n–¢—ã–∫–∞–π —Å—é–¥–∞ - @hhsharebot",
                "every" : 14500
            }
        )
    },
}


def get_string(key):
    """
    Get localized string. First, try language as set in config. Then, try English locale. Else - raise an exception.

    :param key: string name
    :return: localized string
    """
    localization_strings = strings.get(config.bot.language, strings.get('en'))

    if localization_strings is None:
        raise KeyError(f'Neither "{config.bot.language}" nor "en" locales found')

    try:
        return localization_strings[key]
    except KeyError:
        raise
