Huseyin Özoguz schrieb am 03.12.18 um 17:47:
Before you write your own commands try to use what is available.
Right, but in many cases I am just not aware of what is available, to be honest, though I quite often use the wikigarden.
I tried to change your example into arabic-german, seems to work, except only the first translation-pair is shown (see attachment). Why?
\usemodule [database] \startbuffer[sample] "قال","sagte (Es)" "رسول","Gesandte (der)" "الله","Gottes" \stopbuffer
\define[2]\InterlinearText {\setupalign[r2l]\definedfont[file:arial*arabic at 16 pt] \ruby{{\setupalign[r2l]#1}}{\setupalign[l2r]\definedfont[name:arial at 10pt]#2}}
\definedatabase [interlineartext] [quotechar={"}, command=\InterlinearText]
\setupinterlinespace[line=8ex]
\setupruby[voffset=-3ex]
\starttext \definedfont[file:arial*arabic at 16 pt] \processdatabasebuffer[interlineartext][sample] \stoptext
Probably something with your font/alignment switching. \usemodule [database] \startbuffer[sample] "قال","sagte (Es)" "رسول","Gesandte (der)" "الله","Gottes" \stopbuffer \define[2]\InterlinearText {\ruby{#1}{#2} } % \defineruby % [interlineartext] % [style=] % % \define[2]\InterlinearText % {\ruby[interlineartext]{#1}{#2} } \definedatabase [interlineartext] [quotechar={"}, command=\InterlinearText] \setupinterlinespace[line=8ex] \definefontfamily [arial] [ss] [Arial] [features=arabic] \setupbodyfont [arial,16pt] \starttext \processdatabasebuffer[interlineartext][sample] \stoptext
And second: Of course it would be best readable, if one could write instead
\startbuffer[sample] "قال","(Es) sagte" \stopbuffer
but with same output, s.t. the order of the words in the second database-element is inverted. Is that possible?
There is no command which changes the order of words in a sentence but this should be easy with a short Lua function. Wolfgang