Versions Compared

Key

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

...

Languages can be selected in a variety of ways, depending on the installation parameters:

  • A VIVO installer administrator can configure VIVO to use one of the supported languages.
  • Different users may see different languages, depending on the settings in their web browser.
  • Different users may select a language from a list of available languages.

VIVO language files are available for English (U.S. and Canadian), Spanish, Brazilian Portuguese, French (Canadian) and German. If you need support for another language, please inquire of the VIVO mailing lists, to see if another group has the files you need.

...

  • 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

For more details, see How to Enable Languages in VIVO as an Administrator.

Building VIVO and Vitro language repositories from source (for developers)

  • Clone the VIVO-languages and Vitro-languages repositories to your local machine.
  • Ensure the <version> in the pom.xml files for VIVO and Vitro-languages matches the <version> of VIVO you are building against.  You may need to change the version in multiple places in the files.
  • Go into each language folder (VIVO-language and Vitro-language) and install them with Maven using mvn install
  • Build VIVO from the VIVO project folder using mvn install -o -s installer/my-settings.xml (Note the -o flag, this forces maven Maven to use the language projects from your local repository instead of downloading from a remote repository)  
  • 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

...

Your locale is an internationally recognized code that specifies the language you choose, and the region where it is spoken. For example, the locale string fr_CA is used for French as spoken in Canada, and es_MX is used for Spanish as spoken in Mexico. Recognized codes for languages and regions can be found by a simple Google search. Here is a list of locales that are recognized by the Java programming language. You may also use this definitive list of languages and regions, maintained by the Internet Assigned Numbers Authority.

...

You can get the 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 process simply consist consists 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 files will reside along side ( in the same a directory ) the original one.  named after the new locale.

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 The new file will reside in vivo-languages/et_EE/webapp/src/main/webapp/i18n

...

  • 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/en_US/webapp/src/main/webapp/themes/tenderfoot/i18n and
    • VIVO-languages/en_US/webapp/src/main/webapp/themes/wilma/i18n

...

They are located in:

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

...

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

...

RDF data (.n3, .nt)

Data in the RDF models includes include 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/<locale>/home/src/main/resources/rdf/i18n/<locale>/applicationMetadata/everytime
  • VIVO-languages/<locale>/home/src/main/resources/rdf/i18n/<locale>/display/everytime
  • VIVO-languages/<locale>/home/src/main/resources/rdf/i18n/<locale>/display/firsttime
  • VIVO-languages/<locale>/home/src/main/resources/rdf/i18n/<locale>/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/firsttimei18n/et_EE/applicationMetadata/firsttime/classgroups_labels_et_EE.n3
[VIVO]/languages/et_EE/rdf/i18n/et_EE/applicationMetadata/firsttime/propertygroups_labels_et_EE.n3
[VIVO]/languages/et_EE/rdf/i18n/et_EE/display/everytime/PropertyConfig_et_EE.n3
[VIVO]/languages/et_EE/rdf/i18n/et_EE/display/firsttime/aboutPage_et_EE.n3
[VIVO]/languages/et_EE/rdf/i18n/et_EE/display/firsttime/menu_et_EE.n3
[VIVO]/languages/et_EE/rdf/i18n/et_EE/tbox/firsttime/vitroAnnotations_et_EE.n3

...

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)

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:

Code Block
titleSelect Local Image File name (Estonian)
VIVO-languages/webapp/src/main/webapp/themes/wilma/i18n/images/select_locale_et_EE.gif
Panel
titleImage for locale selection (Estonian)
Image Removed

How VIVO supports languages

...