EPrints Technical Mailing List Archive

See the EPrints wiki for instructions on how to join this mailing list and related information.

Message: #05808


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

Re: [EP-tech] Translate citations?


Hi Yuri,

 

i have done so:

 

from: cfg/citations/document/default.xml

<epc:if test="security != 'public'">
 <br /><epc:print expr="security"/><epc:if test="date_embargo"> <epc:phrase ref="citation_document_default_embargo_until"/> <epc:print expr="date_embargo"/>.</epc:if>
</epc:if>

from: cfg/lang/it/phrases/custom.xml:

<epp:phrase id="security_typename_staffonly">Accesso riservato</epp:phrase>
<epp:phrase id="citation_document_default_embargo_until">fino al</epp:phrase>

from: cfg/lang/en/phrases/custom.xml

<epp:phrase id="security_typename_staffonly">Repository staff only</epp:phrase>
<epp:phrase id="citation_document_default_embargo_until">until</epp:phrase>

Enio

 

In data martedì 5 luglio 2016 11:29:55 CEST, Yuri ha scritto:

> 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/33a7bb8a8b3f80ba02ddd6618eb4e7dc3209

> ec68/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/