[EP-tech] Translate citations?

Yuri yurj at alfa.it
Tue Jul 5 10:29:55 BST 2016


  Translating citations seems overkilling, I'm unable to do it in a 
correct way (with pin values, for example), just plain text phrases. 
This means complex sentences are hard or impossible to translate.

For example, I would like to translate this:


to italian.

This is the interesting part:

<epc:if test="security != 'public'">
   <br />Restricted to <epc:print expr="security"/><epc:if 
test="date_embargo"> until <epc:print expr="date_embargo"/>.</epc:if>

This don't work:

in citations/document/default.xml:

<epc:if test="security != 'public'">
   <br />
       <epc:phrase ref="resticted_warning" ><epc:param 
name="security"><epc:print expr="security"/></epc:param>
       <epc:param name="date_embargo"><epc:print 


<epp:phrase id="resticted_warning">Restricted to <epc:print 
expr="security"/><epc:if test="date_embargo"> until <epc:print 


<epp:phrase id="resticted_warning">Ristretto a <epc:print 
expr="security"/><epc:if test="date_embargo"> fino a <epc:print 

It returns an error:

---------------- EPrints System Error ----------------------------
Script in Phrase: 'resticted_warning': can't get a property {security} 
from undefined value at character 0
^ here

(this happen also with date_embargo alone)

So, what to do? In this example, I can translate piece by piece (so just 
text with no variables) but in other situations I can't do it, I need 
variable substitution in the right place.

More information about the Eprints-tech mailing list