var CsTranslator = function(){
    this.options = {};
};

CsTranslator.prototype.initTranslation = function(data, onSuccess, onError, onBeforeSend){
    $.ajax({
        url: Routing.generate('cs_core.translate_init'),
        data: data,
        method: 'post',
        success: function(response, error, jqXHR){
            if (typeof onSuccess === "function") {
                onSuccess.call(this, response, error, jqXHR);
            }
        },
        error: function(response) {
            if (typeof onError === "function") {
                onError.call(this, response, error, jqXHR);
            }
        },
        beforeSend: function() {
            if (typeof onBeforeSend === "function") {
                onBeforeSend.call();
            }
        }
    });
};