Versions Compared

Key

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

...

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   


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.


Info

This procedure is for explanatory purposes, it is not to be carried out for fr_CA since the file sample-data-fr_CA.ttl already exists in the repo.



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) Start TOMCAT

After making the appropriate configurations move to the TOMCAT executables directory and launch the application.


Code Block
languagebash
cd $TOMCAT_HOME/bin
./start.sh


2) Monitoring the execution

after running the "taill -f" command you can do ^C to stop the Monitoring 


Code Block
languagebash
cd $TOMCAT_HOME/log
tail - f 


.createCacheHeaders=true, languages.selectableLocales=en_US, de_DE, orcid.api=sandbox, orcid.apiVersion=2.0, orcid.clientId=APP-MWPTQ7Z850AY2GCH, orcid.clientPassword=5eeb8f1e-05fd-4aa3-af3f-3bf12911f683, orcid.externalIdCommonName=Universit� du Qu�bec � Montr�al, orcid.webappBaseUrl=http://locahost:8080/vivo/, proxy.eligibleTypeList=http://xmlns.com/foaf/0.1/Person, http://xmlns.com/foaf/0.1/Organization, rootUser.emailAddress=vivo@uqam.ca, rootUser.password=Vivo2435...., rootUser.passwordChangeRequired=false, rp.multiple=config, selfEditing.idMatchingProperty=http://localhost:8080/ns#networkId, , vitro.local.solr.url=http://localhost:8983/solr/vivocore_i18n}]
2020-09-23 15:32:27,278 INFO [RevisionInfoBean] Revision info [build date: 20-09-23 22 h 18, level info: [[VIVO, 1.11.2-SNAPSHOT, d3e9606]]]
2020-09-23 15:32:27,321 WARN [StartupStatus] From FreemarkerEmailFactory$Setup: Invalid SMTP host: 'smtp.mydomain.edu': host name is not recognized - Email functions are disabled.
2020-09-23 15:32:27,383 INFO [RDFFilesLoader] Loading rdf/display/everytime/dataGetterLabels.n3
2020-09-23 15:32:27,384 INFO [RDFFilesLoader] Loading rdf/display/everytime/displayModelListViews.rdf
2020-09-23 15:32:27,386 INFO [RDFFilesLoader] Loading rdf/display/everytime/homePageDataGetters.n3
2020-09-23 15:32:27,388 INFO [RDFFilesLoader] Loading rdf/display/everytime/localeSelectionGUI.n3
2020-09-23 15:32:27,389 INFO [RDFFilesLoader] Loading rdf/display/everytime/n3ModelChangePreprocessors.n3
2020-09-23 15:32:27,390 INFO [RDFFilesLoader] Loading rdf/display/everytime/orcidInterfaceDataGetters.n3
2020-09-23 15:32:27,392 INFO [RDFFilesLoader] Loading rdf/display/everytime/pageList.n3
2020-09-23 15:32:27,393 INFO [RDFFilesLoader] Loading rdf/display/everytime/permissions.n3
2020-09-23 15:32:27,399 INFO [RDFFilesLoader] Loading rdf/display/everytime/searchIndexerConfigurationVitro.n3
2020-09-23 15:32:27,404 INFO [RDFFilesLoader] Loading rdf/display/everytime/searchIndexerConfigurationVivo.n3
2020-09-23 15:32:27,410 INFO [RDFFilesLoader] Loading rdf/display/everytime/vitroSearchProhibited.n3
2020-09-23 15:32:27,411 INFO [RDFFilesLoader] Loading rdf/display/everytime/vivoConceptDataGetters.n3
2020-09-23 15:32:27,414 INFO [RDFFilesLoader] Loading rdf/display/everytime/vivoListViewConfig.rdf
2020-09-23 15:32:27,426 INFO [RDFFilesLoader] Loading rdf/display/everytime/vivoOrganizationDataGetters.n3
2020-09-23 15:32:27,431 INFO [RDFFilesLoader] Loading rdf/display/everytime/vivoQrCodeDataGetter.n3
2020-09-23 15:32:27,434 INFO [RDFFilesLoader] Loading rdf/display/everytime/vivoSearchProhibited.n3
2020-09-23 15:32:27,440 INFO [RDFFilesLoader] Loading rdf/displayTbox/everytime/displayTBOX.n3
2020-09-23 15:32:27,450 INFO [RDFFilesLoader] Loading rdf/displayDisplay/everytime/displayDisplay.n3
2020-09-23 15:32:27,453 INFO [RDFFilesLoader] Loading rdf/auth/everytime/permission_config.n3
2020-09-23 15:32:27,464 INFO [RDFFilesLoader] Loading rdf/tbox/everytime/initialTBoxAnnotations_de_DE.nt
2020-09-23 15:32:27,490 INFO [RDFFilesLoader] Loading rdf/tbox/everytime/initialTBoxAnnotations_en_US.nt
2020-09-23 15:32:28,738 INFO [FileGraphSetup] Read 12 abox file graphs
2020-09-23 15:32:29,173 INFO [FileGraphSetup] Read 6 tbox file graphs


