示例#1
0
def spot_translate(request, responseid):
    # FIXME: This is gengo-machine specific for now.
    resp = get_object_or_404(Response, id=responseid)
    create_translation_tasks(resp, system='gengo_machine')

    # FIXME: We should return a message to the user, so they know
    # it'll happen at some point. Plus we need to let the user know
    # when it's failed.
    return HttpResponseRedirect(reverse('response_view', args=(responseid, )))
示例#2
0
文件: views.py 项目: Nnamso/fjord
def spot_translate(request, responseid):
    # FIXME: This is gengo-machine specific for now.
    resp = get_object_or_404(Response, id=responseid)
    create_translation_tasks(resp, system='gengo_machine')

    # FIXME: We should return a message to the user, so they know
    # it'll happen at some point. Plus we need to let the user know
    # when it's failed.
    return HttpResponseRedirect(
        reverse('response_view', args=(responseid,)))
示例#3
0
文件: views.py 项目: B-Rich/fjord
def spot_translate(request, responseid):
    # FIXME: This is gengo-machine specific for now.
    resp = get_object_or_404(Response, id=responseid)
    system = request.POST.get('system', None)
    if system and system in get_translation_systems():
        create_translation_tasks(resp, system=system)

    # FIXME: If there's no system specified, we should tell the user
    # something. I'm going to defer fixing that for now since the user
    # would have to be doing "sneaky" things to hit that situation.

    # FIXME: We should return a message to the user, so they know
    # it'll happen at some point. Plus we need to let the user know
    # when it's failed.
    return HttpResponseRedirect(
        reverse('response_view', args=(responseid,)))
示例#4
0
def spot_translate(request, responseid):
    # FIXME: This is gengo-machine specific for now.
    resp = get_object_or_404(Response, id=responseid)
    system = request.POST.get('system', None)
    total_jobs = 0
    if system and system in get_translation_systems():
        total_jobs += len(create_translation_tasks(resp, system=system))

    # FIXME: If there's no system specified, we should tell the user
    # something. I'm going to defer fixing that for now since the user
    # would have to be doing "sneaky" things to hit that situation.

    messages.success(request,
                     '%s %s translation jobs added' % (total_jobs, system))
    return HttpResponseRedirect(reverse('response_view', args=(responseid, )))
示例#5
0
文件: views.py 项目: prabushi/fjord
def spot_translate(request, responseid):
    # FIXME: This is gengo-machine specific for now.
    resp = get_object_or_404(Response, id=responseid)
    system = request.POST.get('system', None)
    total_jobs = 0
    if system and system in get_translation_systems():
        total_jobs += len(create_translation_tasks(resp, system=system))

    # FIXME: If there's no system specified, we should tell the user
    # something. I'm going to defer fixing that for now since the user
    # would have to be doing "sneaky" things to hit that situation.

    messages.success(request, '%s %s translation jobs added' % (
        total_jobs, system))
    return HttpResponseRedirect(
        reverse('response_view', args=(responseid,)))