VIVO Documentation
Page History
...
If the repository contains files for the language you want, in the VIVO release that you are using, you can just download those files and install them as shown below.
How to install language files
In this step by step guide we will use the German language files as an example. After you installed VIVO like described here, get your desired VIVO-language
and Vitro-language
folders/repositories
(in this example we will use the files found at https://github.com/vivo-DE).
go into each language folder (
VIVO-language
andVitro-language
) and 'install' them with Maven ("mvn install
")next, go into the VIVO project folder and uncomment the section for multiple language support in the two
pom.xml
files listed below:
(search for '<!-- Dependencies for multilingual support -->'
inside of the files)VIVO/installer/home/pom.xml
VIVO/installer/webapp/pom.xml
<version>
in thepom.xml
-files to the same version as in the VIVO-/Vitro-language/pom.xml files.
In this example we had to change<version>[2.0.0,2.1.0)</version>
to<version>2.0.0-SNAPSHOT</version>.
(Note that these should be thehome/pom.xml
andwebapp/pom.xml
in whatever installer project is being used to deploy VIVO.)- after that, we have to build VIVO again, so go into the VIVO project folder and
- "
mvn install -s installer/my-settings.xml
"
- "
- now edit the '
runtime.properties
' file in your VIVO home directory (e.g. '/vivo/home/config/
')- uncomment/add '
RDFService.languageFilter = true
' - uncomment/add '
languages.selectableLocales = en_US, de_DE'
- uncomment/add '
- for the menu to be displayed correctly in German, you have to rename the file '
menu_de_DE.nt
' to'menu_de_DE.n3
'
in the directory/vivo_home_dir/rdf/display/everytime/
(This next step might not be necessary in the future) - restart the tomcat
- you should now be able to select your installed language (in this case German) in the header of your VIVO site
Translating VIVO into your language
...
VIVO would display these values as follows:
User's preferred locale | displayed text |
---|---|
en_UK | colouring |
en_CA | colouring |
es_MX | colorear |
fr_FR | coloring |
Note |
---|
VIVO has limited language support for editing values in the GUI. It is possible to edit language-specific labels for individuals. Language-specific values for other properties must be ingested into VIVO. |
...
The Freemarker framework has anticipated this. When a template is requested, Freemarker will first look for a language-specific version of the template that matches the current locale. So, if the current locale is es_MX
, and a request is made for termsOfUse.ftl
, Freemarker will look for these template files:
Search order for Current locale is |
---|
termsOfUse_es_MX.ftl |
termsOfUse_es.ftl |
termsOfUse.ftl |
Language in Java code
Java code has access to the same language properties that Freemarker accesses. Here is an example of using a language-specific string in Java code:
...