3) Observing the execution

After logging in to VIVO and passing the smocktest you should see a presentation similar to this one. If you don't observe people in the faculties make sure that the example files are copied to the right place as indicated above or that Solr has been started

.

...

4-1 Property, theme and other generic files

several Several directory structures and files need to be set up to initialize the implementation of the linguistic context in VIVO. 

The intention of this step is to produce the new structure (fr_CA) by copying an existing structure (en_US) and to make the necessary modifications to the elements of the new structure in order to finalize the new language insertion. 

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
cp -r en_US fr_CA
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
cp -r en_US fr_CA
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/


...

<project xmlns="http://maven

.

apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">     <modelVersion>4.0.0</modelVersion>     <parent>         <groupId>org.vivoweb</groupId>         <artifactId>vitro-languages</artifactId>         <version>1.11.2-SNAPSHOT</version>     </parent>     <groupId>org.vivoweb</groupId>     <artifactId>vitro-languages-fr_CA</artifactId>     <version>1.11.2-SNAPSHOT</version>     <packaging>pom</packaging>     <name>Vitro Languages fr_CA</name>     <description>Vitro Languages</description>     <url>http://vivoweb.org/</url>     <licenses>         <license>             <name>BSD 3-Clause License</name>             <url>https://raw.github.com/vivo-project/VIVO/develop/LICENSE</url>             <distribution>repo</distribution>         </license>     </licenses>     <!-- The SCM repository location is used by Continuum to update against          when changes have occurred. This spawns a new build cycle and releases snapshots          into the snapshot repository below. -->     <scm>         <connection>scm:git:git@github.com:vivo-project/Vitro-languages.git</connection>         <developerConnection>scm:git:git@github.com:vivo-project/Vitro-languages.git</developerConnection>         <url>git@github.com:vivo-project/Vitro-languages.git</url>         <tag>HEAD</tag>     </scm>     <properties>         <vitro-version>${project.version}</vitro-version>         <vivo-dir>${basedir}</vivo-dir>         <maven.build.timestamp.format>yyyy-MM-dd HH:mm:ss</maven.build.timestamp.format>         <build.timestamp>${maven.build.timestamp}</build.timestamp>         <maven-site-plugin.skip>false</maven-site-plugin.skip>         <stagingBase>/</stagingBase>         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>     </properties>     <profiles>         <profile>             <id>release-sign-artifacts</id>             <activation>                 <property>                     <name>performRelease</name>                     <value>true</value>                 </property>             </activation>             <build>                 <plugins>                     <plugin>                         <groupId>org.apache.maven.plugins</groupId>                         <artifactId>maven-source-plugin</artifactId>                         <executions>                             <execution>                                 <id>attach-sources</id>                                 <goals>                                     <goal>jar-no-fork</goal>                                 </goals>                             </execution>                         </executions>                     </plugin>                     <plugin>                         <groupId>org.sonatype.plugins</groupId>                         <artifactId>nexus-staging-maven-plugin</artifactId>                         <extensions>true</extensions>                         <configuration>                             <serverId>ossrh</serverId>                             <nexusUrl>https://oss.sonatype.org/</nexusUrl>                             <autoReleaseAfterClose>true</autoReleaseAfterClose>                         </configuration>                     </plugin>                     <plugin>                         <groupId>org.codehaus.mojo</groupId>                         <artifactId>buildnumber-maven-plugin</artifactId>                         <executions>                             <execution>                                 <phase>validate</phase>                                 <goals>                                     <goal>create</goal>                                 </goals>                             </execution>                         </executions>                         <configuration>                             <doCheck>false</doCheck>                             <doUpdate>false</doUpdate>                             <shortRevisionLength>7</shortRevisionLength>                             <revisionOnScmFailure>Detached</revisionOnScmFailure>                         </configuration>                     </plugin>                     <plugin>                         <groupId>org.apache.maven.plugins</groupId>                         <artifactId>maven-gpg-plugin</artifactId>                         <executions>                             <execution>                                 <id>sign-artifacts</id>                                 <phase>verify</phase>                                 <goals>                                     <goal>sign</goal>                                 </goals>                             </execution>                         </executions>                     </plugin>                 </plugins>             </build>         </profile>     </profiles>     <build>         <pluginManagement>             <plugins>                 <plugin>                     <artifactId>maven-assembly-plugin</artifactId>                     <version>3.1.1</version>                 </plugin>                 <plugin>                     <artifactId>maven-clean-plugin</artifactId>                     <version>3.1.0</version>                 </plugin>                 <plugin>                     <groupId>org.apache.maven.plugins</groupId>                     <artifactId>maven-jar-plugin</artifactId>                     <version>3.1.2</version>                 </plugin>                 <plugin>                     <groupId>org.apache.maven.plugins</groupId>                     <artifactId>maven-gpg-plugin</artifactId>                     <version>1.6</version>                 </plugin>                 <plugin>                     <groupId>org.apache.maven.plugins</groupId>                     <artifactId>maven-source-plugin</artifactId>                     <version>3.1.0</version>                 </plugin>                 <plugin>                     <groupId>org.apache.maven.plugins</groupId>                     <artifactId>maven-war-plugin</artifactId>                     <version>3.2.3</version>                 </plugin>                 <plugin>                     <groupId>org.codehaus.mojo</groupId>                     <artifactId>build-helper-maven-plugin</artifactId>                     <version>3.0.0</version>                 </plugin>                 <plugin>                     <groupId>org.codehaus.mojo</groupId>                     <artifactId>buildnumber-maven-plugin</artifactId>                     <version>1.4</version>                 </plugin>                 <plugin>                     <groupId>org.sonatype.plugins</groupId>                     <artifactId>nexus-staging-maven-plugin</artifactId>                     <version>1.6.8</version>                 </plugin>             </plugins>         </pluginManagement>     </build>     <distributionManagement>         <site>             <id>vivo-project</id>             <url>https://vivo-project.github.io/</url>         </site>         <snapshotRepository>             <id>ossrh</id>             <url>https://oss.sonatype.org/content/repositories/snapshots</url>         </snapshotRepository>         <repository>             <id>ossrh</id>             <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>         </repository>     </distributionManagement>     <modules>         <module>webapp</module>     </modules> </project>

