Commit 76ee5555 authored by Michal Čihař's avatar Michal Čihař

Do not confuse machine translation source with translation source

Let's name this service in this case.
parent 982fb858
......@@ -176,7 +176,7 @@ class MachineTranslation(object):
try:
translations = self.download_translations(language, text, unit)
return [{'text': trans[0], 'quality': trans[1], 'source': trans[2]}
return [{'text': trans[0], 'quality': trans[1], 'service': trans[2]}
for trans in translations]
except Exception as exc:
weblate.logger.error(
......
......@@ -58,8 +58,8 @@ class JSViewsTest(ViewTestCase):
self.assertEqual(
data['translations'],
[
{'quality': 100, 'source': 'Dummy', 'text': 'Nazdar světe!'},
{'quality': 100, 'source': 'Dummy', 'text': 'Ahoj světe!'},
{'quality': 100, 'service': 'Dummy', 'text': 'Nazdar světe!'},
{'quality': 100, 'service': 'Dummy', 'text': 'Ahoj světe!'},
]
)
......
......@@ -196,7 +196,7 @@
<thead>
<tr>
<th>{% trans "Translation" %}</th>
<th>{% trans "Source" %}</th>
<th>{% trans "Service" %}</th>
<th></th>
<tr>
</thead>
......
......@@ -64,7 +64,7 @@ function process_machine_translation(data, textStatus, jqXHR) {
dec_loading();
if (data.responseStatus == 200) {
data.translations.forEach(function (el, idx, ar) {
var code = $('<tr data-quality=' + el.quality + '"><td class="translatetext target">' + el.text + '</td><td>' + el.source + '</td><td><a class="copymt small-button">' + gettext('Copy') + '</a></td></tr>');
var code = $('<tr data-quality=' + el.quality + '"><td class="translatetext target">' + el.text + '</td><td>' + el.service + '</td><td><a class="copymt small-button">' + gettext('Copy') + '</a></td></tr>');
$('#machine-translations').append(code);
});
$('a.copymt').button({text: true, icons: { primary: "ui-icon-copy" }}).click(function () {
......
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