[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[EP-tech] Translate citations?



This are citations, not phrases. It fails, for example, in <epc:if 
test="date_embargo"> because it doesn't find date_embargo.

The wiki 
https://wiki.eprints.org/w/Translation#Example:_the_citations.2Fdocument.2Fdefault.xml_file 
cites some patches to apply to make it works, for example. But patches 
has been removed, so I don't know if it still applies...


Il 05/07/2016 12:01, Alan.Stiles ha scritto:
> Hi Yuri,
> I haven't tested it, but from http://wiki.eprints.org/w/Phrase_Format  try the following in your language specific phrases:
>
> e.g. in lang/en/phrases/custom.xml:
>
> <epp:phrase id="resticted_warning">Restricted to <epc:pin name="security" /><epc:if test="date_embargo"> until <epc:pin name="date_embargo" />.</epc:if></epp:phrase>
>
>
> Also, not the cause of the problem but your phrase id is missing an 'r' in the middle of 'restricted', however you've left it out everywhere so it should work.
>
> Regards,
> Alan
>
> -----Original Message-----
> From: eprints-tech-bounces at ecs.soton.ac.uk [mailto:eprints-tech-bounces at ecs.soton.ac.uk] On Behalf Of Yuri
> Sent: 05 July 2016 10:30
> To: EPrints.org Technical List <eprints-tech at ecs.soton.ac.uk>
> Subject: [EP-tech] Translate citations?
>
> Hi!
>
>    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:
>
> https://github.com/eprints/eprints/blob/33a7bb8a8b3f80ba02ddd6618eb4e7dc3209ec68/lib/defaultcfg/citations/document/default.xml
>
> 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> </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 expr="date_embargo"/></epc:param> </epc:phrase> </epc:if>
>
> lang/en/phrases/custom.xml:
>
> <epp:phrase id="resticted_warning">Restricted to <epc:print expr="security"/><epc:if test="date_embargo"> until <epc:print expr="date_embargo"/>.</epc:if></epp:phrase>
>
> lang/it/phrases/custom.xml:
>
> <epp:phrase id="resticted_warning">Ristretto a <epc:print expr="security"/><epc:if test="date_embargo"> fino a <epc:print expr="date_embargo"/>.</epc:if></epp:phrase>
> =====
>
> It returns an error:
>
> ------------------------------------------------------------------
> ---------------- EPrints System Error ----------------------------
> ------------------------------------------------------------------
> Script in Phrase: 'resticted_warning': can't get a property {security} from undefined value at character 0 security ^ 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.
> *** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
> *** Archive: http://www.eprints.org/tech.php/
> *** EPrints community wiki: http://wiki.eprints.org/
> *** EPrints developers Forum: http://forum.eprints.org/
> -- The Open University is incorporated by Royal Charter (RC 000391), an exempt charity in England & Wales and a charity registered in Scotland (SC 038302). The Open University is authorised and regulated by the Financial Conduct Authority.
>
> *** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
> *** Archive: http://www.eprints.org/tech.php/
> *** EPrints community wiki: http://wiki.eprints.org/
> *** EPrints developers Forum: http://forum.eprints.org/