Пример #1
0
def form(request):
    result = None
    if 't' in request.params and 'l' in request.params:
        result = transliterate_name(request.params['l'], request.params['t'])
    return {
        'project': "Classical Atlas Transliteration",
        'langs': langs,
        'lang': request.params.get('l', default_lang),
        'text': request.params.get('t', default_text),
        'result': result
        }
Пример #2
0
def name_titleStarts(obj, **kw):
    title = obj.getNameTransliterated() or obj.Title()
    if not title:
        nameAttested = obj.getNameAttested()
        nameLanguage = obj.getNameLanguage()
        if not nameAttested or not nameLanguage:
            return None
        title = transliterate_name(nameLanguage, nameAttested)
    if len(title) > 0:
        return title[0].upper()
    else:
        return None