-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix/part-names-key: fix translation of part-names if they are not in … #511
base: develop
Are you sure you want to change the base?
Conversation
…lang-file. this commit is related to 741a51a Refs Edirom#502
I tried to reproduce the error and apparently it does not happen in eXist 6.0.1, but it does in 6.3.0, I don’t know why that is but looking at the code it seems more plausible that the error surfaces. |
Moreover, I’d like to bring to the attention of @Edirom/edirom-online-developer that the fix provided here is not dpecifically about part labels but concerns all retrievals of langugage variables with
|
Some thoughts for a more compact query: …
return
if($string) then $string else 'noValueFound' |
This is beyond the initial fix idea:
|
thanks for investigating @bwbohl ! i just realized that eutil:getLanguageString() does not make use of getLanguageFile.xql (which also loads the edition-specific lang-file) but loads the edirom-lang-file on its own. |
Good catch! |
add/data/xqm/eutil.xqm
Outdated
let $string := | ||
if($file//entry[@key = $key]) | ||
then ( | ||
$file//entry[@key = $key]/string(@value) | ||
) else ( | ||
'noValueFound' | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let $string := | |
if($file//entry[@key = $key]) | |
then ( | |
$file//entry[@key = $key]/string(@value) | |
) else ( | |
'noValueFound' | |
) | |
let $projectFile := doc(edition:getLanguageFileURI($edition, $lang)) | |
let $projectString := $projectFile//entry[@key = $key] | |
let $ediromString := $file//entry[@key = $key] | |
let $string := if($projectString) then $projectString else $ediromString |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
combined with the suggested return statement this could work! But I haven’t tested it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if i add
let $edition := request:get-parameter('edition', '')
it kind of does, but i guess not as intended: it will print the right values but it looks like the edition lang-file won't be found. probably i'm missing something?
should we ignore the custom edition lang-file for now (aka just use the suggested return statement) and come back to this for 1.1.0?
having a look at the baudi dataset (sources/music/cantatas/baudi-01-8a00c113.xml) i realized it probably might be best to not use the label-attr. to translate via the lang-file but the codedval-attr. so the 'long solution' could probably be:
if there is a label-attr. for the part -> use label-attr.
i think that could be a good way also considering the MEI-guidelines. |
Description, Context and related Issue
solve the problem that getParts.xql throws an error if the part names could not be found in lang keys.
Refs #502
(Refs #302 )
How Has This Been Tested?
tested with open-faust A3 (with parts), A2 (without parts)
Types of changes
Overview