all repos — python-meme-bot @ 7f2b1a503ee21ef09535d7ecd14fa5ca6d29b9a3

Telegram Bot that uses PIL to compute light image processing.

Constants.py (view raw)

 1import logging
 2
 3localization = {
 4    'us': {
 5        'welcome' : "Welcome to PILuAnimeBot!",
 6        'sauce' : "Sauce ๐Ÿ",
 7        'no_caption' : "No caption detected.",
 8        'lewd_toggle' : "Lewd content was {} for this chat.",
 9        'enabled' : "enabled",
10        'disabled' : "disabled",
11        'unknown' : "Sorry, I didn't understand that command.",
12        'error': "An error has occurred. Please retry.",
13        'failed_effect': "Couldn't apply effect."
14    },
15    'it': {
16        'welcome' : "Benvenuto da PILuAnimeBot!",
17        'sauce' : "Salsa ๐Ÿ",
18        'no_caption' : "Scrivi un testo per favore.",
19        'lewd_toggle' : "La roba lewd รจ stata {} per questa chat.",
20        'enabled' : "abilitata",
21        'disabled' : "disabilitata",
22        'unknown' : "Non ho capito.",
23        'error': "Qualcosa รจ andato storto, riprova.",
24        'failed_effect': "Impossibile applicare l'effetto."
25    },
26}
27
28
29def get_localized_string(text, lang='us'):
30    try:
31        return localization[lang][text]
32    except KeyError:
33        logging.error("No text was found.")
34        return "localization error {}{}{}{}{}{}"