You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the problem
When opening measure-based view of a source with parts, getParts.xql throws an error:
/db/apps/Edirom-Online/data/xql/getParts.xqlexerr:ERROR The actual return type does not match the sequence type declared in the function's signature: eutil:getLanguageString(xs:string, xs:string*, xs:string) xs:string. Expected cardinality: exactly one, got 0. [at line 264, column 41, source: /db/apps/Edirom-Online/data/xqm/eutil.xqm]
In function:
eutil:getLanguageString(xs:string, xs:string*, xs:string) [227:12:/db/apps/Edirom-Online/data/xqm/eutil.xqm]
eutil:getPartLabel(node(), xs:string) [32:22:/db/apps/Edirom-Online/data/xqm/eutil.xqm]
i was able to track the problem down: getParts.xql will try to translate the names of the parts with the edirom-lang-(de|en).xml-file
(e.g. <entry key="perfMedium.perfRes.voice" value="Voice (singing)"/>)
by calling eutil:getPartLabel(), which calls eutil:getLanguageString() to resolve the lang-key from the lang-file.
if the key (in my case perfMedium.perfRes.Set (3) Violoncello/Contrabbasso) does not exist, the return-value will be empty and not match the functions return key and an error is thrown.
explicitly checking the the returned value from the lang-file and returning an empty string if nothing was returned, solved the error: adding let $string := if(string-length($string) != 0) then ($string) else ("")
to the end of eutil:getLanguageString()
i cant tell if there might be any sideeffects by adding this line. can someone confirm that its safe?
it probably might be good to rethink translations (esp. of part-names) and implement them consequently (goto-menu with parts doesnt make use of translations so far).
Rel #155
To Reproduce
Setup Exist with current Edirom-Online develop and open-faust data
Open source A3, go to measure-based view
Nothing will be shown, because getParts.xql throws error
Expected behavior
no error should be thrown and the name of the parts should be displayed
feuerbart
changed the title
[BUG]
[BUG] getParts.xql fails if part-names can't be translated (aka no lang-key found)
Dec 15, 2024
feuerbart
changed the title
[BUG] getParts.xql fails if part-names can't be translated (aka no lang-key found)
[BUG] getParts.xql fails if part-names can't be translated
Dec 15, 2024
Describe the problem
When opening measure-based view of a source with parts,
getParts.xql
throws an error:i was able to track the problem down:
getParts.xql
will try to translate the names of the parts with theedirom-lang-(de|en).xml
-file(e.g.
<entry key="perfMedium.perfRes.voice" value="Voice (singing)"/>
)by calling
eutil:getPartLabel()
, which callseutil:getLanguageString()
to resolve the lang-key from the lang-file.if the key (in my case
perfMedium.perfRes.Set (3) Violoncello/Contrabbasso
) does not exist, the return-value will be empty and not match the functions return key and an error is thrown.explicitly checking the the returned value from the lang-file and returning an empty string if nothing was returned, solved the error: adding
let $string := if(string-length($string) != 0) then ($string) else ("")
to the end of
eutil:getLanguageString()
i cant tell if there might be any sideeffects by adding this line. can someone confirm that its safe?
it probably might be good to rethink translations (esp. of part-names) and implement them consequently (goto-menu with parts doesnt make use of translations so far).
Rel #155
To Reproduce
Expected behavior
no error should be thrown and the name of the parts should be displayed
Data
open-faust dataset: https://git.uni-paderborn.de/kio/open-faust
Edirom information
Environment information
The text was updated successfully, but these errors were encountered: