Esempio n. 1
0
 def __init__(self):
     '''
     Checks configuration.
     '''
     super(GoogleTranslation, self).__init__()
     if settings.MT_GOOGLE_KEY is None:
         raise MissingConfiguration('Google Translate requires API key')
Esempio n. 2
0
 def __init__(self):
     """Check configuration."""
     super(YandexTranslation, self).__init__()
     if settings.MT_YANDEX_KEY is None:
         raise MissingConfiguration(
             'Yandex Translate requires API key'
         )
Esempio n. 3
0
 def __init__(self):
     """Check configuration."""
     super(SAPTranslationHub, self).__init__()
     if settings.MT_SAP_BASE_URL is None:
         raise MissingConfiguration(
             'missing SAP Translation Hub configuration'
         )
Esempio n. 4
0
 def __init__(self):
     """Check configuration."""
     super(MicrosoftTranslation, self).__init__()
     self._access_token = None
     self._token_expiry = None
     if not self.ms_supported():
         raise MissingConfiguration(
             'Microsoft Translator requires credentials')
Esempio n. 5
0
    def get_server_url(self):
        '''
        Returns URL of a server.
        '''
        if appsettings.MT_APERTIUM_APY is None:
            raise MissingConfiguration('Not configured Apertium APy URL')

        return appsettings.MT_APERTIUM_APY.rstrip('/')
Esempio n. 6
0
    def get_server_url(self):
        '''
        Returns URL of a server.
        '''
        if appsettings.MT_TMSERVER is None:
            raise MissingConfiguration('Not configured tmserver URL')

        return appsettings.MT_TMSERVER.rstrip('/')
Esempio n. 7
0
 def __init__(self):
     '''
     Checks configuration.
     '''
     super(MicrosoftTranslation, self).__init__()
     self._access_token = None
     self._token_expiry = None
     if not microsoft_translation_supported():
         raise MissingConfiguration(
             'Microsoft Translator requires credentials')
Esempio n. 8
0
    def get_server_url(self):
        """Return URL of a server."""
        if settings.MT_APERTIUM_APY is None:
            raise MissingConfiguration('Not configured Apertium APy URL')

        return settings.MT_APERTIUM_APY.rstrip('/')
Esempio n. 9
0
    def get_server_url(self):
        """Return URL of a server."""
        if settings.MT_TMSERVER is None:
            raise MissingConfiguration('Not configured tmserver URL')

        return settings.MT_TMSERVER.rstrip('/')
Esempio n. 10
0
 def __init__(self):
     """Check configuration."""
     super(DeepLTranslation, self).__init__()
     if settings.MT_DEEPL_KEY is None:
         raise MissingConfiguration('DeepL requires API key')