localization = { 'us': { 'welcome' : "Welcome to PILuAnimeBot!", 'sauce' : "Sauce ๐Ÿ", 'no_caption' : "No caption detected.", 'lewd_toggle' : "Lewd content was {} for this chat.", 'enabled' : "enabled", 'disabled' : "disabled", 'unknown' : "Sorry, I didn't understand that command.", 'error': "An error has occurred. Please retry.", }, 'it': { 'welcome' : "Benvenuto da PILuAnimeBot!", 'sauce' : "Salsa ๐Ÿ", 'no_caption' : "Scrivi un testo per favore.", 'lewd_toggle' : "La roba lewd รจ stata {} per questa chat.", 'enabled' : "abilitata", 'disabled' : "disabilitata", 'unknown' : "Non ho capito.", 'error': "Qualcosa รจ andato storto, riprova.", }, } def get_localized_string(text, lang='us'): try: return localization[lang][text] except KeyError: logging.error("No text was found.") return "localization error {}{}{}{}{}{}"