StepAction

Editing ./core/pom.xml

Add lines 6 to 11 in the <depedencies> section of in the POM file


Code Block
languagexml
themeConfluence
linenumberstrue
...
    <artifactId>vitro-languages-webapp-es</artifactId>
    <version>${project.version}</version>
    <type>war</type>
</dependency>
<dependency>
    <groupId>org.vivoweb</groupId>
    <artifactId>vitro-languages-webapp-fr_CA</artifactId>
    <version>${project.version}</version>
    <type>war</type>
</dependency>
<dependency>
    <groupId>org...


Create the following pom file:

./fr_CA/web_app/pom.xml

Pay particular attention to the version number which must correspond to the version currently under development.

Code Block
languagexml
linenumberstrue
collapsetrue



Create the following pom file:

./fr_CA/web_app/src/pom.xml


Pay particular attention to the version number which must correspond to the version currently under development.


Code Block
languagexml
linenumberstrue
collapsetrue
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <groupId>org.vivoweb</groupId>
    <artifactId>vitro-languages-webapp-fr_CA</artifactId>
    <version>1.11.2-SNAPSHOT</version>
    <packaging>war</packaging>

    <parent>
        <groupId>org.vivoweb</groupId>
        <artifactId>vitro-languages-fr_CA</artifactId>
        <version>1.11.2-SNAPSHOT</version>
        <relativePath>..</relativePath>
    </parent>

    <name>Vitro Languages for Web App fr_CA</name>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                    <packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes>
                    <archiveClasses>false</archiveClasses>
                    <archive>
                        <manifest>
                            <addClasspath>true</addClasspath>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-clean-plugin</artifactId>
                <configuration>
                    <filesets>
                        <fileset>
                            <directory>overlays</directory>
                        </fileset>
                    </filesets>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>


Editing ./pom.xml

Add the following line which is in bold

...

</distributionManagement>
<modules>
    <module>core</module>
    <module>en_CA</module>
    <module>en_US</module>
    <module>es</module>
    <module>fr_CA</module>
    <module>pt_BR</module>
    <module>de_DE</module>
</modules>
</project>

...