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
34095f48
Commit
34095f48
authored
Mar 20, 2013
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return fully qualified results from translate method (including name of service)
parent
a7a4c654
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
4 deletions
+10
-4
trans/machine/base.py
trans/machine/base.py
+4
-1
trans/tests/js_views.py
trans/tests/js_views.py
+4
-1
trans/tests/machine.py
trans/tests/machine.py
+2
-2
No files found.
trans/machine/base.py
View file @
34095f48
...
...
@@ -173,7 +173,10 @@ class MachineTranslation(object):
return
[]
try
:
return
self
.
download_translations
(
language
,
text
)
translations
=
self
.
download_translations
(
language
,
text
)
return
[{
't'
:
trans
[
0
],
'q'
:
trans
[
1
],
's'
:
self
.
name
}
for
trans
in
translations
]
except
Exception
as
exc
:
weblate
.
logger
.
error
(
'Failed to fetch translations from %s (%s)'
,
...
...
trans/tests/js_views.py
View file @
34095f48
...
...
@@ -57,7 +57,10 @@ class JSViewsTest(ViewTestCase):
data
=
simplejson
.
loads
(
response
.
content
)
self
.
assertEqual
(
data
,
[[
'Nazdar světe!'
,
100
],
[
'Ahoj světe!'
,
100
]]
[
{
'q'
:
100
,
's'
:
'Dummy'
,
't'
:
'Nazdar světe!'
},
{
'q'
:
100
,
's'
:
'Dummy'
,
't'
:
'Ahoj světe!'
},
]
)
def
test_get_other
(
self
):
...
...
trans/tests/machine.py
View file @
34095f48
...
...
@@ -47,8 +47,8 @@ class MachineTranslationTest(TestCase):
[]
)
self
.
assertEqual
(
machine_translation
.
translate
(
'cs'
,
'Hello, world!'
),
[(
'Nazdar světe!'
,
100
),
(
'Ahoj světe!'
,
100
)]
len
(
machine_translation
.
translate
(
'cs'
,
'Hello, world!'
)
),
2
)
def
test_glosbe
(
self
):
...
...
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