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

Merge remote-tracking branch 'origin/master'

parents 6d7474aa 4b59b4c4
......@@ -6,7 +6,10 @@ weblate 0.5
Relased on ? 2012.
* Support for machine translation using Apertium and Microsoft Translator.
* Support for machine translation using following online services:
* Apertium
* Microsoft Translator
* MyMemory
* Several new translations.
* Improved merging of upstream changes.
* Better handle concurrent git pull and translation.
......
......@@ -66,3 +66,38 @@ As an anonymous user, you have no other choice than making a suggestion.
However if you are logged in you can still decide to make only a suggestion
instead of saving translation, for example in case you are unsure about the
translation and you want somebody else to review it.
Machine translation
-------------------
Based on configuration and your language, Weblate provides buttons for following
machine translation tools.
MyMemory
++++++++
Huge translation memory with machine translation.
.. seealso::
http://mymemory.translated.net/
Apertium
++++++++
A free/open-source machine translation platform providing translation to
limited set of lanugages.
.. seealso::
http://www.apertium.org/
Microsoft Translator
++++++++++++++++++++
Machine translation service. Weblate is currently using deprecated v1 API,
which might stop working in future.
.. seealso::
http://www.microsofttranslator.com/
......@@ -2,29 +2,8 @@ function text_change(e) {
$('#id_fuzzy').attr('checked', false);
}
$(function() {
$('.button').button();
$('ul.menu li a').button();
$('ul.breadcums').buttonset();
$('div.progress').each(function f(i, e) {e = $(e); e.progressbar({ value: parseInt(e.attr('id')) })});
$('.accordion').accordion();
$('.errorlist').addClass('ui-state-error ui-corner-all');
$('.sug-accept').button({text: false, icons: { primary: "ui-icon-check" }});
$('.sug-delete').button({text: false, icons: { primary: "ui-icon-close" }});
$('.navi').buttonset();
$('.button-first').button({text: false, icons: { primary: "ui-icon-seek-first" }});
$('.button-next').button({text: false, icons: { primary: "ui-icon-seek-next" }});
$('.button-prev').button({text: false, icons: { primary: "ui-icon-seek-prev" }});
$('.button-end').button({text: false, icons: { primary: "ui-icon-seek-end" }});
$('textarea.translation').change(text_change).keypress(text_change).autogrow().focus();
$('#copy-text').button({text: true, icons: { primary: "ui-icon-arrow-1-s" }}).click(function f() {
$.get("/js/get/" + $('#id_checksum').attr('value') + '/', function(data) {
$('#id_target').text(data);
});
return false;
});
if (typeof(apertium) != 'undefined' && typeof(target_language) != 'undefined' && apertium.isTranslatablePair('en', target_language)) {
function load_translate_apis() {
if (typeof(apertium) != 'undefined' && apertium.isTranslatablePair('en', target_language)) {
$('#copy-text').after('<a href="#" id="translate-apertium">' + gettext('Translate using Apertium') + '</a>');
$('#translate-apertium').button({text: true, icons: { primary: "ui-icon-shuffle" }}).click(function f() {
$.get("/js/get/" + $('#id_checksum').attr('value') + '/', function(data) {
......@@ -37,7 +16,7 @@ $(function() {
return false;
});
}
if (typeof(Microsoft) != 'undefined' && typeof(target_language) != 'undefined') {
if (typeof(Microsoft) != 'undefined') {
var langs = Microsoft.Translator.getLanguages();
if (langs.indexOf(target_language) != -1) {
$('#copy-text').after('<a href="#" id="translate-microsoft">' + gettext('Translate using Microsoft Translator') + '</a>');
......@@ -51,4 +30,40 @@ $(function() {
});
}
}
$('#copy-text').after('<a href="#" id="translate-mymemory">' + gettext('Translate using MyMemory') + '</a>');
$('#translate-mymemory').button({text: true, icons: { primary: "ui-icon-shuffle" }}).click(function f() {
$.get("/js/get/" + $('#id_checksum').attr('value') + '/', function(data) {
$.getJSON("http://mymemory.translated.net/api/get?q=" + data + "&langpair=en|" + target_language, function(data) {
if (data.responseData != '') {
$('#id_target').text(data.responseData.translatedText);
}
});
});
});
}
$(function() {
$('.button').button();
$('ul.menu li a').button();
$('ul.breadcums').buttonset();
$('div.progress').each(function f(i, e) {e = $(e); e.progressbar({ value: parseInt(e.attr('id')) })});
$('.accordion').accordion();
$('.errorlist').addClass('ui-state-error ui-corner-all');
$('.sug-accept').button({text: false, icons: { primary: "ui-icon-check" }});
$('.sug-delete').button({text: false, icons: { primary: "ui-icon-close" }});
$('.navi').buttonset();
$('.button-first').button({text: false, icons: { primary: "ui-icon-seek-first" }});
$('.button-next').button({text: false, icons: { primary: "ui-icon-seek-next" }});
$('.button-prev').button({text: false, icons: { primary: "ui-icon-seek-prev" }});
$('.button-end').button({text: false, icons: { primary: "ui-icon-seek-end" }});
$('textarea.translation').change(text_change).keypress(text_change).autogrow().focus();
$('#copy-text').button({text: true, icons: { primary: "ui-icon-arrow-1-s" }}).click(function f() {
$.get("/js/get/" + $('#id_checksum').attr('value') + '/', function(data) {
$('#id_target').text(data);
});
return false;
});
if (typeof(target_language) != 'undefined') {
load_translate_apis();
}
});
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