Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
ec8e2c36
Commit
ec8e2c36
authored
Apr 18, 2013
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow to configure mail for mymemory service
parent
d3ed1769
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
4 deletions
+29
-4
docs/admin.rst
docs/admin.rst
+3
-2
docs/config.rst
docs/config.rst
+9
-0
trans/machine/mymemory.py
trans/machine/mymemory.py
+9
-2
weblate/appsettings.py
weblate/appsettings.py
+4
-0
weblate/settings_example.py
weblate/settings_example.py
+4
-0
No files found.
docs/admin.rst
View file @
ec8e2c36
...
...
@@ -492,14 +492,15 @@ MyMemory
Huge translation memory with machine translation.
Free, anonymous usage is currently limited to 100 requests/day,
you can ask for
more.
Free, anonymous usage is currently limited to 100 requests/day,
or to 1000 with
:setting:`MT_MYMEMORY_EMAIL`, you can ask for
more.
To enable this service, add ``trans.machine.mymemory.MyMemoryTranslation`` to
:setting:`MACHINE_TRANSLATION_SERVICES`.
.. seealso::
:setting:`MT_MYMEMORY_EMAIL`,
http://mymemory.translated.net/
Open-Tran
...
...
docs/config.rst
View file @
ec8e2c36
...
...
@@ -208,6 +208,15 @@ Client secret for Microsoft Translator service.
.. seealso:: :ref:`machine-translation-setup`, :ref:`machine-translation`, https://datamarket.azure.com/developer/applications/
.. setting:: MT_MYMEMORY_EMAIL
MT_MYMEMORY_EMAIL
-----------------
MyMemory identification email, you can get 1000 requests per day with this.
.. seealso:: :ref:`machine-translation-setup`, :ref:`machine-translation`, http://mymemory.translated.net/doc/spec.php
.. setting:: MT_TMSERVER
MT_TMSERVER
...
...
trans/machine/mymemory.py
View file @
ec8e2c36
...
...
@@ -19,6 +19,7 @@
#
from
trans.machine.base
import
MachineTranslation
from
weblate
import
appsettings
class
MyMemoryTranslation
(
MachineTranslation
):
...
...
@@ -67,10 +68,16 @@ class MyMemoryTranslation(MachineTranslation):
'''
Downloads list of possible translations from a service.
'''
args
=
{
'q'
:
text
,
'langpair'
:
'en|%s'
%
language
,
}
if
appsettings
.
MT_MYMEMORY_EMAIL
is
not
None
:
args
[
'de'
]
=
appsettings
.
MT_MYMEMORY_EMAIL
response
=
self
.
json_status_req
(
'http://mymemory.translated.net/api/get'
,
q
=
text
,
langpair
=
'en|%s'
%
language
,
**
args
)
return
[
self
.
format_match
(
match
)
for
match
in
response
[
'matches'
]]
weblate/appsettings.py
View file @
ec8e2c36
...
...
@@ -43,6 +43,10 @@ MT_APERTIUM_KEY = get('MT_APERTIUM_KEY', None)
MT_MICROSOFT_ID
=
get
(
'MT_MICROSOFT_ID'
,
None
)
MT_MICROSOFT_SECRET
=
get
(
'MT_MICROSOFT_SECRET'
,
None
)
# MyMemory identification email, see
# http://mymemory.translated.net/doc/spec.php
MT_MYMEMORY_EMAIL
=
get
(
'MT_MYMEMORY_EMAIL'
,
None
)
# tmserver URL
MT_TMSERVER
=
get
(
'MT_TMSERVER'
,
None
)
...
...
weblate/settings_example.py
View file @
ec8e2c36
...
...
@@ -278,6 +278,10 @@ MT_APERTIUM_KEY = None
MT_MICROSOFT_ID
=
None
MT_MICROSOFT_SECRET
=
None
# MyMemory identification email, see
# http://mymemory.translated.net/doc/spec.php
MT_MYMEMORY_EMAIL
=
None
# tmserver URL
MT_TMSERVER
=
None
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment