Versions Compared

Key

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

...

StepAction

1) Create VIVO home


Code Block
languagebash
sudo -i -u tomcat # for Linux user
mkdir -p $VIVO_HOME
cp -r $TOMCAT_HOME/GIT/vivo-uqam-i18n/vivo-project-i18n-config/vivo_i18n/home/* $VIVO_HOME/home/


2) Edit runtime.properties file

Make sure that attribute properties fit with current installation




Code Block
languagebash
sudo -u tomcat vi $VIVO_HOME/config/runtime.properties


Code Block
languagebash
titleruntime.properties
Vitro.defaultNamespace = http://<your-server-ip-address>:8080/vivo_i18n/individual/
...

rootUser.emailAddress = YOUR_ADRESS
rootUser.passwordChangeRequired = false
rootUser.password = YOUR-PASSWORD
...

vitro.local.solr.url = http://<server-ip-address>:8983/solr/vivocore_i18n
...
RDFService.languageFilter = true
languages.selectableLocales = en_US, de_DE


3) Edit applicationSetup.n3 for TDB data persistence


Code Block
languagetext
titleapplicationSetup.n3
# UNCOMMENT
:tdbContentTripleSource
    a   vitroWebapp:triplesource.impl.tdb.ContentTripleSourceTDB ,
        vitroWebapp:modules.tripleSource.ContentTripleSource ;
    # May be an absolute path, or relative to the Vitro home directory.
    :hasTdbDirectory "tdbContentModels" .

:sparqlContentTripleSource
    a   vitroWebapp:triplesource.impl.sparql.ContentTripleSourceSPARQL ,
        vitroWebapp:modules.tripleSource.ContentTripleSource ;
    # The URI of the SPARQL endpoint for your triple-store.
    :hasEndpointURI "http://localhost:3030/vivo/query" ;
    # The URI to use for SPARQL UPDATE calls against your triple-store. 
    :hasUpdateEndpointURI "http://localhost:3030/vivo/update" .

COMMENT
#:sdbContentTripleSource
#    a   vitroWebapp:triplesource.impl.sdb.ContentTripleSourceSDB ,
#        vitroWebapp:modules.tripleSource.ContentTripleSource .

#REPLACE
:application
    a   vitroWebapp:application.ApplicationImpl ,
        vitroWebapp:modules.Application ;
    :hasSearchEngine              :instrumentedSearchEngineWrapper ;
    :hasSearchIndexer             :basicSearchIndexer ;
    :hasImageProcessor            :iioImageProcessor ;
    :hasFileStorage               :ptiFileStorage ;
    :hasContentTripleSource       :tdbContentTripleSource ;
#    :hasContentTripleSource       :sdbContentTripleSource ;
#    :hasConfigurationTripleSource :tdbConfigurationTripleSource ;
    :hasConfigurationTripleSource :tdbConfigurationTripleSource ;
    :hasTBoxReasonerModule        :jfactTBoxReasonerModule .


4) Edit and configure VIVO installation setting file 


Check that the file contains the following code:


Code Block
languagebash
cd $GIT_REPO/Vivo-installer-i18n
sudo -u tomcat cp example_settings_i18n_linux.xml settings.xml
sudo -u tomcat vi settings.xml


Code Block
languagexml
titlesettings.xml
<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
        <profiles>
                <profile>
                        <id>defaults</id>
                        <properties>
                                <app-name>vivo_i18n</app-name>
                                <vivo-dir>/opt/tomcat/vivo_i18n/home</vivo-dir>
                                <tomcat-dir>/opt/tomcat</tomcat-dir>
                                <default-theme>wilma</default-theme>
                        </properties>
                </profile>
        </profiles>
        <activeProfiles>
                <activeProfile>defaults</activeProfile>
        </activeProfiles>
</settings>


...

StepAction

1) access the sample file

Extract the sample file from GitHub


Code Block
languagebash
git clone https://github.com/vivo-project/sample-data.git  -b branch_name_to_be_coming 


2) build a translated file in the target language

This step consists of copying language files from the directory is in the target language and translating the content into the new language and associating the appropriate linguistic tag to it.


Warning

Notes: Make sure that your file is in UTF-8 format.



Code Block
languagebash
cd $GIT_REPO/sample-data/i18n
cp sample-data-en_US.ttl sample-data-fr_CA.ttl
edit sample-data-fr_CA.ttl

#- sample change

Code Block
languagetext
titleChange from
sample-data:n1246
rdfs:label "ENC 1114 -- Introduction to Rhetoric"@en-US ;
.


Code Block
languagetext
titleChange to
sample-data:n1246
rdfs:label "ENC 1114 -- Intruction à la Rhétorique"@fr-CA ;
.


3) Install the files so that they are processed each time VIVO is started.


Code Block
languagetext
titleChange to
cp sample-data.ttl sample-data-en_US.ttl sample-data-fr_CA.ttl $VIVO_HOME/rdf/abox/filegraph


...

StepAction

1) Create directory structures in Vitro-languages and VIVO-languages

The demonstration is for the integration of the French Canadian fr_CA in Vitro-languages and VIVO-Languages


Code Block
languagebash
titlePreparing Vitro-languages
cd $GIT_REPO/Vitro-languages
mkdircp -pr en_US fr_CA/webapp/src/main/webapp/i18n
cp
mv en_US/webapp/src/main/webapp/i18n/all_en_US.properties fr_CA/webapp/src/main/webapp/i18n/all_fr_CA.properties 


Code Block
languagebash
titlePreparing VIVO-languages
cd $GIT_REPO/VIVO-languages
mkdircp -pr en_US fr_CA/webapp/src/main/webapp/i18n
cp
mv en_US/webapp/src/main/webapp/i18n/vivo_all_en_US.properties fr_CA/webapp/src/main/webapp/i18n/vivo_all_fr_CA.properties 


2) Translate the content of each properties file ('all_en_CA.properties' 'all_en_CA.properties') into the target language (here, the en_CA)


Code Block
titleCanadian French Translation example
save_changes=Sauvegarder
save_entry=Sauvegarder
select_existing=Choisir l'enregistrement existant
select_an_existing=Choisir un enregistrement existant
add_an_entry_to=Ajouter un enregistrement de type 
change_entry_for=Modifier l'enregistrement pour: 
add_new_entry_for=Ajouter un enregistrement pour: 
change_text_for=Changement du texte pour: 
cancel_link = Annuler
cancel_title = annuler
required_fields = champs requis


3) Creating themes

Copy and adapt the themes from en_US to en_CA for  VIVO-Languages

Translate each file of type en_US in the fr_CA/.../themes directory

  • translate the content into the target language
  • rename the file extension xxx_en_US.xxx with the extension of the target language (e.g. xxx_en_CA.xxx)



Code Block
mkdir -p VIVO-languages/fr_CA/webapp/src/main/webapp/themes/
cp -r VIVO-languages/en_US/webapp/src/main/webapp/themes/* VIVO-languages/fr_CA/webapp/src/main/webapp/themes/


4) Creating resources directory and assembly file

  • the 'home.xml' file is necessary to ensure a viable compilation of the language files.
  • Only VIVO-languages contains home.xml file
  • Although is empty, it is necessary to create the directory resources 


Code Block
mkdir -p /VIVO-languages/fr_CA/home/src/main/resources/rdf/i18n/fr_CA
mkdir -p VIVO-languages/fr_CA/home/src/main/assembly/
cp VIVO-languages/en_US/home/src/main/assembly/home.xml VIVO-languages/fr_CA/home/src/main/assembly/


...