Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The language files

You can get the Spanish or the English US English (en_US) files from the VIVO-language and Vitro-language among the vivo-project repositories(https://github.com/vivo-project), to use as a template for your own files.

The example that follow assume that you are creating files for the Estonian language, as spoken in Estonia, with the locale et_EE.

Text strings (.properties)

These files contain about 1500 words and phrases that appear in the VIVO web pages.

These words and phrases have been removed from the page templates, so no programming knowledge is required to translate them.

process simply consist of duplicating each file having the extension en_US inside  VIVO/Vitro -language  repositories and renaming the copy using the locale of the new language. The new file will reside along side (in the same directory) the original one.  

For example, when initializing the languages files for Estonian( et_EE),  copying the file vivo_all_en_US.properties will help creating vivo_allThere is one file for phrases used in Vitro, the core around which VIVO is built, and one file for phrases that are specific to VIVO. In the example, these two files are both called all_et_EE.properties and reside in Vitro and VIVO directories respectively.

Code Block
titleExample file names
[Vitro]/webapp/languages/et_EE/i18n/all_et_EE.properties
[VIVO]/languages/et_EE/themes/wilma/i18n/all_et_EE.properties

The two sample lines below show Estonian language that will be used when a template needs to show text for "minimum_image_dimensions" and for the "cropping caption".  Note that the first example contains place holders {0} and {1} that will be used by Freemarker during run-time to provide height and width values.

Code Block
titleExample content
minimum_image_dimensions = Minimaalne pildi mõõdud: {0} x {1} pikslit 
cropping_caption = Profiilifoto näeb alloleval pildil.

Freemarker Templates (.ftl)

Almost all of the text in the Freemarker templates is supplied by the text strings in the properties files. However, some Freemarker templates are essentially all text, and it seemed simpler to create a translation of the entire template. These include the help and about pages, the Terms of Use page, and the emails that are sent to new VIVO users.

. Both of them will reside in vivo-languages/webapp/src/main/webapp/i18n

In the process of initializing the files for a new language. You will encounter the following types of file:


Text strings (.properties)

These files contain about 1500 words and phrases that appear in the VIVO/Vitro web pages.

These words and phrases have been removed from the page templates, so no programming knowledge is required to translate them.

They appear at different level in the application :

  • in Vitro-languages/webapp/src/main/webapp/i18n
  • in VIVO-languages/webapp/src/main/webapp/i18n
  • in each theme's i18n directory. For instance : 
    • VIVO-languages/webapp/src/main/webapp/themes/tenderfoot/i18n and
    • VIVO-languages/webapp/src/main/webapp/themes/wilma/i18n

The application will look for an entry starting with the activated theme(like tenderfoot or wilma), then VIVO and lastly Vitro.

Freemarker Templates (.ftl)

Almost all of the text in the Freemarker templates is supplied by the text strings in the properties files. However, some Freemarker templates are essentially all text, and it seemed simpler to create a translation of the entire template. These include the help and about pages, the Terms of Use page, and the emails that are sent to new VIVO users.

They are located in:

  • Vitro-languages/webapp/src/main/webapp/templates/freemarker
  • VIVO-languages/webapp/src/main/webapp/templates/freemarker/body
  • VIVO-languages/webapp/src/main/webapp/templates/freemarker/visualization/capabilitymap
  • VIVO-languages/webapp/src/main/webapp/templates/freemarker/visualization/mapOfScience

Here are some examples of templates files to create for Estonian support

Code Block
titleExample file names
Vitro-languages/webapp/src/main/webapp
Code Block
titleExample file names
[Vitro]/webapp/languages/et_EE/templates/freemarker/search-help_et_EE.ftl
[Vitro]-languages/webapp/src/languagesmain/et_EEwebapp/templates/freemarker/termsOfUse_et_EE.ftl
[Vitro]-languages/webapp/languages/et_EEsrc/main/webapp/templates/freemarker/userAccounts-acctCreatedEmail_et_EE.ftl
[Vitro]-languages/webapp/languages/et_EEsrc/main/webapp/templates/freemarker/userAccounts-acctCreatedExternalOnlyEmail_et_EE.ftl
[Vitro]-languages/webapp/languages/et_EEsrc/main/webapp/templates/freemarker/userAccounts-confirmEmailChangedEmail_et_EE.ftl
[Vitro]-languages/webapp/languages/et_EEsrc/main/webapp/templates/freemarker/userAccounts-firstTimeExternalEmail_et_EE.ftl
[Vitro]-languages/webapp/languages/et_EEsrc/main/webapp/templates/freemarker/userAccounts-passwordCreatedEmail_et_EE.ftl
[Vitro]-languages/webapp/src/languagesmain/et_EEwebapp/templates/freemarker/userAccounts-passwordResetCompleteEmail_et_EE.ftl
[Vitro]-languages/webapp/languages/et_EEsrc/main/webapp/templates/freemarker/userAccounts-passwordResetPendingEmail_et_EE.ftl
[VIVO]/languages/et_EEVIVO-languages/webapp/src/main/webapp/templates/freemarker/body/aboutMapOfScience_et_EE.ftl
[VIVO]/languages/et_EEVIVO-languages/webapp/src/main/webapp/templates/freemarker/body/aboutQrCodes_et_EE.ftl
[VIVO]/languages/et_EEVIVO-languages/webapp/src/main/webapp/templates/freemarker/visualization/mapOfScience/mapOfScienceTooltips_et_EE.ftl

...

Code Block
titleTerms of Use (Estonian)
<section id="terms" role="region">
    <h2>kasutustingimused</h2> 
    
    <h3>Hoiatused</h3> 

    <p>
        See ${termsOfUse.siteName} veebisait sisaldab materjali; teksti informatsiooni 
        avaldamine tsitaadid, viited ja pildid ikka teie poolt ${termsOfUse.siteHost} 
        ja erinevate kolmandatele isikutele, nii üksikisikute ja organisatsioonide, 
        äri-ja muidu. Sel määral copyrightable Siin esitatud infot VIVO veebilehel ja 
        äri-ja muidu. Sel määral copyrightable Siin esitatud infot VIVO veebilehel ja 
        kättesaadavaks Resource Description Framework (RDF) andmed alates VIVO at 
        ${termsOfUse.siteHost} on mõeldud avalikuks kasutamiseks ja vaba levitamise 
        tingimuste kohaselt 
        <a href="http://creativecommons.org/licenses/by/3.0/" 
                target="_blank" title="creative commons">
            Creative Commons CC-BY 3.0
        </a> 
        litsentsi, mis võimaldab teil kopeerida, levitada, kuvada ja muuta derivaadid 
        seda teavet teile anda laenu ${termsOfUse.siteHost}.  
    </p>
</section>

RDF data (.n3)

kättesaadavaks Resource Description Framework (RDF) andmed alates VIVO at 
        ${termsOfUse.siteHost} on mõeldud avalikuks kasutamiseks ja vaba levitamise 
        tingimuste kohaselt 
        <a href="http://creativecommons.org/licenses/by/3.0/" 
                target="_blank" title="creative commons">
            Creative Commons CC-BY 3.0
        </a> 
        litsentsi, mis võimaldab teil kopeerida, levitada, kuvada ja muuta derivaadid 
        seda teavet teile anda laenu ${termsOfUse.siteHost}.  
    </p>
</section>

RDF data (.n3, .nt)

Data in the RDF models includes labels for the properties and classes, labels for property groups and class groups, labels for menu pages and more. Here is the list of directories where one will have to create required rdf files:

  • VIVO-languages/home/src/main/resources/rdf/applicationMetadata/everytime
  • VIVO-languages/home/src/main/resources/rdf/display/everytime
  • VIVO-languages/home/src/main/resources/rdf/display/firsttime
  • VIVO-languages/home/src/main/resources/rdf/tbox/everytime

In each case, the delivered file in English has a corresponding file with the same name followed by and underscore and the name of the locale.  See illustrations below:

Code Block
titleFile names (Estonian)
[VIVO]/languages/et_EE/rdf/applicationMetadata/firsttime/classgroups_labels_et_EE.n3
[VIVO]/languages/et_EE/rdf/applicationMetadata/firsttime/propertygroups_labels_et_EE.n3
[VIVO]/languages/et_EE/rdf/display/everytime/PropertyConfig_et_EE.n3
[VIVO]/languages/et_EE/rdf/display/firsttime/aboutPage_et_EE.n3
[VIVO]/languages/et_EE/rdf/display/firsttime/menu_et_EE.n3
[VIVO]/languages/et_EE/rdf/tbox/firsttime/vitroAnnotations_et_EE.n3

In each file, labels specify text to be used by VIVO.  Each label should be translated and affixed with the appropriate locale tagData in the RDF models includes labels for the properties and classes, labels for property groups and class groups, labels for menu pages and more.  In each case, the delivered file in english has a corresponding file with the same name followed by and underscore and the name of the locale.  See below:

Code Block
titleFile names Some classgroups_labels (Estonian)
[VIVO]<http:/languages/et_EE/rdf/applicationMetadata/firsttime/classgroups_labels_et_EE.n3
[VIVO]/languages/et_EE/rdf/applicationMetadata/firsttime/propertygroups_labels_et_EE.n3
[VIVO]/languages/et_EE/rdf/display/everytime/PropertyConfig_et_EE.n3
[VIVO]/languages/et_EE/rdf/display/firsttime/aboutPage_et_EE.n3
[VIVO]/languages/et_EE/rdf/display/firsttime/menu_et_EE.n3
[VIVO]/languages/et_EE/rdf/tbox/firsttime/vitroAnnotations_et_EE.n3

In each file, labels specify text to be used by VIVO.  Each label should be translated and affixed with the appropriate locale tag.  See below:

Code Block
titleSome classgroups_labels (Estonian)
<http://vivoweb.org/ontology#vitroClassGrouppeople> 
    <http://www.w3.org/2000/01/rdf-schema#label> "inimesed"@et-EE .
<http://vivoweb.org/ontology#vitroClassGrouppublications> 
    <http://www.w3.org/2000/01/rdf-schema#label> "teadus"@et-EE .
<http://vivoweb.org/ontology#vitroClassGrouporganizations> 
    <http://www.w3.org/2000/01/rdf-schema#label> "organisatsioonid"@et-EE .
<http://vivoweb.org/ontology#vitroClassGroupactivities> 
    <http://www.w3.org/2000/01/rdf-schema#label> "tegevused"@et-EE .

The selection image (.png, .jpeg, .gif)

/vivoweb.org/ontology#vitroClassGrouppeople> 
    <http://www.w3.org/2000/01/rdf-schema#label> "inimesed"@et-EE .
<http://vivoweb.org/ontology#vitroClassGrouppublications> 
    <http://www.w3.org/2000/01/rdf-schema#label> "teadus"@et-EE .
<http://vivoweb.org/ontology#vitroClassGrouporganizations> 
    <http://www.w3.org/2000/01/rdf-schema#label> "organisatsioonid"@et-EE .
<http://vivoweb.org/ontology#vitroClassGroupactivities> 
    <http://www.w3.org/2000/01/rdf-schema#label> "tegevused"@et-EE .

The selection image (.png, .jpeg, .gif)

If you allow the user to select a preferred language, you must supply an image for the user to click on. Typically, this image is of the flag of the country(or the language) where the language is spoken.

Here are the locations you need to add the flag of the language:

  • Vitro-languages/webapp/src/main/webapp/themes/vitro/i18n/images
  • VIVO-languages/webapp/src/main/webapp/themes/tenderfoot/i18n/images
  • VIVO-languages/webapp/src/main/webapp/themes/wilma/i18n/images

You need to add the image to the themes you will be using. Here the path to the image that will load with wilma:If you allow the user to select a preferred language, you must supply an image for the user to click on. Typically, this image is of the flag of the country where the language is spoken.  Add the image to the theme you will be using.

Code Block
titleSelect Local Image File name (Estonian)
[VIVO]/languages/et_EEVIVO-languages/webapp/src/main/webapp/themes/wilma/i18n/images/select_locale_et_EE.gif

...