Archetype internationalisation

Donate to this project

Development Project Status: Under Discussion

Due date for completion of this stage: 
02/07/2013

Archetypes are currently hardcoded to use English names, and Australian conventions (e.g. using metric weights).

To support wider deployment of OpenVPMS and simpler upgrade paths for international users, archetypes need to be internationalised. This will involve replacing hard-coded display names and text with variables.

These variables will be replaced with values obtained from resource bundles for the current locale, when the archetypes are loaded, either via the archload scripts, or via Import in the Administration workspace.

E.g. given:

     <archetype name="party.patientpet.1.0" latest="true" type="org.openvpms.component.business.domain.im.party.Party"
               displayName="Patient(Pet)">
        <node name="id" path="/id" type="java.lang.Long" readOnly="true"/>
        <node name="name" path="/name" type="java.lang.String" minCardinality="1">
            <assertion name="propercase"/>
        </node>
        <node name="description" type="java.lang.String" path="/description" hidden="true" derived="true"
              derivedValue="concat(openvpms:lookup(.,'sex'), ' ', /details/colour, ' ', openvpms:lookup(.,'breed'), '(',party:identities(),')')"/>
        <node name="species" path="/details/species" type="java.lang.String" minCardinality="1" maxLength="15">
            <assertion name="lookup">
                <property name="type" value="lookup"/>
                <property name="source" value="lookup.species"/>
            </assertion>
        </node>

becomes:

    <archetype name="party.patientpet.1.0" latest="true"
               type="org.openvpms.component.business.domain.im.party.Party"
               displayName="${patientpet.displayName}">
        <node name="id" displayName="${id}" path="/id" type="java.lang.Long" readOnly="true"/>
        <node name="name" displayName="${name}" path="/name" type="java.lang.String" minCardinality="1">
            <assertion name="propercase"/>
        </node>
        <node name="description" displayName="${description}" type="java.lang.String"path="/description" hidden="true" derived="true"
              derivedValue="concat(openvpms:lookup(.,'sex'), ' ', /details/colour, ' ', openvpms:lookup(.,'breed'), '(',party:identities(),')')"/>
        <node name="species" displayName="${species}" path="/details/species" type="java.lang.String"
              minCardinality="1" maxLength="15">
            <assertion name="lookup">
                <property name="type" value="lookup"/>
                <property name="source" value="lookup.species"/>
            </assertion>
        </node>

A default resource bundle will be provided containing English display names E.g.

 patientpet.displayName = Patient (Pet)
id          = Id
name        = Name
description = Description
species     = Species

This can be copied and modified for the current locale. It is hoped that users will contribute their archetype resource bundles back to the project.

Syndicate content