keeps / roda

RODA - Repository of Authentic Digital Objects
https://www.roda-community.org/
GNU Lesser General Public License v3.0
75 stars 48 forks source link

Template field list separate options and translation logic #534

Closed luis100 closed 8 years ago

luis100 commented 8 years ago

For template fields of type list, have the arguments:

sleroux-keep commented 8 years ago

The "labels" and "labelI18nKeyPrefix" must be renamed to "optionsLabels" and "optionsLabelI18NKeyPrefix" to avoid confusion with the label of the field.

sleroux-keep commented 8 years ago

Updated @ 4798e72551e62c8aabce30a14bb4d65cd42edf9f

NOTE: Templates used in implementations needs to be updated!

Example of field:

{{~field 
name="statusDescription"
order="470" 
type="list" 
value="final"
options="[\"final\",\"revised\",\"draft\"]"
optionsLabels="{\"final\": {\"en\":\"Final\", \"pt_PT\":\"Final\"},\"revised\": {\"en\":\"Revised\", \"pt_PT\":\"Verificado\"},\"draft\": {\"en\":\"Draft\", \"pt_PT\":\"Rascunho\"}}"
optionsLabelI18nKeyPrefix="crosswalks.dissemination.html.ead.statusDescription" 
label="{\"en\": \"Status description\", \"pt_PT\": \"Estado da descrição\"}" 
xpath="/*:ead/*:archdesc/*:odd[@type='statusDescription']/*:p/string()"
~}}
luis100 commented 8 years ago

checked