Versions Compared

Key

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

...

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 
mv fr_CA/webapp/src/main/webapp/themes/wilma/i18n/all_en_US.properties fr_CA/webapp/src/main/webapp/themes/wilma/i18n/all_fr_CA.properties
mv fr_CA/webapp/src/main/webapp/themes/tenderfoot/i18n/all_en_US.properties fr_CA/webapp/src/main/webapp/themes/tenderfoot/i18n/all_fr_CA.properties


2) Translate the content of each properties file 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>

 

 

<groupId>org.vivoweb</groupId>


 

 

<artifactId>vivo-languages-webapp-fr_CA</artifactId>


 

 

<version>1.11.2-SNAPSHOT</version>


 

 

<packaging>war</packaging>

 

 

<parent>


 

 

 

 

<groupId>org.vivoweb</groupId>


 

 

 

 

<artifactId>vivo-languages-fr_CA</artifactId>


 

 

 

 

<version>1.11.2-SNAPSHOT</version>


 

 

 

 

<relativePath>..</relativePath>


 

 

</parent>

 

 

<name>VIVO

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>


...


<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>vivo-languages-fr_CA</artifactId>     <version>1.11.2-SNAPSHOT</version>     <packaging>pom</packaging>     <name>VIVO Languages fr_CA</name>     <description>VIVO Languages</description>     <url>http://vivoweb.org/</url>     <parent>         <groupId>org.vivoweb</groupId>         <artifactId>vivo-languages</artifactId>         <version>1.11.2-SNAPSHOT</version>         <relativePath>..</relativePath>     </parent>     <licenses>         <license>             <name>BSD 3-Clause License</name>             <url>https://raw.github.com/vivo-project/VIVO/develop/LICENSE</url>             <distribution>repo</distribution>         </license>     </licenses>     <scm>         <connection>scm:git:git@github.com:vivo-project/VIVO-languages.git</connection>         <developerConnection>scm:git:git@github.com:vivo-project/VIVO-languages.git</developerConnection>         <url>git@github.com:vivo-project/VIVO-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>     <modules>         <module>home</module>         <module>webapp</module>     </modules>     <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.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>                     <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>     </distributionManagement> </project>


StepAction

Edit and modify ./core/home/pom.xml

Add the dependency (in bold) in the POM file

. . .
<dependency>
    <groupId>org.vivoweb</groupId>
    <artifactId>vivo-languages-home-es</artifactId>
    <version>${project.version}</version>
    <type>tar.gz</type>
</dependency>
<dependency>
    <groupId>org.vivoweb</groupId>
    <artifactId>vivo-languages-home-fr_CA</artifactId>
    <version>${project.version}</version>
    <type>tar.gz</type>
</dependency>
<dependency>
    <groupId>org.vivoweb</groupId>
    <artifactId>vivo-languages-home-pt_BR</artifactId>

Edit and modify ./core/webapp/pom.xml

Add the dependency (in bold) in the POM file

. . .
<dependency>
    <groupId>org.vivoweb</groupId>
    <artifactId>vivo-languages-webapp-es</artifactId>
    <version>${project.version}</version>
    <type>war</type>
</dependency>
<dependency>
    <groupId>org.vivoweb</groupId>
    <artifactId>vivo-languages-webapp-fr_CA</artifactId>
    <version>${project.version}</version>
    <type>war</type>
</dependency>
<dependency>
    <groupId>org.vivoweb</groupId>
    <artifactId>vivo-languages-webapp-pt_BR</artifactId>

Edit and modify ./fr_CA/home/pom.xml

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

...
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.vivoweb</groupId>
    <artifactId>vivo-languages-home-fr_CA</artifactId>
    <version>1.11.2-SNAPSHOT</version>
    <packaging>pom</packaging>

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

    <name>VIVO Languages for Home fr_CA</name>

...

Adding Edit and modify ./fr_CA/webapp/pom.xml

Pay particular attention to the version number which must correspond to the version currently under development. (Line 7 and 13).

...

   

Code Block
languagexml
linenumberstrue
collapsetrue

Edit and modify ./fr_CA/pom.xml

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

...

    <modelVersion>4.0.0</modelVersion>

    <groupId>org.vivoweb</groupId>
    <artifactId>vivo-languages-fr_CA</artifactId>
    <version>1.11.2-SNAPSHOT</version>
    <packaging>pom</packaging>
    <parent>
        <groupId>org.vivoweb</groupId>
        <artifactId>vivo-languages</artifactId>
        <version>1.11.2-SNAPSHOT</version>
        <relativePath>..</relativePath>
    </parent>
    <name>VIVO Languages fr_CA</name>
    <description>VIVO Languages for fr_CA</description>
    <url>http://vivoweb.org/</url>
...

Editing ./pom.xml

Add the following lines

Code Block
languagexml
linenumberstrue
collapsetrue

Editing ./pom.xml

Add the following line which is in bold

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

1-2-3 Steps to carry out from the

...

VIVO-installer

...

directory

StepAction

Editing ./home/pom.xml

Add the dependency (in bold) in the POM file

. . .
<modules>
    <module>../../Vitro/home</module>
    <module>../../VIVO/home</module>
    <module>../../VIVO-languages/core/home</module>
    <module>../../VIVO-languages/en_US/home</module>
    <module>../../VIVO-languages/en_CA/home</module>
    <module>../../VIVO-languages/de_DE/home</module>
    <module>../../VIVO-languages/es/home</module>
    <module>../../VIVO-languages/pt_BR/home</module>
    <module>../../VIVO-languages/fr_CA/home</module>
</modules>
. . .

Editing ./webapp/pom.xml

Add the dependency (in bold) in the POM file

. . .

<dependency>
    <groupId>org.vivoweb</groupId>
    <artifactId>vivo-languages-webapp-en_CA</artifactId>
    <version>1.11.2-SNAPSHOT</version>
    <type>war</type>
</dependency>
<dependency>
    <groupId>org.vivoweb</groupId>
    <artifactId>vitro-languages-webapp-fr_CA</artifactId>
    <version>1.11.2-SNAPSHOT</version>
    <type>war</type>
</dependency>
<dependency>
    <groupId>org.vivoweb</groupId>
    <artifactId>vivo-languages-webapp-fr_CA</artifactId>
    <version>1.11.2-SNAPSHOT</version>
    <type>war</type>
</dependency>
<dependency>
. . .

Editing ./webapp_dep/pom.xml

Add the dependency (in bold) in the POM file

. . .
<modules>
    <module>../../Vitro/api</module>
    <module>../../Vitro/dependencies</module>
    <module>../../Vitro/webapp</module>
    <module>../../Vitro-languages/core/webapp</module>
    <module>../../Vitro-languages/fr_CA/webapp</module>
    <module>../../Vitro-languages/en_US/webapp</module>
    <module>../../Vitro-languages/en_CA/webapp</module>
    <module>../../Vitro-languages/de_DE/webapp</module>
    <module>../../Vitro-languages/es/webapp</module>
    <module>../../Vitro-languages/pt_BR/webapp</module>
    <module>../../VIVO/api</module>
    <module>../../VIVO/webapp</module>
    <module>../../VIVO-languages/core/webapp</module>
    <module>../../VIVO-languages/fr_CA/webapp</module>
    <module>../../VIVO-languages/en_US/webapp</module>
    <module>../../VIVO-languages/en_CA/webapp</module>
    <module>../../VIVO-languages/de_DE/webapp</module>
    <module>../../VIVO-languages/es/webapp</module>
    <module>../../VIVO-languages/pt_BR/webapp</module>
</modules>
. . .

...


Action

start compiling

Before starting the compilation make sure you have correctly configured the settings_i18n_linux.xml file as described above. The -DskipTests option is optional.


Info

Make sure that the war file is installed in the appropriate tomcat directory.


Observe lines 9, 21 and 30 which indicate that the new language is included in the installation process.


Code Block
languagebash
titleCommand
cd $GIT_HOMEREPO/VivoVIVO-installer-i18n
mvn -s settings_i18n_linux.xml -DskipTests=true clean install 

At the end you should see a compilation end looking like this:


Code Block
languagebash
titleResult
linenumberstrue
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for VIVO Installer for i18n 1.11.2-SNAPSHOT:
[INFO] 
[INFO] Vitro Home ......................................... SUCCESS [ 3.782 s]
[INFO] VIVO Home .......................................... SUCCESS [ 1.523 s]
[INFO] VIVO Languages for Home en_US ...................... SUCCESS [ 0.345 s]
[INFO] VIVO Languages for Home de_DE ...................... SUCCESS [ 0.042 s]
[INFO] VIVO Languages for Home es ......................... SUCCESS [ 0.025 s]
[INFO] VIVO Languages for Home fr_CA ...................... SUCCESS [ 0.020 s]
[INFO] VIVO Languages for Home pt_BR ...................... SUCCESS [ 0.025 s]
[INFO] VIVO Languages for Home en_CA ...................... SUCCESS [ 0.023 s]
[INFO] VIVO Languages for Home CORE ....................... SUCCESS [ 0.116 s]
[INFO] VIVO Installer for i18n ............................ SUCCESS [ 0.185 s]
[INFO] Vitro Install Home for i18n ........................ SUCCESS [ 1.921 s]
[INFO] Vitro Dependencies ................................. SUCCESS [ 0.553 s]
[INFO] Vitro API .......................................... SUCCESS [ 47.060 s]
[INFO] Vitro Web App ...................................... SUCCESS [ 1.268 s]
[INFO] Vitro Languages for Web App en_US .................. SUCCESS [ 0.369 s]
[INFO] Vitro Languages for Web App de_DE .................. SUCCESS [ 0.055 s]
[INFO] Vitro Languages for Web App es ..................... SUCCESS [ 0.055 s]
[INFO] Vitro Languages for Web App fr_CA .................. SUCCESS [ 0.040 s]
[INFO] Vitro Languages for Web App pt_BR .................. SUCCESS [ 0.048 s]
[INFO] Vitro Languages for Web App en_CA .................. SUCCESS [ 0.053 s]
[INFO] Vitro Languages for Web App CORE ................... SUCCESS [ 0.136 s]
[INFO] VIVO API ........................................... SUCCESS [ 16.578 s]
[INFO] VIVO Web App ....................................... SUCCESS [ 1.399 s]
[INFO] VIVO Languages for Web App en_US ................... SUCCESS [ 0.034 s]
[INFO] VIVO Languages for Web App de_DE ................... SUCCESS [ 0.058 s]
[INFO] VIVO Languages for Web App es ...................... SUCCESS [ 0.046 s]
[INFO] VIVO Languages for Web App fr_CA ................... SUCCESS [ 0.034 s]
[INFO] VIVO Languages for Web App pt_BR ................... SUCCESS [ 0.043 s]
[INFO] VIVO Languages for Web App en_CA ................... SUCCESS [ 0.038 s]
[INFO] VIVO Languages for Web App CORE .................... SUCCESS [ 0.096 s]
[INFO] VIVO WebApp Install dependencies for i18n .......... SUCCESS [ 0.004 s]
[INFO] VIVO Install Web App for i18n ...................... SUCCESS [ 4.458 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:21 min
[INFO] Finished at: 2020-10-30T06:44:16-07:00
[INFO] ------------------------------------------------------------------------


...