def main(arguments={}, path='', *args, **kwargs): language = path.startswith('/en/') and 'en' or 'nl' query = arguments.get('query', [''])[0] nlPath = '/'.join(['nl'] + path.split('/')[2:]) + '?' + urlencode(arguments) enPath = '/'.join(['en'] + path.split('/')[2:]) + '?' + urlencode(arguments) yield """
""" % (query, {'nl':'Zoeken', 'en':'Search'}[language], nlPath, enPath)