from MoinMoin import wikiutil, config, multilang
import os
from MoinMoin.Page import Page

def execute(page_name, request):
    """ """
    pg = Page(page_name)
    errmsg = ""

    # in wiki with single language only show page
    if not config.multilingual_dir:
        pg.send_page(request, msg = errmsg)
        return

    # got page parameter?
    if request.form.has_key("page"):
        name = request.form["page"].value
        errmsg = multilang.set_translation(page_name, name)
    # no page
    else:
        errmsg = 'no page given'
    
    pg.send_page(request, msg = errmsg)
