Commit e1d3c9ae authored by Mathias Goebel's avatar Mathias Goebel 🎠
Browse files

add a generic translator for @tei:n

parent 50759daf
......@@ -26,6 +26,32 @@ as xs:string? {
else f-misc:get-title-by-baseUri( "textgrid:" || $nb )
};
(:~
: Translates tei:surface/@n to German
: @param $n – a valid @tei:n value
: @return the German version, e.g. outer_front_cover translates to "vordere Einbanddecke außen"
: :)
declare function f-misc:n-translate($n as xs:string)
as xs:string{
if(contains($n, 'endpaper'))
then
let $seq := tokenize($n, '_')
return
((switch($seq[1])
case "front" return 'vorderes'
case "back" return 'hinteres'
default return 'ungültiger Wert in @n')
|| ' Vorsatzblatt ' || $seq[last()])
else
switch ($n)
case "outer_front_cover" return "vordere Einbanddecke außen"
case "inner_front_cover" return "vordere Einbanddecke innen"
case "inner_back_cover" return "hintere Einbanddecke innen"
case "outer_back_cover" return "hintere Einbanddecke außen"
case "spine" return "Buchrücken"
default return $n
};
declare function f-misc:cite($node as node(), $model as map(*)) {
let $url := request:get-url(),
$res := tokenize($url, '/')[last()],
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment