Hello,
I have made some changes to the template file
plugins/oaiMetadataFormats/marcxml/record.tpl [OJS-Version: 2.4.6.0]
When I change the order of two template blocks, I get a strange effect:
a translation key from the second template block won’t be translated any more:
##submission.copyrightStatement##
OLD CODE:
<datafield tag="786" ind1="0" ind2=" ">
<subfield code="n">{$journal->getTitle($journal->getPrimaryLocale())|escape}; {$issue->getIssueIdentification()|escape}</subfield>
</datafield>
<datafield tag="540" ind1=" " ind2=" ">
<subfield code="a">{translate key="submission.copyrightStatement" copyrightYear=$article->getCopyrightYear() copyrightHolder=$article->getCopyrightHolder($journal->getPrimaryLocale())|escape}</subfield>
</datafield>
NEW CODE:
<datafield tag="540" ind1=" " ind2=" ">
<subfield code="a">{translate key="submission.copyrightStatement" copyrightYear=$article->getCopyrightYear() copyrightHolder=$article->getCopyrightHolder($journal->getPrimaryLocale())|escape}</subfield>
</datafield>
<datafield tag="786" ind1="0" ind2=" ">
<subfield code="n">{$journal->getTitle($journal->getPrimaryLocale())|escape}; {$issue->getIssueIdentification()|escape}</subfield>
</datafield>
I’ve figured out that the function call $issue->getIssueIdentification() from the 786 block has to be called before the translate command, then the key will be translated correctly again:
WORKAROUND
<!--{$issue->getIssueIdentification()}-->
<datafield tag="540" ind1=" " ind2=" ">
<subfield code="a">{translate key="submission.copyrightStatement" copyrightYear=$article->getCopyrightYear() copyrightHolder=$article->getCopyrightHolder($journal->getPrimaryLocale())|escape}</subfield>
</datafield>
What is the reason for that behavior?
Is there a better workaround?