[Git][ultreiaio/ird-t3][develop] 2 commits: Revoir les traductions (Closes #172)
Tony CHEMIT pushed to branch develop at ultreiaio / ird-t3 Commits: 943042a8 by Tony CHEMIT at 2018-03-14T09:21:59Z Revoir les traductions (Closes #172) - - - - - 4898d47c by Tony CHEMIT at 2018-03-14T09:22:01Z [N0.2][LOG] Petite bizarerie dans les logs (closes #239) - - - - - 10 changed files: - src/site/markdown/installer.md.vm - + src/site/markdown/translate.md - src/site/site.xml - t3-actions/src/main/java/fr/ird/t3/actions/data/level0/ComputeRF2Action.java - t3-installer/pom.xml - t3-installer/src/main/assembly/dist/README.md - + t3-installer/src/main/assembly/dist/translate.bat - + t3-installer/src/main/assembly/dist/translate.sh - t3-installer/src/main/config/T3Installer.ini - + t3-installer/src/main/java/fr/ird/t3/console/T3I18nTool.java Changes: ===================================== src/site/markdown/installer.md.vm ===================================== --- a/src/site/markdown/installer.md.vm +++ b/src/site/markdown/installer.md.vm @@ -30,6 +30,8 @@ Après téléchargement, on dézippe l'archive et on obtient l'arborescence suiv ├── fill-db.bat (1) ├── fill-db.sh (1) ├── db.properties (2) + ├── translate.sh + ├── translate.bat ├── README.md ├── scripts (3) │ ├── ddl @@ -61,7 +63,7 @@ url=jdbc:postgresql:%s # Créer une nouvelle base -Sous Linux +Sous Linux, Mac ``` sh create-db.sh dbName ``` @@ -75,7 +77,7 @@ Sous windows **Il faut que la base soit créée et que l'extension postgis soit installée**. -Sous Linux +Sous Linux, Mac ``` sh fill-db.sh dbName ``` ===================================== src/site/markdown/translate.md ===================================== --- /dev/null +++ b/src/site/markdown/translate.md @@ -0,0 +1,27 @@ +# Traduire T3+ + +[L'installer](./installer.html) contient un script pour vous aider à traduire l'application. + +Sous Linux, Mac +``` + sh translate.sh +``` + +Sous windows +``` + translate.bat +``` + +# Translate T3+ + +[L'installer](./installer.html) contains a script to help you doing this :). + +Under Linux, Mac +``` + sh translate.sh +``` + +Under windows +``` + translate.bat +``` ===================================== src/site/site.xml ===================================== --- a/src/site/site.xml +++ b/src/site/site.xml @@ -77,6 +77,7 @@ <item name="Installation" href="install.html"/> <item name="Création de base" href="installer.html"/> <item name="Configuration" href="./config-report.html"/> + <item name="Translate" href="./translate.html"/> </menu> <menu name="Modélisation"> ===================================== t3-actions/src/main/java/fr/ird/t3/actions/data/level0/ComputeRF2Action.java ===================================== --- a/t3-actions/src/main/java/fr/ird/t3/actions/data/level0/ComputeRF2Action.java +++ b/t3-actions/src/main/java/fr/ird/t3/actions/data/level0/ComputeRF2Action.java @@ -53,6 +53,7 @@ import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set; +import java.util.TreeSet; import static org.nuiton.i18n.I18n.l; @@ -82,6 +83,7 @@ public class ComputeRF2Action extends AbstractLevel0Action<ComputeRF2Configurati private VesselSimpleTypeTopiaDao vesselSimpleTypeDAO; /** usable complete trips group by vessel */ private ListMultimap<Vessel, CompleteTrip> completeTripsByVessel; + private Set<String> tripStrDone; public ComputeRF2Action() { super(Level0Step.COMPUTE_RF2); @@ -117,6 +119,7 @@ public class ComputeRF2Action extends AbstractLevel0Action<ComputeRF2Configurati // use all fleets fleets = countryDAO.findAll(); } + tripStrDone = new TreeSet<>(); List<Trip> tripList = getUsableTrips(landingHarbours, true); setTrips(tripList); completeTripsByVessel = ArrayListMultimap.create(); @@ -280,10 +283,14 @@ public class ComputeRF2Action extends AbstractLevel0Action<ComputeRF2Configurati tripCatchWeight = trip.getElementaryCatchTotalWeightRf1(species); } totalCatchWeight += tripCatchWeight; - addInfoMessage(l(locale, "t3.level0.computeRF2.resume.rf1.for.trip", tripStr, tripCatchWeight, tripLandingWeight)); + if (tripStrDone.add(tripStr)) { + addInfoMessage(l(locale, "t3.level0.computeRF2.resume.rf1.for.trip", tripStr, tripCatchWeight, tripLandingWeight)); + } } else { // this trip does not have any landing catches for given species - addWarningMessage(l(locale, "t3.level0.computeRF2.resume.skip.for.trip", tripStr)); + if (tripStrDone.add(tripStr)) { + addWarningMessage(l(locale, "t3.level0.computeRF2.resume.skip.for.trip", tripStr)); + } } } addInfoMessage(l(locale, "t3.level0.computeRF2.resume.total.rf1", totalCatchWeight, totalLandingWeight)); ===================================== t3-installer/pom.xml ===================================== --- a/t3-installer/pom.xml +++ b/t3-installer/pom.xml @@ -52,6 +52,16 @@ </dependency> <dependency> + <groupId>io.ultreia.java4all.jaxx</groupId> + <artifactId>jaxx-runtime</artifactId> + </dependency> + + <dependency> + <groupId>io.ultreia.java4all.i18n</groupId> + <artifactId>i18n-editor</artifactId> + </dependency> + + <dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> <scope>runtime</scope> ===================================== t3-installer/src/main/assembly/dist/README.md ===================================== --- a/t3-installer/src/main/assembly/dist/README.md +++ b/t3-installer/src/main/assembly/dist/README.md @@ -1,31 +1,39 @@ -Tools to manage T3 databases. +# T3 Console + +### Before using database commands First fill the **db.properties** file with correct values. Then use the command you need :). -# Create a database - +## Create a database This will create the database on postgres server, then fill it. - ``` -create-db.sh dbName +sh create-db.sh dbName ``` or ``` create-db.bat dbName ``` -# Fill a database - +## Fill a database This will just fill a database on postgres server. **but the database must be empty and have a t3 schema initialized.** - ``` -fill-db.sh dbName +sh fill-db.sh dbName ``` or ``` fill-db.bat dbName ``` + +## Translate application +This will open a GUI to translate application. +``` +sh translate.sh +``` +or +``` +translate.bat +``` ===================================== t3-installer/src/main/assembly/dist/translate.bat ===================================== --- /dev/null +++ b/t3-installer/src/main/assembly/dist/translate.bat @@ -0,0 +1 @@ +java -Xmx2048M -Xms512M -jar ${project.build.finalName}.jar --translate \ No newline at end of file ===================================== t3-installer/src/main/assembly/dist/translate.sh ===================================== --- /dev/null +++ b/t3-installer/src/main/assembly/dist/translate.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +java -Xmx2048M -Xms512M -jar ${project.build.finalName}.jar --translate ===================================== t3-installer/src/main/config/T3Installer.ini ===================================== --- a/t3-installer/src/main/config/T3Installer.ini +++ b/t3-installer/src/main/config/T3Installer.ini @@ -5,3 +5,7 @@ aliases = --create-db [action fillDb] action = fr.ird.t3.console.T3DatabaseTool#fill aliases = --fill-db + +[action translate] +action = fr.ird.t3.console.T3I18nTool#start +aliases = --translate ===================================== t3-installer/src/main/java/fr/ird/t3/console/T3I18nTool.java ===================================== --- /dev/null +++ b/t3-installer/src/main/java/fr/ird/t3/console/T3I18nTool.java @@ -0,0 +1,46 @@ +package fr.ird.t3.console; + +/*- + * #%L + * T3 :: Installer + * %% + * Copyright (C) 2010 - 2018 IRD, Code Lutin, Ultreia.io + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ + +import org.nuiton.i18n.editor.model.Project; +import org.nuiton.i18n.editor.ui.ProjectUI; +import org.nuiton.jaxx.runtime.swing.SwingUtil; + +import java.net.URL; +import java.util.Objects; + +/** + * Created by tchemit on 14/03/2018. + * + * @author Tony Chemit - dev@tchemit.fr + */ +public class T3I18nTool { + + @SuppressWarnings("unused") + public void start() throws Exception { + SwingUtil.initNimbusLoookAndFeel(); + URL url = Objects.requireNonNull(getClass().getClassLoader().getResource("META-INF/t3-i18n-definition.properties")); + Project project = new Project(url); + ProjectUI ui = new ProjectUI(null, project); + ui.setVisible(true); + } +} View it on GitLab: https://gitlab.com/ultreiaio/ird-t3/compare/e79cdbf0c1de0b066b409490de785070... --- View it on GitLab: https://gitlab.com/ultreiaio/ird-t3/compare/e79cdbf0c1de0b066b409490de785070... You're receiving this email because of your account on gitlab.com.
participants (1)
-
Tony CHEMIT