Versions Compared

Key

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

...

  • Go into the VIVO project folder and uncomment the section for multiple language support (search for '<!-- Dependencies for multilingual support -->' and '<!-- Overlays for multilingual support -->' inside of the files)  in each of the two pom.xml files listed below:

    • Vitro/installer/webapp/pom.xml (Uncomment dependencies and overlays)
    • VIVO/installer/home/pom.xml (Uncomment dependencies)
    • VIVO/installer/webapp/pom.xml(Uncomment dependencies and overlays)
    Change the <version> in the two pom.xml files to the same version as in the 'VIVO-language/pom.xml' and 'Vitro-language/pom.xml' file respectively.  You may need to change the version in multiple places in the files.
  • Build VIVO from the VIVO project folder using mvn install -s installer/my-settings.xml
  • Edit the vivo_home_dir/config/runtime.properties file in your VIVO home directory:
    • uncomment/add RDFService.languageFilter = true
    • uncomment/add languages.selectableLocales = en_US, de_DE
  • Restart the tomcat
  • You should now be able to select your installed language (in this case German) in the header of your VIVO site

...

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)

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_all_et_EE.properties. 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 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.

There 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.

...

titleExample file names

...

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

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.

Code Block
titleExample file names
[Vitro]-languages/webapp/languages/et_EEsrc/main/webapp/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/languagessrc/et_EEmain/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 
        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)

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

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.  In each case, the delivered file in english 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)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/applicationMetadatadisplay/firsttime/classgroupsaboutPage_labels_et_EE.n3
[VIVO]/languages/et_EE/rdf/applicationMetadatadisplay/firsttime/propertygroupsmenu_labels_et_EE.n3
[VIVO]/languages/et_EE/rdf/displaytbox/everytimefirsttime/PropertyConfigvitroAnnotations_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:

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 .
Code Block
titleSome classgroups_labels (Estonian)
<http://vivoweb.org/ontology#vitroClassGrouppeople>ontology#vitroClassGrouporganizations> 
    <http://www.w3.org/2000/01/rdf-schema#label> "inimesedorganisatsioonid"@et-EE .
<http://vivoweb.org/ontology#vitroClassGrouppublications>ontology#vitroClassGroupactivities> 
    <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)

-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

...

  • webapp/themes/frodo/i18n/all.properties
  • webapp/i18n/all.properties

If you specify a complex more than one locale for VIVO, this search pattern becomes longer. For example, if your user has chosen Canadian French as his language/country combination, then these files (if they exist) will be searched for text strings:

...