Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
fontane-notizbuecher
SADE
Commits
e1d3c9ae
Commit
e1d3c9ae
authored
Aug 06, 2018
by
Mathias Goebel
Browse files
add a generic translator for
@tei
:n
parent
50759daf
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/fontane/misc.xqm
View file @
e1d3c9ae
...
...
@@ -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()],
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment