$def with (page) $ _t = i18n.get_namespace('/type/edition') $ _ = i18n.get_namespace('/mode/view') $ s = "other_titles", "translated_titles", "genres", "first_publish_date", "subject_places", "original_languages", "dewey_number", "lc_classifications", "subjects", "subject_times", "excerpts" $ subjects = ["subjects"] $for name in s: $if page[name]:

$_t[name] $if name == "other_titles": | $:'; '.join(thingrepr(i) for i in page[name])
$# detect-missing-i18n-skip-line $elif name == "translated_titles": $for t in page[name]: | $t.language.name - $t.text; $elif name == "subjects": | $for name in subjects: $for subject in page[name]: $:utf8(thingrepr(subject)).replace(' -- ', '/'), $else: | $:thingrepr(page[name])

$ cur_locale = i18n.get_locale() $ this_lang = False $ simple = False $ wikipedia = [] $ links = page.links $if links: $for link in links: $ wiki_find = link.url.find('.wikipedia.org/') $ lang = link.url[7:wiki_find] $if not lang.replace('-', '').isalpha(): $continue $ link['lang'] = lang $if lang == cur_locale: $ this_lang = link $if lang == 'simple': $ simple = link $ wikipedia.append(link) $if this_lang or len(wikipedia):
$_t['wikipedia']: $if this_lang: $this_lang.lang: $(this_lang.title or this_lang.url) $else: $_("No link to Wikipedia in your language") $if simple: Simple English: $(simple.title or simple.url) $if len(wikipedia): Other languages
$for link in wikipedia: $link.lang: $(link.title or link.url)
$ links = [l for l in links if 'lang' not in l] $if links:
$_t['links']: $for link in links: $(link.title or link.url)