all repos — python-meme-bot @ 3fd391b693d6859ad5f0edfd1190cc400364261f

Telegram Bot that uses PIL to compute light image processing.

Constants.py (view raw)

 1localization = {
 2    'us': {
 3        'welcome' : "Welcome to PILuAnimeBot!",
 4        'sauce' : "[Sauce 🍝]({})",
 5        'no_caption' : "No caption detected.",
 6        'lewd_toggle' : "Lewd content was {} for this chat.",
 7        'enabled' : "enabled",
 8        'disabled' : "disabled",
 9        'unknown' : "Sorry, I didn't understand that command.",
10        'error': "Something bad happened. Please retry.",
11    }
12}
13
14
15def get_localized_string(text, lang='us'):
16    try:
17        return localization[lang][text]
18    except KeyError:
19        logging.error("No text was found.")
20        return "localization error {}{}{}{}{}{}"