Research
Recent Trends in Malicious Packages Targeting Discord
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
google-translator-simplified
Class for translating texts and detecting language (based on Google Translator).
Readme
Class for translating texts and detecting language (based on Google Translator).
Get text translation:
from google_translator_simplified import Translator
Translator.get_translation('pl', 'text for translation', 'en') #'Tekst do tłumaczenia '
Translator.get_translation('de', 'tekst do przetłumaczenia', 'pl') #'Text für die Übersetzung '
Translator.get_translation('pl', 'text for translation') #'Tekst do tłumaczenia '
Translator.get_translation('de', 'tekst do przetłumaczenia') #'Text für die Übersetzung '
Detect language:
from google_translator_simplified import Translator
Translator.detect_lang('text for translation') #'en'
Translator.detect_lang('Mittwoch') #'de'
Translator.detect_lang('inny przykład') #'pl'
Get language abbreviation:
from google_translator_simplified import Translator
Translator.get_abbreviation('english') #'en'
Translator.get_abbreviation('polish') #'pl'
Translator.get_abbreviation('german') #'de'
Get language full name:
from google_translator_simplified import Translator
Translator.get_name('en') #'english'
Translator.get_name('pl') #'polish'
Translator.get_name('de') #'german'
names list:
from google_translator_simplified import Translator
Translator.names_list[:7] #['afrikaans', 'albanian', 'amharic', 'arabic', 'armenian', 'azerbaijani', 'basque'])
abbreviation list:
from google_translator_simplified import Translator
Translator.abbreviation_list[:7] #['af', 'sq', 'am', 'ar', 'hy', 'az', 'eu']
Errors:
from google_translator_simplified import Translator
import unittest
class TestTranslator(unittest.TestCase):
def test_untranslatableError(self):
self.assertRaises(Translator.TranslatorUntranslatableError,
Translator.detect_lang, '')
self.assertRaises(Translator.TranslatorUntranslatableError,
Translator.detect_lang, '``2564&&')
self.assertRaises(Translator.TranslatorUntranslatableError,
Translator.detect_lang, ' ')
self.assertRaises(Translator.TranslatorUntranslatableError,
Translator.detect_lang, ' \t\n')
def test_IncorrectAbbreviation(self):
self.assertRaises(Translator.TranslatorIncorrectAbbreviation,
Translator.get_translation, '', 'text for translation')
self.assertRaises(Translator.TranslatorIncorrectAbbreviation,
Translator.get_translation, 'd', 'text for translation')
self.assertRaises(Translator.TranslatorIncorrectAbbreviation,
Translator.get_translation, 'de', 'text for translation', 'e')
FAQs
Class for translating texts and detecting language (based on Google Translator).
We found that google-translator-simplified demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
Security News
Socket CEO Feross Aboukhadijeh joins a16z partners to discuss how modern, sophisticated supply chain attacks require AI-driven defenses and explore the challenges and solutions in leveraging AI for threat detection early in the development life cycle.
Security News
NIST's new AI Risk Management Framework aims to enhance the security and reliability of generative AI systems and address the unique challenges of malicious AI exploits.