Commit ba6847a6 authored by Michal Čihař's avatar Michal Čihař

There is no need to manually set service id

parent f661d691
......@@ -35,13 +35,13 @@ class MachineTranslation(object):
'''
Generic object for machine translation services.
'''
name = None
verbose = None
name = 'MT'
def __init__(self):
'''
Creates new machine translation object.
'''
self.mtid = self.name.lower().replace(' ', '-')
def json_req(self, url, **kwargs):
'''
......@@ -93,7 +93,7 @@ class MachineTranslation(object):
'''
Returns list of supported languages.
'''
cache_key = '%s-languages' % self.name
cache_key = '%s-languages' % self.mtid
# Try using list from cache
languages = cache.get(cache_key)
......
......@@ -25,8 +25,7 @@ class DummyTranslation(MachineTranslation):
'''
Dummy machine translation for testing purposes.
'''
name = 'dummy'
verbose = 'Dummy'
name = 'Dummy'
def download_languages(self):
'''
......
......@@ -25,8 +25,7 @@ class MyMemoryTranslation(MachineTranslation):
'''
MyMemory machine translation support.
'''
name = 'mymemory'
verbose = 'MyMemory'
name = 'MyMemory'
def is_supported(self, language):
'''
......
......@@ -26,8 +26,7 @@ class OpenTranTranslation(MachineTranslation):
'''
Open-Tran machine translation support.
'''
name = 'open-tran'
verbose = 'Open-Tran'
name = 'Open-Tran'
def download_languages(self):
'''
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment