Commit 97b44647 authored by Michal Čihař's avatar Michal Čihař

Add support for Amagama service

parent a63fed07
......@@ -425,6 +425,16 @@ up to adminitrator to enable them. The services have different terms of use, so
please check whether you are allowed to use them before enabling in Weblate.
The individual services are enabled using :setting:`MACHINE_TRANSLATION_SERVICES`.
Amagama
+++++++
Special installation of :ref:`tmserver` run by Virtaal authors.
To enable this service, add ``trans.machine.tmserver.AmagamaTranslation`` to
:setting:`MACHINE_TRANSLATION_SERVICES`.
.. seealso:: http://docs.translatehouse.org/projects/virtaal/en/latest/amagama.html
Apertium
++++++++
......
......@@ -73,3 +73,11 @@ class TMServerTranslation(MachineTranslation):
return [(line['target'], line['quality'], self.name, line['source'])
for line in response]
class AmagamaTranslation(TMServerTranslation):
'''
Specific instance of tmserver ran by Virtaal authors.
'''
def get_server_url(self):
return 'http://amagama.locamotion.org'
......@@ -27,6 +27,7 @@ from trans.machine.glosbe import GlosbeTranslation
from trans.machine.mymemory import MyMemoryTranslation
from trans.machine.opentran import OpenTranTranslation
from trans.machine.apertium import ApertiumTranslation
from trans.machine.tmserver import AmagamaTranslation
from trans.machine.microsoft import (
MicrosoftTranslation, microsoft_translation_supported
)
......@@ -82,6 +83,10 @@ class MachineTranslationTest(TestCase):
machine = GoogleTranslation()
self.assertIsInstance(machine.translate('cs', 'world', None), list)
def test_amagama(self):
machine = AmagamaTranslation()
self.assertIsInstance(machine.translate('cs', 'world', None), list)
class WeblateTranslationTest(ViewTestCase):
def test_same(self):
......
......@@ -380,6 +380,7 @@ WHOOSH_INDEX = os.path.join(WEB_ROOT, 'whoosh-index')
# 'trans.machine.microsoft.MicrosoftTranslation',
# 'trans.machine.mymemory.MyMemoryTranslation',
# 'trans.machine.opentran.OpenTranTranslation',
# 'trans.machine.tmserver.AmagamaTranslation',
# 'trans.machine.tmserver.TMServerTranslation',
# 'trans.machine.weblatetm.WeblateSimilarTranslation',
# 'trans.machine.weblatetm.WeblateTranslation',
......
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