diff --git a/CHANGELOG.md b/CHANGELOG.md index 18403d4..c0f76a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # History of changes (since 5/2022) +## Release 1.2.7 + +### Feature +* SABI-17: i18n of measurement units, parameter and plagues. + ## Release 1.2.6 ### Enhancements diff --git a/captcha/pom.xml b/captcha/pom.xml index c53c270..e465786 100644 --- a/captcha/pom.xml +++ b/captcha/pom.xml @@ -47,6 +47,7 @@ UTF-8 2.3.0 1.12.3 + 1.18.30 9.0.9 3.2.5 2.16.2 @@ -106,6 +107,14 @@ ${springdoc.openapiv2.version} + + + org.projectlombok + lombok + ${lombok.version} + provided + + org.springframework.boot diff --git a/captcha/src/main/java/de/bluewhale/captcha/rest/CaptchaController.java b/captcha/src/main/java/de/bluewhale/captcha/rest/CaptchaController.java index 5bf1e8f..d8abb10 100644 --- a/captcha/src/main/java/de/bluewhale/captcha/rest/CaptchaController.java +++ b/captcha/src/main/java/de/bluewhale/captcha/rest/CaptchaController.java @@ -13,6 +13,7 @@ import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -26,6 +27,7 @@ */ @RestController @RequestMapping(value = "api/") +@Slf4j public class CaptchaController { @Autowired @@ -46,9 +48,11 @@ public ResponseEntity getNewCaptchaChallenge( @PathVariable(value = "language", required = true) @Parameter(name = "language", description = "ISO-639-1 language code - used for i18n in communication. English will be used as fallback, if language is not available.") String language) { + log.debug("Received new challenge request for langcode {}", language); ResponseEntity response; if (ChallengeRequestThrottle.requestAllowed()) { + log.debug("Request passed throttle barrier"); ChallengeTo challengeTo = generator.provideChallengeFor(language); response = new ResponseEntity<>(challengeTo, HttpStatus.OK); } else { diff --git a/captcha/src/main/java/de/bluewhale/captcha/service/QAGenerator.java b/captcha/src/main/java/de/bluewhale/captcha/service/QAGenerator.java index a144fcb..f73d379 100644 --- a/captcha/src/main/java/de/bluewhale/captcha/service/QAGenerator.java +++ b/captcha/src/main/java/de/bluewhale/captcha/service/QAGenerator.java @@ -6,6 +6,7 @@ package de.bluewhale.captcha.service; import de.bluewhale.captcha.model.ChallengeTo; +import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import java.util.*; @@ -27,6 +28,7 @@ * @author Stefan Schubert */ @Service +@Slf4j public class QAGenerator { private static final int TOKEN_SIZE = 5; // ------------------------------ FIELDS ------------------------------ diff --git a/captcha/src/main/resources/application.yml b/captcha/src/main/resources/application.yml index a5203cc..b3b0949 100644 --- a/captcha/src/main/resources/application.yml +++ b/captcha/src/main/resources/application.yml @@ -35,13 +35,3 @@ spring: token: # Time in milliseconds before a cached answer token expires. TTL: 120000 - -logging: - level: - de: - bluewhale: - sabi: INFO - org: - springframework: ERROR - pattern: - console: '%d{dd-MM-yyyy HH:mm:ss.SSS} %magenta([%thread]) %highlight(%-5level) %logger.%M - %msg%n' diff --git a/captcha/src/main/resources/log4j2-spring.xml b/captcha/src/main/resources/log4j2-spring.xml index 2dbf6c9..7a3a2d2 100644 --- a/captcha/src/main/resources/log4j2-spring.xml +++ b/captcha/src/main/resources/log4j2-spring.xml @@ -14,8 +14,7 @@ %d %p %C{1.} [%t] %m%n - + @@ -32,7 +31,7 @@ - + \ No newline at end of file diff --git a/devops/sabi_docker_sdk/docker-compose-arm.yml b/devops/sabi_docker_sdk/docker-compose-arm.yml index c2ab61d..ba62269 100644 --- a/devops/sabi_docker_sdk/docker-compose-arm.yml +++ b/devops/sabi_docker_sdk/docker-compose-arm.yml @@ -40,7 +40,7 @@ services: depends_on: - db db: - image: mariadb:11.1 + image: mariadb:11.3.2 platform: linux/arm64/v8 environment: - MYSQL_ROOT_PASSWORD=SuperDooper @@ -93,6 +93,6 @@ networks: sabinet: driver: bridge -# TODO: application.properties files contains "localhost" this does not matches the hosts, +# Notice: application.properties files contains "localhost" this does not matches the hosts, # db, fakeSMTP etc.. so the application.properties need to be externalized as in production # through the assets. \ No newline at end of file diff --git a/devops/sabi_docker_sdk/docker-compose.yml b/devops/sabi_docker_sdk/docker-compose.yml index b1f93ff..b4543f0 100644 --- a/devops/sabi_docker_sdk/docker-compose.yml +++ b/devops/sabi_docker_sdk/docker-compose.yml @@ -36,7 +36,7 @@ services: depends_on: - db db: - image: mariadb:11.1 + image: mariadb:11.3.2 platform: linux/amd64 environment: - MYSQL_ROOT_PASSWORD=SuperDooper diff --git a/sabi-database/src/main/resources/db/migration/version1_3_0/V1_3_0_2__i18nPlague.sql b/sabi-database/src/main/resources/db/migration/version1_3_0/V1_3_0_2__i18nPlague.sql new file mode 100644 index 0000000..cf40183 --- /dev/null +++ b/sabi-database/src/main/resources/db/migration/version1_3_0/V1_3_0_2__i18nPlague.sql @@ -0,0 +1,99 @@ +INSERT INTO localized_plague (plague_id, common_name, language, created_on, lastmod_on, optlock) +VALUES (6, 'Stella marina Asterina', 'it', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_plague (plague_id, common_name, language, created_on, lastmod_on, optlock) +VALUES (5, 'Alghe filamentose', 'it', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_plague (plague_id, common_name, language, created_on, lastmod_on, optlock) +VALUES (4, 'Dinoflagellate', 'it', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_plague (plague_id, common_name, language, created_on, lastmod_on, optlock) +VALUES (3, 'Vermi piatti', 'it', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_plague (plague_id, common_name, language, created_on, lastmod_on, optlock) +VALUES (2, 'Alghe a bolla', 'it', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_plague (plague_id, common_name, language, created_on, lastmod_on, optlock) +VALUES (1, 'Cianobatteri', 'it', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_plague (plague_id, common_name, language, created_on, lastmod_on, optlock) +VALUES (6, 'Étoile de mer Asterina', 'fr', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_plague (plague_id, common_name, language, created_on, lastmod_on, optlock) +VALUES (5, 'Algues filamenteuses', 'fr', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_plague (plague_id, common_name, language, created_on, lastmod_on, optlock) +VALUES (4, 'Dinoflagellé', 'fr', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_plague (plague_id, common_name, language, created_on, lastmod_on, optlock) +VALUES (3, 'Vers plats', 'fr', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_plague (plague_id, common_name, language, created_on, lastmod_on, optlock) +VALUES (2, 'Algues-bulles', 'fr', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_plague (plague_id, common_name, language, created_on, lastmod_on, optlock) +VALUES (1, 'Cyanobactéries', 'fr', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_plague (plague_id, common_name, language, created_on, lastmod_on, optlock) +VALUES (6, 'Estrella de mar Asterina', 'es', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_plague (plague_id, common_name, language, created_on, lastmod_on, optlock) +VALUES (5, 'Algas filamentosas', 'es', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_plague (plague_id, common_name, language, created_on, lastmod_on, optlock) +VALUES (4, 'Dinoflagelados', 'es', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_plague (plague_id, common_name, language, created_on, lastmod_on, optlock) +VALUES (3, 'Gusanos planos', 'es', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_plague (plague_id, common_name, language, created_on, lastmod_on, optlock) +VALUES (2, 'Algas burbuja', 'es', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_plague (plague_id, common_name, language, created_on, lastmod_on, optlock) +VALUES (1, 'Cianobacterias', 'es', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_plague_status (plague_status_id, description, language, created_on, lastmod_on, optlock) +VALUES (1, 'Primera aparición', 'es', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_plague_status (plague_status_id, description, language, created_on, lastmod_on, optlock) +VALUES (2, 'Se extiende', 'es', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_plague_status (plague_status_id, description, language, created_on, lastmod_on, optlock) +VALUES (3, 'La expansión se estanca', 'es', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_plague_status (plague_status_id, description, language, created_on, lastmod_on, optlock) +VALUES (4, 'Lento declive', 'es', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_plague_status (plague_status_id, description, language, created_on, lastmod_on, optlock) +VALUES (5, 'Desaparición (fin de la plaga)', 'es', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_plague_status (plague_status_id, description, language, created_on, lastmod_on, optlock) +VALUES (1, 'Première apparition', 'fr', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_plague_status (plague_status_id, description, language, created_on, lastmod_on, optlock) +VALUES (2, 'Se propage', 'fr', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_plague_status (plague_status_id, description, language, created_on, lastmod_on, optlock) +VALUES (3, 'Extension stagnante', 'fr', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_plague_status (plague_status_id, description, language, created_on, lastmod_on, optlock) +VALUES (4, 'Recule lentement', 'fr', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_plague_status (plague_status_id, description, language, created_on, lastmod_on, optlock) +VALUES (5, 'Disparaît (fin du fléau)', 'fr', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_plague_status (plague_status_id, description, language, created_on, lastmod_on, optlock) +VALUES (1, 'Prima comparsa', 'it', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_plague_status (plague_status_id, description, language, created_on, lastmod_on, optlock) +VALUES (2, 'Si diffonde', 'it', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_plague_status (plague_status_id, description, language, created_on, lastmod_on, optlock) +VALUES (3, 'L\'espansione ristagna', 'it', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_plague_status (plague_status_id, description, language, created_on, lastmod_on, optlock) +VALUES (4, 'Lentamente diminuisce', 'it', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_plague_status (plague_status_id, description, language, created_on, lastmod_on, optlock) +VALUES (5, 'Scomparsa (fine della peste)', 'it', DEFAULT, DEFAULT, DEFAULT); + diff --git a/sabi-database/src/main/resources/db/migration/version1_3_0/V1_3_0_3__i18nParameter.sql b/sabi-database/src/main/resources/db/migration/version1_3_0/V1_3_0_3__i18nParameter.sql new file mode 100644 index 0000000..396b62d --- /dev/null +++ b/sabi-database/src/main/resources/db/migration/version1_3_0/V1_3_0_3__i18nParameter.sql @@ -0,0 +1,124 @@ +CREATE TABLE `localized_parameter` +( + `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, + `parameter_id` INT UNSIGNED NOT NULL, + `description` VARCHAR(80) NOT NULL, + `language` VARCHAR(3) NOT NULL, + `created_on` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + `lastmod_on` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + `optlock` INT UNSIGNED NOT NULL DEFAULT 0, + PRIMARY KEY (`id`), + UNIQUE KEY `business_key` (`parameter_id`, `language`), + foreign key (parameter_id) references parameter(id) +) + ENGINE = InnoDB + AUTO_INCREMENT = 1 + DEFAULT CHARSET = utf8; + +ALTER TABLE parameter drop column description; + +INSERT INTO localized_parameter (parameter_id, description, language, created_on, lastmod_on, optlock) +VALUES (1, 'Karbonathärte', 'de', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_parameter (parameter_id, description, language, created_on, lastmod_on, optlock) +VALUES (2, 'Temperatur', 'de', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_parameter (parameter_id, description, language, created_on, lastmod_on, optlock) +VALUES (3, 'Magnesium', 'de', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_parameter (parameter_id, description, language, created_on, lastmod_on, optlock) +VALUES (4, 'Calcium', 'de', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_parameter (parameter_id, description, language, created_on, lastmod_on, optlock) +VALUES (5, 'PH', 'de', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_parameter (parameter_id, description, language, created_on, lastmod_on, optlock) +VALUES (6, 'Phosphat', 'de', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_parameter (parameter_id, description, language, created_on, lastmod_on, optlock) +VALUES (7, 'Salzgehalt', 'de', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_parameter (parameter_id, description, language, created_on, lastmod_on, optlock) +VALUES (1, 'Carbonate hardness', 'en', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_parameter (parameter_id, description, language, created_on, lastmod_on, optlock) +VALUES (2, 'temperature', 'en', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_parameter (parameter_id, description, language, created_on, lastmod_on, optlock) +VALUES (3, 'magnesium', 'en', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_parameter (parameter_id, description, language, created_on, lastmod_on, optlock) +VALUES (4, 'calcium', 'en', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_parameter (parameter_id, description, language, created_on, lastmod_on, optlock) +VALUES (5, 'PH', 'en', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_parameter (parameter_id, description, language, created_on, lastmod_on, optlock) +VALUES (6, 'phosphate', 'en', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_parameter (parameter_id, description, language, created_on, lastmod_on, optlock) +VALUES (7, 'Salinity', 'en', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_parameter (parameter_id, description, language, created_on, lastmod_on, optlock) +VALUES (2, 'temperatura', 'es', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_parameter (parameter_id, description, language, created_on, lastmod_on, optlock) +VALUES (3, 'magnesio', 'es', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_parameter (parameter_id, description, language, created_on, lastmod_on, optlock) +VALUES (4, 'calcio', 'es', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_parameter (parameter_id, description, language, created_on, lastmod_on, optlock) +VALUES (5, 'PH', 'es', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_parameter (parameter_id, description, language, created_on, lastmod_on, optlock) +VALUES (6, 'fosfato', 'es', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_parameter (parameter_id, description, language, created_on, lastmod_on, optlock) +VALUES (7, 'Salinidad', 'es', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_parameter (parameter_id, description, language, created_on, lastmod_on, optlock) +VALUES (1, 'Dureza del carbonato', 'es', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_parameter (parameter_id, description, language, created_on, lastmod_on, optlock) +VALUES (1, 'Durezza del carbonato', 'it', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_parameter (parameter_id, description, language, created_on, lastmod_on, optlock) +VALUES (2, 'temperatura', 'it', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_parameter (parameter_id, description, language, created_on, lastmod_on, optlock) +VALUES (3, 'magnesio', 'it', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_parameter (parameter_id, description, language, created_on, lastmod_on, optlock) +VALUES (4, 'calcio', 'it', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_parameter (parameter_id, description, language, created_on, lastmod_on, optlock) +VALUES (5, 'PH', 'it', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_parameter (parameter_id, description, language, created_on, lastmod_on, optlock) +VALUES (6, 'fosfato', 'it', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_parameter (parameter_id, description, language, created_on, lastmod_on, optlock) +VALUES (7, 'Salinità', 'it', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_parameter (parameter_id, description, language, created_on, lastmod_on, optlock) +VALUES (1, 'Dureté carbonatée', 'fr', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_parameter (parameter_id, description, language, created_on, lastmod_on, optlock) +VALUES (2, 'Température', 'fr', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_parameter (parameter_id, description, language, created_on, lastmod_on, optlock) +VALUES (3, 'Magnésium', 'fr', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_parameter (parameter_id, description, language, created_on, lastmod_on, optlock) +VALUES (4, 'Calcium', 'fr', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_parameter (parameter_id, description, language, created_on, lastmod_on, optlock) +VALUES (5, 'PH', 'fr', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_parameter (parameter_id, description, language, created_on, lastmod_on, optlock) +VALUES (6, 'Phosphate', 'fr', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO localized_parameter (parameter_id, description, language, created_on, lastmod_on, optlock) +VALUES (7, 'Teneur en sel', 'fr', DEFAULT, DEFAULT, DEFAULT); + diff --git a/sabi-database/src/main/resources/db/migration/version1_3_0/V1_3_0_4__i18nUnit.sql b/sabi-database/src/main/resources/db/migration/version1_3_0/V1_3_0_4__i18nUnit.sql new file mode 100644 index 0000000..7f5f09b --- /dev/null +++ b/sabi-database/src/main/resources/db/migration/version1_3_0/V1_3_0_4__i18nUnit.sql @@ -0,0 +1,185 @@ +CREATE TABLE `localized_unit` +( + `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, + `unit_id` INT UNSIGNED NOT NULL, + `description` VARCHAR(80) NOT NULL, + `language` VARCHAR(3) NOT NULL, + `created_on` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + `lastmod_on` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + `optlock` INT UNSIGNED NOT NULL DEFAULT 0, + PRIMARY KEY (`id`), + UNIQUE KEY `business_key` (`unit_id`, `language`), + foreign key (unit_id) references unit(id) +) + ENGINE = InnoDB + AUTO_INCREMENT = 1 + DEFAULT CHARSET = utf8; + +ALTER TABLE unit drop column description; + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (1, 'Karbonathärte (1 °DH = 0,178 mmol/l CAO3)', 'de', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (2, 'Temperatur in Celsius', 'de', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (3, 'Calcium-Konzentration in ppm (1 ppm = 1.023 mg/L)', 'de', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (4, 'Magnesium-Konzentration in ppm (1 ppm = 1.023 mg/L)', 'de', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (5, 'PH Wert', 'de', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (6, 'Ammonium', 'de', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (7, 'Ammoniak', 'de', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (8, 'Nitrit', 'de', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (9, 'Nitrat', 'de', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (10, 'Phosphat', 'de', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (11, 'Salinität', 'de', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (1, 'Carbonate hardness (1 °DH = 0.178 mmol/l CAO3)', 'en', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (2, 'Temperature in Celsius', 'en', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (3, 'Calcium concentration in ppm (1 ppm = 1,023 mg/L)', 'en', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (4, 'Magnesium concentration in ppm (1 ppm = 1,023 mg/L)', 'en', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (5, 'PH value', 'en', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (6, 'Ammonium', 'en', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (7, 'Ammonia', 'en', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (8, 'nitrite', 'en', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (9, 'nitrate', 'en', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (10, 'phosphate', 'en', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (11, 'Salinity', 'en', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (1, 'Dureza carbonatada (1 °DH = 0,178 mmol/l CAO3)', 'es', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (2, 'Temperatura', 'es', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (3, 'Concentración de calcio en ppm (1 ppm = 1,023 mg/L)', 'es', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (4, 'Concentración de magnesio en ppm (1 ppm = 1,023 mg/L)', 'es', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (5, 'Valor PH', 'es', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (6, 'Amonio', 'es', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (7, 'Amoníaco', 'es', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (8, 'nitrito', 'es', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (9, 'nitrato', 'es', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (10, 'fosfato', 'es', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (11, 'Salinidad', 'es', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (1, 'Dureté carbonatée (1 °DH = 0,178 mmol/l CAO3)', 'fr', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (2, 'Température', 'fr', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (3, 'Concentration de calcium en ppm (1 ppm = 1.023 mg/L)', 'fr', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (4, 'Concentration en magnésium en ppm (1 ppm = 1.023 mg/L)', 'fr', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (5, 'Valeur du PH', 'fr', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (6, 'Ammonium', 'fr', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (7, 'Ammoniaque', 'fr', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (8, 'Nitrite', 'fr', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (9, 'Nitrate', 'fr', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (10, 'Phosphate', 'fr', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (11, 'Salinité', 'fr', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (1, 'Durezza carbonatica (1 °DH = 0,178 mmol/l CAO3)', 'it', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (2, 'Temperatura', 'it', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (3, 'Concentrazione di calcio in ppm (1 ppm = 1,023 mg/L)', 'it', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (4, 'Concentrazione di magnesio in ppm (1 ppm = 1,023 mg/L)', 'it', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (5, 'Valore PH', 'it', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (6, 'Ammonio', 'it', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (7, 'Ammoniaca', 'it', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (8, 'nitrito', 'it', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (9, 'nitrato', 'it', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (10, 'fosfato', 'it', DEFAULT, DEFAULT, DEFAULT); + +INSERT INTO sabi.localized_unit (unit_id, description, language, created_on, lastmod_on, optlock) +VALUES (11, 'Salinità', 'it', DEFAULT, DEFAULT, DEFAULT); + + diff --git a/sabi-server/pom.xml b/sabi-server/pom.xml index 9ba0fc3..8310aac 100644 --- a/sabi-server/pom.xml +++ b/sabi-server/pom.xml @@ -13,7 +13,7 @@ org.springframework.boot spring-boot-starter-parent - 3.2.1 + 3.2.2 diff --git a/sabi-server/src/main/java/de/bluewhale/sabi/mapper/UnitMapper.java b/sabi-server/src/main/java/de/bluewhale/sabi/mapper/UnitMapper.java index 77e0c67..0abed8d 100644 --- a/sabi-server/src/main/java/de/bluewhale/sabi/mapper/UnitMapper.java +++ b/sabi-server/src/main/java/de/bluewhale/sabi/mapper/UnitMapper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 by Stefan Schubert under the MIT License (MIT). + * Copyright (c) 2024 by Stefan Schubert under the MIT License (MIT). * See project LICENSE file for the detailed terms and conditions. */ @@ -25,7 +25,6 @@ public interface UnitMapper { @Mappings({ @Mapping(target ="id", source="id"), @Mapping(target ="unitSign", source="name"), - @Mapping(target ="description", source="description"), }) UnitTo mapUnitEntity2To(@NotNull final UnitEntity pUnitEntity); @@ -33,7 +32,6 @@ public interface UnitMapper { @Mappings({ @Mapping(target ="id", source="id"), @Mapping(target ="name", source="unitSign"), - @Mapping(target ="description", source="description"), }) UnitEntity mapUnitToEntity(@NotNull final UnitTo pUnitTo); diff --git a/sabi-server/src/main/java/de/bluewhale/sabi/persistence/model/LocalizedParameterEntity.java b/sabi-server/src/main/java/de/bluewhale/sabi/persistence/model/LocalizedParameterEntity.java new file mode 100644 index 0000000..9f527b8 --- /dev/null +++ b/sabi-server/src/main/java/de/bluewhale/sabi/persistence/model/LocalizedParameterEntity.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2024 by Stefan Schubert under the MIT License (MIT). + * See project LICENSE file for the detailed terms and conditions. + */ + +package de.bluewhale.sabi.persistence.model; + +import jakarta.persistence.*; +import lombok.Data; + +/** + * Table which contains the translated parameter descriptions. + */ +@Table(name = "localized_parameter", schema = "sabi") +@Entity +@Data +public class LocalizedParameterEntity extends Auditable { +// ------------------------------ FIELDS ------------------------------ + + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Id + @Column(name = "id", nullable = false, insertable = true, updatable = true, length = 20) + @Basic + private Long id; + + @Column(name = "parameter_id", nullable = false, insertable = true, updatable = true) + @Basic + private Integer parameter_id; + + @Column(name = "description", nullable = true, insertable = true, updatable = true, length = 80) + @Basic + private String description; + + @Column(name = "language", nullable = true, insertable = true, updatable = true, length = 3) + @Basic + private String language; + +} diff --git a/sabi-server/src/main/java/de/bluewhale/sabi/persistence/model/LocalizedUnitEntity.java b/sabi-server/src/main/java/de/bluewhale/sabi/persistence/model/LocalizedUnitEntity.java new file mode 100644 index 0000000..dc727cf --- /dev/null +++ b/sabi-server/src/main/java/de/bluewhale/sabi/persistence/model/LocalizedUnitEntity.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2024 by Stefan Schubert under the MIT License (MIT). + * See project LICENSE file for the detailed terms and conditions. + */ + +package de.bluewhale.sabi.persistence.model; + +import jakarta.persistence.*; +import lombok.Data; + +/** + * Table which contains the translated parameter descriptions. + */ +@Table(name = "localized_unit", schema = "sabi") +@Entity +@Data +public class LocalizedUnitEntity extends Auditable { +// ------------------------------ FIELDS ------------------------------ + + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Id + @Column(name = "id", nullable = false, insertable = true, updatable = true, length = 20) + @Basic + private Long id; + + @Column(name = "unit_id", nullable = false, insertable = true, updatable = true) + @Basic + private Integer unitId; + + @Column(name = "description", nullable = true, insertable = true, updatable = true, length = 80) + @Basic + private String description; + + @Column(name = "language", nullable = true, insertable = true, updatable = true, length = 3) + @Basic + private String language; + +} diff --git a/sabi-server/src/main/java/de/bluewhale/sabi/persistence/model/MeasurementEntity.java b/sabi-server/src/main/java/de/bluewhale/sabi/persistence/model/MeasurementEntity.java index 274a3ff..a8df783 100644 --- a/sabi-server/src/main/java/de/bluewhale/sabi/persistence/model/MeasurementEntity.java +++ b/sabi-server/src/main/java/de/bluewhale/sabi/persistence/model/MeasurementEntity.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 by Stefan Schubert under the MIT License (MIT). + * Copyright (c) 2024 by Stefan Schubert under the MIT License (MIT). * See project LICENSE file for the detailed terms and conditions. */ @@ -26,7 +26,7 @@ @Table(name = "measurement", schema = "sabi") @Entity @Data -@EqualsAndHashCode(exclude = {"user", "aquarium"}) +@EqualsAndHashCode(exclude = {"user", "aquarium"},callSuper = false) public class MeasurementEntity extends Auditable { // ------------------------------ FIELDS ------------------------------ diff --git a/sabi-server/src/main/java/de/bluewhale/sabi/persistence/model/MotdEntity.java b/sabi-server/src/main/java/de/bluewhale/sabi/persistence/model/MotdEntity.java index baf4d51..eddf6dc 100644 --- a/sabi-server/src/main/java/de/bluewhale/sabi/persistence/model/MotdEntity.java +++ b/sabi-server/src/main/java/de/bluewhale/sabi/persistence/model/MotdEntity.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 by Stefan Schubert under the MIT License (MIT). + * Copyright (c) 2024 by Stefan Schubert under the MIT License (MIT). * See project LICENSE file for the detailed terms and conditions. */ @@ -22,7 +22,7 @@ @Table(name = "motd", schema = "sabi") @Entity @Data -@EqualsAndHashCode(exclude = "localizedMotdEntities") +@EqualsAndHashCode(exclude = "localizedMotdEntities",callSuper = false) public class MotdEntity extends Auditable { // ------------------------------ FIELDS ------------------------------ diff --git a/sabi-server/src/main/java/de/bluewhale/sabi/persistence/model/ParameterEntity.java b/sabi-server/src/main/java/de/bluewhale/sabi/persistence/model/ParameterEntity.java index 9bb413d..30b96d4 100644 --- a/sabi-server/src/main/java/de/bluewhale/sabi/persistence/model/ParameterEntity.java +++ b/sabi-server/src/main/java/de/bluewhale/sabi/persistence/model/ParameterEntity.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 by Stefan Schubert under the MIT License (MIT). + * Copyright (c) 2024 by Stefan Schubert under the MIT License (MIT). * See project LICENSE file for the detailed terms and conditions. */ @@ -7,10 +7,15 @@ import jakarta.persistence.*; import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.ArrayList; +import java.util.List; @Table(name = "parameter", schema = "sabi") @Entity @Data +@EqualsAndHashCode(exclude = "localizedParameterEntities") public class ParameterEntity extends Auditable { // ------------------------------ FIELDS ------------------------------ @@ -20,10 +25,6 @@ public class ParameterEntity extends Auditable { @Basic private Integer id; - @jakarta.persistence.Column(name = "description", nullable = false, insertable = true, updatable = true, length = 255, precision = 0) - @Basic - private String description; - @jakarta.persistence.Column(name = "belonging_unit_id", nullable = false, insertable = true, updatable = true, length = 10, precision = 0) @Basic private int belongingUnitId; @@ -36,4 +37,9 @@ public class ParameterEntity extends Auditable { @Basic private Float maxThreshold; + // Unidirectional for now - as this contains more static data, we won't provide an admin gui for it. + @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, orphanRemoval = true) + @JoinColumn(name="parameter_id") + private List localizedParameterEntities = new ArrayList(); + } diff --git a/sabi-server/src/main/java/de/bluewhale/sabi/persistence/model/PlagueEntity.java b/sabi-server/src/main/java/de/bluewhale/sabi/persistence/model/PlagueEntity.java index 0cc7e88..bb9d746 100644 --- a/sabi-server/src/main/java/de/bluewhale/sabi/persistence/model/PlagueEntity.java +++ b/sabi-server/src/main/java/de/bluewhale/sabi/persistence/model/PlagueEntity.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 by Stefan Schubert under the MIT License (MIT). + * Copyright (c) 2024 by Stefan Schubert under the MIT License (MIT). * See project LICENSE file for the detailed terms and conditions. */ @@ -18,7 +18,7 @@ @Table(name = "plague", schema = "sabi") @Entity @Data -@EqualsAndHashCode(exclude = "localizedPlagueEntities") +@EqualsAndHashCode(exclude = "localizedPlagueEntities",callSuper = false) public class PlagueEntity extends Auditable { // ------------------------------ FIELDS ------------------------------ @@ -31,7 +31,7 @@ public class PlagueEntity extends Auditable { @Basic private String scientificName; - // Unidirectional for now - as this contains more static data, we we won't provide a admin gui for it. + // Unidirectional for now - as this contains more static data, we won't provide an admin gui for it. @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, orphanRemoval = true) @JoinColumn(name="plague_id") private List localizedPlagueEntities = new ArrayList(); diff --git a/sabi-server/src/main/java/de/bluewhale/sabi/persistence/model/PlagueRecordEntity.java b/sabi-server/src/main/java/de/bluewhale/sabi/persistence/model/PlagueRecordEntity.java index 73eea96..608a4fb 100644 --- a/sabi-server/src/main/java/de/bluewhale/sabi/persistence/model/PlagueRecordEntity.java +++ b/sabi-server/src/main/java/de/bluewhale/sabi/persistence/model/PlagueRecordEntity.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 by Stefan Schubert under the MIT License (MIT). + * Copyright (c) 2024 by Stefan Schubert under the MIT License (MIT). * See project LICENSE file for the detailed terms and conditions. */ @@ -26,7 +26,7 @@ @Table(name = "plague_record", schema = "sabi") @Entity @Data -@EqualsAndHashCode(exclude = {"user", "aquarium"}) +@EqualsAndHashCode(exclude = {"user", "aquarium"}, callSuper = false) public class PlagueRecordEntity extends Auditable { // ------------------------------ FIELDS ------------------------------ diff --git a/sabi-server/src/main/java/de/bluewhale/sabi/persistence/model/UnitEntity.java b/sabi-server/src/main/java/de/bluewhale/sabi/persistence/model/UnitEntity.java index bea8872..72bd015 100644 --- a/sabi-server/src/main/java/de/bluewhale/sabi/persistence/model/UnitEntity.java +++ b/sabi-server/src/main/java/de/bluewhale/sabi/persistence/model/UnitEntity.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 by Stefan Schubert under the MIT License (MIT). + * Copyright (c) 2024 by Stefan Schubert under the MIT License (MIT). * See project LICENSE file for the detailed terms and conditions. */ @@ -8,6 +8,9 @@ import jakarta.persistence.*; import lombok.Data; +import java.util.ArrayList; +import java.util.List; + @Table(name = "unit", schema = "sabi") @Entity @Data @@ -24,8 +27,10 @@ public class UnitEntity extends Auditable { @Basic private String name; - @jakarta.persistence.Column(name = "description", nullable = false, insertable = true, updatable = true, length = 255, precision = 0) - @Basic - private String description; + // Unidirectional for now - as this contains more static data, we won't provide an admin gui for it. + @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, orphanRemoval = true) + @JoinColumn(name="unit_id") + private List localizedUnitEntities = new ArrayList(); + } diff --git a/sabi-server/src/main/java/de/bluewhale/sabi/persistence/model/UserEntity.java b/sabi-server/src/main/java/de/bluewhale/sabi/persistence/model/UserEntity.java index 8599e9e..c54ca9a 100644 --- a/sabi-server/src/main/java/de/bluewhale/sabi/persistence/model/UserEntity.java +++ b/sabi-server/src/main/java/de/bluewhale/sabi/persistence/model/UserEntity.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 by Stefan Schubert under the MIT License (MIT). + * Copyright (c) 2024 by Stefan Schubert under the MIT License (MIT). * See project LICENSE file for the detailed terms and conditions. */ @@ -19,7 +19,7 @@ @Table(name = "users", schema = "sabi") @Entity @Data -@EqualsAndHashCode(exclude = {"aquariums","corals","fishes","measurements","treatments"}) +@EqualsAndHashCode(exclude = {"aquariums","corals","fishes","measurements","treatments"},callSuper = false) public class UserEntity extends Auditable { // ------------------------------ FIELDS ------------------------------ diff --git a/sabi-server/src/main/java/de/bluewhale/sabi/persistence/repositories/LocalizedUnitRepository.java b/sabi-server/src/main/java/de/bluewhale/sabi/persistence/repositories/LocalizedUnitRepository.java new file mode 100644 index 0000000..77b6e1f --- /dev/null +++ b/sabi-server/src/main/java/de/bluewhale/sabi/persistence/repositories/LocalizedUnitRepository.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2024 by Stefan Schubert under the MIT License (MIT). + * See project LICENSE file for the detailed terms and conditions. + */ + +package de.bluewhale.sabi.persistence.repositories; + +import de.bluewhale.sabi.persistence.model.LocalizedUnitEntity; +import jakarta.validation.constraints.NotNull; +import org.springframework.data.jpa.repository.JpaRepository; + +/** + * SpringDataRepository + * + * @author Stefan Schubert + */ +public interface LocalizedUnitRepository extends JpaRepository { + + /** + * Used to get the language specific fields. + * @param pLanguage + * @param pUnitId + * @return LocalizedUnitEntity suitable for requested language + */ + LocalizedUnitEntity findByLanguageAndUnitId(@NotNull String pLanguage, @NotNull Integer pUnitId); + + +} diff --git a/sabi-server/src/main/java/de/bluewhale/sabi/rest/controller/MeasurementController.java b/sabi-server/src/main/java/de/bluewhale/sabi/rest/controller/MeasurementController.java index c603bbe..d6fce52 100644 --- a/sabi-server/src/main/java/de/bluewhale/sabi/rest/controller/MeasurementController.java +++ b/sabi-server/src/main/java/de/bluewhale/sabi/rest/controller/MeasurementController.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 by Stefan Schubert under the MIT License (MIT). + * Copyright (c) 2024 by Stefan Schubert under the MIT License (MIT). * See project LICENSE file for the detailed terms and conditions. */ @@ -329,16 +329,18 @@ public ResponseEntity> listUsersTankMeasurementsOfSpecificUn description = "Success - list of measurement reminders for authed user returned."), @ApiResponse(responseCode = "401", description = "Unauthorized-request did not contained a valid user token.") }) - @RequestMapping(value = "/reminder/list", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) + @RequestMapping(value = "/reminder/list/{language}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseBody @ResponseStatus(HttpStatus.OK) public ResponseEntity> listUsersMeasurementReminders(@RequestHeader(name = AUTH_TOKEN, required = true) String token, + @PathVariable(value="language", required = true) + @Parameter(name = "language", description = "ISO-639-1 language code - used for i18n in communication. ") String language, Principal principal) { // If we come so far, the JWTAuthenticationFilter has already validated the token, // and we can be sure that spring has injected a valid Principal object. // list may be empty but not null - List measurementReminderTos = measurementService.fetchUsersNextMeasurements(principal.getName()); + List measurementReminderTos = measurementService.fetchUsersNextMeasurements(principal.getName(), language); return new ResponseEntity<>(measurementReminderTos, HttpStatus.ACCEPTED); } diff --git a/sabi-server/src/main/java/de/bluewhale/sabi/rest/controller/UnitController.java b/sabi-server/src/main/java/de/bluewhale/sabi/rest/controller/UnitController.java index b435fbf..ab9ca7f 100644 --- a/sabi-server/src/main/java/de/bluewhale/sabi/rest/controller/UnitController.java +++ b/sabi-server/src/main/java/de/bluewhale/sabi/rest/controller/UnitController.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 by Stefan Schubert under the MIT License (MIT). + * Copyright (c) 2024 by Stefan Schubert under the MIT License (MIT). * See project LICENSE file for the detailed terms and conditions. */ @@ -45,13 +45,15 @@ public class UnitController { description = "Success - list of all supported measurement units returned."), @ApiResponse(responseCode = "401", description = "Unauthorized - request did not contained a valid user token.") }) - @RequestMapping(value = {"/list"}, method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) + @RequestMapping(value = {"/list/{language}"}, method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseBody @ResponseStatus(HttpStatus.ACCEPTED) - public ResponseEntity> listAllMeasurementUnits(@RequestHeader(name = AUTH_TOKEN, required = true) String token, Principal principal) { + public ResponseEntity> listAllMeasurementUnits(@RequestHeader(name = AUTH_TOKEN, required = true) String token, + @PathVariable(value="language", required = false) + @Parameter(name = "language", description = "ISO-639-1 language code - used for i18n in communication. ") String language, Principal principal) { // If we come so far, the JWTAuthenticationFilter has already validated the token, // and we can be sure that spring has injected a valid Principal object. - List unitToList = measurementService.listAllMeasurementUnits(); + List unitToList = measurementService.listAllMeasurementUnits(language); return new ResponseEntity<>(unitToList, HttpStatus.ACCEPTED); } @@ -64,16 +66,17 @@ public ResponseEntity> listAllMeasurementUnits(@RequestHeader(name description = "Not detail parameter available for requested unit."), @ApiResponse(responseCode = "401", description = "Unauthorized - request did not contained a valid user token.") }) - @RequestMapping(value = {"/parameter/{unitID}"}, method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) + @RequestMapping(value = {"/parameter/{unitID}/{language}"}, method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseBody @ResponseStatus(HttpStatus.ACCEPTED) public ResponseEntity readDetailParameterOfUnit(@RequestHeader(name = AUTH_TOKEN, required = true) String token, @PathVariable(value = "unitID", required = true) @Parameter(name = "unitID", description = "id of the unit you query details for...") Integer unitID, + @PathVariable(value = "language", required = true) @Parameter(name = "language", description = "ISO-639-1 language code - used for i18n in communication.") String language, Principal principal) { // If we come so far, the JWTAuthenticationFilter has already validated the token, // and we can be sure that spring has injected a valid Principal object. - ParameterTo parameterTo = measurementService.fetchParameterInfoFor(unitID); + ParameterTo parameterTo = measurementService.fetchParameterInfoFor(unitID,language); if (parameterTo == null) { return new ResponseEntity<>(null, HttpStatus.NOT_FOUND); } else { diff --git a/sabi-server/src/main/java/de/bluewhale/sabi/services/MeasurementService.java b/sabi-server/src/main/java/de/bluewhale/sabi/services/MeasurementService.java index ef084d6..baeb0c7 100644 --- a/sabi-server/src/main/java/de/bluewhale/sabi/services/MeasurementService.java +++ b/sabi-server/src/main/java/de/bluewhale/sabi/services/MeasurementService.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 by Stefan Schubert under the MIT License (MIT). + * Copyright (c) 2024 by Stefan Schubert under the MIT License (MIT). * See project LICENSE file for the detailed terms and conditions. */ @@ -33,10 +33,11 @@ public interface MeasurementService { * Measurement units are not hard coded via enums, they can dynamically added through the database if required. * Use this function to retrieve the list of known ones. * + * @param pUsersLanguage ISO-639-1 language code - used for i18n in communication (localized parameter description) * @return List of supported measurement units */ @NotNull - List listAllMeasurementUnits(); + List listAllMeasurementUnits(String pUsersLanguage); /** * Lists all measurements of a specific user. @@ -118,9 +119,10 @@ public interface MeasurementService { * Required because of the loose coupling. * * @param pUnitID identifies the unit for which we are interested on additional parameter infos. - * @return ParameterTo with details or null if they do not exists. + * @param pUsersLanguage ISO-639-1 language code - used for i18n in communication (localized parameter description) + * @return ParameterTo with details or null if they do not exist. */ - ParameterTo fetchParameterInfoFor(Integer pUnitID); + ParameterTo fetchParameterInfoFor(Integer pUnitID, String pUsersLanguage); /** * Used to display some project stats. @@ -149,7 +151,7 @@ public interface MeasurementService { * @param pUserEmail preAuthed UserID * @return List of measurement reminders, might be empty. */ - @NotNull List fetchUsersNextMeasurements(@NotNull String pUserEmail); + @NotNull List fetchUsersNextMeasurements(@NotNull String pUserEmail, @NotNull String pUserLanguage); /** * Adds provided MeasurementReminderTo if it is consistent with requesting user. diff --git a/sabi-server/src/main/java/de/bluewhale/sabi/services/MeasurementServiceImpl.java b/sabi-server/src/main/java/de/bluewhale/sabi/services/MeasurementServiceImpl.java index af3feff..3264d58 100644 --- a/sabi-server/src/main/java/de/bluewhale/sabi/services/MeasurementServiceImpl.java +++ b/sabi-server/src/main/java/de/bluewhale/sabi/services/MeasurementServiceImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 by Stefan Schubert under the MIT License (MIT). + * Copyright (c) 2024 by Stefan Schubert under the MIT License (MIT). * See project LICENSE file for the detailed terms and conditions. */ @@ -58,6 +58,9 @@ public class MeasurementServiceImpl implements MeasurementService { @Autowired UnitRepository unitRepository; + @Autowired + LocalizedUnitRepository localizedUnitRepository; + @Autowired UnitMapper unitMapper; @@ -93,12 +96,15 @@ public List listMeasurementsFilteredBy(Long pTankID, Integer pUni @Override @Cacheable("unitsCache") - public @NotNull List listAllMeasurementUnits() { + public @NotNull List listAllMeasurementUnits(String pUsersLanguage) { List unitToList = Collections.emptyList(); List unitEntityList = unitRepository.findAll(); if (unitEntityList != null && !unitEntityList.isEmpty()) { unitToList = unitMapper.mapUnitEntities2TOs(unitEntityList); - + for (UnitTo unitTo : unitToList) { + LocalizedUnitEntity localizedUnit = localizedUnitRepository.findByLanguageAndUnitId(pUsersLanguage, unitTo.getId()); + unitTo.setDescription((localizedUnit == null) ? null : localizedUnit.getDescription()); + } } return unitToList; } @@ -209,13 +215,18 @@ public ResultTo updateMeasurement(MeasurementTo pMeasurementTo, S } @Override - public ParameterTo fetchParameterInfoFor(Integer pUnitID) { + public ParameterTo fetchParameterInfoFor(Integer pUnitID, String pUsersLanguage) { if (pUnitID == null) { log.warn("Tried to fetch Parameter Info for null unit. This smells after a logic flaw."); return null; } + if (pUsersLanguage == null) { + log.warn("Called fetch parameter Info without language param. Using english as default."); + pUsersLanguage = "en"; + } + ParameterEntity parameterEntity = parameterRepository.findByBelongingUnitIdEquals(pUnitID); if (parameterEntity == null) { @@ -225,7 +236,14 @@ public ParameterTo fetchParameterInfoFor(Integer pUnitID) { ParameterTo parameterTo = parameterMapper.mapParameterEntity2To(parameterEntity); - return parameterTo; + List localizedParameterEntities = parameterEntity.getLocalizedParameterEntities(); + String finalPUsersLanguage = pUsersLanguage; + Optional localizedParameterEntity = localizedParameterEntities.stream().filter(item -> finalPUsersLanguage.equalsIgnoreCase(item.getLanguage())).findFirst(); + if (localizedParameterEntity.isPresent()) { + parameterTo.setDescription(localizedParameterEntity.get().getDescription()); + } + + return parameterTo; } @Override @@ -275,10 +293,10 @@ public ResultTo addIotAuthorizedMeasurement(MeasurementTo pMeasur } @Override - public List fetchUsersNextMeasurements(String pUserEmail) { + public List fetchUsersNextMeasurements(String pUserEmail, String pUserLanguage) { List measurementReminderTos = new ArrayList<>(); - List allMeasurementUnits = listAllMeasurementUnits(); + List allMeasurementUnits = listAllMeasurementUnits(pUserLanguage); UserEntity user = userRepository.getByEmail(pUserEmail); List userMeasurementReminders = user.getUserMeasurementReminders(); diff --git a/sabi-server/src/main/java/de/bluewhale/sabi/services/TankServiceImpl.java b/sabi-server/src/main/java/de/bluewhale/sabi/services/TankServiceImpl.java index 3f6b768..3c2e070 100644 --- a/sabi-server/src/main/java/de/bluewhale/sabi/services/TankServiceImpl.java +++ b/sabi-server/src/main/java/de/bluewhale/sabi/services/TankServiceImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 by Stefan Schubert under the MIT License (MIT). + * Copyright (c) 2024 by Stefan Schubert under the MIT License (MIT). * See project LICENSE file for the detailed terms and conditions. */ @@ -136,7 +136,7 @@ public ResultTo updateTank(AquariumTo updatedAquariumTo, String pUse AquariumEntity aquariumEntity = aquariumRepository.getAquariumEntityByIdAndUser_IdIs(updatedAquariumTo.getId(), requestingUser.getId()); if (aquariumEntity != null) { - // FIXME STS (04.09.23): The Mapping here will provide a completley new entity + // FIXME STS (04.09.23): The Mapping here will provide a completely new entity // however we have the aquarium before. Isn't there a merge mapping // between entities available by mapstruts? aquariumEntity = aquariumMapper.mapAquariumTo2Entity(updatedAquariumTo); diff --git a/sabi-server/src/main/resources/application.yml b/sabi-server/src/main/resources/application.yml index c1f03b2..e66d144 100644 --- a/sabi-server/src/main/resources/application.yml +++ b/sabi-server/src/main/resources/application.yml @@ -64,6 +64,10 @@ spring: application: name: sabi-service # JPA Database configuration + threads: + virtual: + # No need to configure Http Threadpool size, we use virtual Threads + enabled: true datasource: driver-class-name: org.mariadb.jdbc.Driver # Hikari Connection Pool diff --git a/sabi-server/src/test/java/de/bluewhale/sabi/BasicDataFactory.java b/sabi-server/src/test/java/de/bluewhale/sabi/BasicDataFactory.java index 847856b..e6312bc 100644 --- a/sabi-server/src/test/java/de/bluewhale/sabi/BasicDataFactory.java +++ b/sabi-server/src/test/java/de/bluewhale/sabi/BasicDataFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 by Stefan Schubert under the MIT License (MIT). + * Copyright (c) 2024 by Stefan Schubert under the MIT License (MIT). * See project LICENSE file for the detailed terms and conditions. */ @@ -14,6 +14,7 @@ import org.springframework.jdbc.core.JdbcTemplate; import java.time.LocalDateTime; +import java.util.List; /** * Derive your tests from this class to inject required minimum required basic data into H2. @@ -31,6 +32,9 @@ public class BasicDataFactory { @Autowired UnitRepository unitRepository; + @Autowired + LocalizedUnitRepository localizedUnitRepository; + @Autowired RemedyRepository remedyRepository; @@ -88,31 +92,51 @@ public void populateBasicData() { UnitEntity unitEntity = new UnitEntity(); unitEntity.setName("KH"); - unitEntity.setDescription("Karbonathärte / Alkanität"); unitEntity.setId(1); UnitEntity unitEntity2 = new UnitEntity(); unitEntity2.setName("°C"); - unitEntity2.setDescription("Grad Celsius"); unitEntity2.setId(2); - unitRepository.saveAndFlush(unitEntity); - unitRepository.saveAndFlush(unitEntity2); + UnitEntity savedUnitEntity = unitRepository.saveAndFlush(unitEntity); + + LocalizedUnitEntity localizedUnitEntity = new LocalizedUnitEntity(); + localizedUnitEntity.setDescription("Karbonathärte / Alkanität"); + localizedUnitEntity.setUnitId(savedUnitEntity.getId()); + localizedUnitRepository.saveAndFlush(localizedUnitEntity); + unitEntity.setLocalizedUnitEntities(List.of(localizedUnitEntity)); + + UnitEntity savedUnitEntity2 = unitRepository.saveAndFlush(unitEntity2); + + LocalizedUnitEntity localizedUnitEntity2 = new LocalizedUnitEntity(); + localizedUnitEntity2.setDescription("Grad Celsius"); + localizedUnitEntity2.setUnitId(savedUnitEntity2.getId()); + localizedUnitRepository.saveAndFlush(localizedUnitEntity2); + unitEntity2.setLocalizedUnitEntities(List.of(localizedUnitEntity2)); ParameterEntity parameterEntity = new ParameterEntity(); - parameterEntity.setDescription("Karbonathärte"); parameterEntity.setBelongingUnitId(1); parameterEntity.setMinThreshold(6.5f); parameterEntity.setMaxThreshold(10f); ParameterEntity parameterEntity2 = new ParameterEntity(); - parameterEntity2.setDescription("Temperatur"); parameterEntity2.setBelongingUnitId(2); parameterEntity2.setMinThreshold(24f); parameterEntity2.setMaxThreshold(27f); - parameterRepository.saveAndFlush(parameterEntity); - parameterRepository.saveAndFlush(parameterEntity2); + ParameterEntity savedParameterEntity1 = parameterRepository.saveAndFlush(parameterEntity); + LocalizedParameterEntity localizedParameterEntity = new LocalizedParameterEntity(); + localizedParameterEntity.setDescription("Karbonathärte"); + localizedParameterEntity.setLanguage("de"); + localizedParameterEntity.setParameter_id(savedParameterEntity1.getId()); + savedParameterEntity1.setLocalizedParameterEntities(List.of(localizedParameterEntity)); + + ParameterEntity savedParameterEntity2 = parameterRepository.saveAndFlush(parameterEntity2); + LocalizedParameterEntity localizedParameterEntity2 = new LocalizedParameterEntity(); + localizedParameterEntity2.setDescription("Temperatur"); + localizedParameterEntity2.setLanguage("de"); + localizedParameterEntity2.setParameter_id(savedParameterEntity2.getId()); + savedParameterEntity2.setLocalizedParameterEntities(List.of(localizedParameterEntity2)); RemedyEntity remedyEntity = new RemedyEntity(); remedyEntity.setProductname("KH+"); diff --git a/sabi-server/src/test/java/de/bluewhale/sabi/services/MeasurementServiceTest.java b/sabi-server/src/test/java/de/bluewhale/sabi/services/MeasurementServiceTest.java index 19cc27f..1748ae7 100644 --- a/sabi-server/src/test/java/de/bluewhale/sabi/services/MeasurementServiceTest.java +++ b/sabi-server/src/test/java/de/bluewhale/sabi/services/MeasurementServiceTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 by Stefan Schubert under the MIT License (MIT). + * Copyright (c) 2024 by Stefan Schubert under the MIT License (MIT). * See project LICENSE file for the detailed terms and conditions. */ @@ -103,7 +103,7 @@ public void testFindMeasurementParameter() throws Exception { // Given already stored testdata for measurements // When - ParameterTo parameterTo = measurementService.fetchParameterInfoFor(1); + ParameterTo parameterTo = measurementService.fetchParameterInfoFor(1, "de"); // Then assertNotNull("Should not happen!",parameterTo); @@ -116,7 +116,7 @@ public void testFindInvalidMeasurementParameter() throws Exception { Integer nonExistingUnit = Integer.MAX_VALUE; // When - ParameterTo parameterTo = measurementService.fetchParameterInfoFor(nonExistingUnit); + ParameterTo parameterTo = measurementService.fetchParameterInfoFor(nonExistingUnit,"de"); // Then assertNull(parameterTo); @@ -143,7 +143,7 @@ public void testListMeasurementUnits() throws Exception { // Given already stored testdata for measurements // When - List measurementUnits = measurementService.listAllMeasurementUnits(); + List measurementUnits = measurementService.listAllMeasurementUnits("de"); // Then assertNotNull("Should not happen!",measurementUnits); diff --git a/sabi-server/src/test/java/de/bluewhale/sabi/services/rest/UnitControllerTest.java b/sabi-server/src/test/java/de/bluewhale/sabi/services/rest/UnitControllerTest.java index 5e8696e..9f2fd1d 100644 --- a/sabi-server/src/test/java/de/bluewhale/sabi/services/rest/UnitControllerTest.java +++ b/sabi-server/src/test/java/de/bluewhale/sabi/services/rest/UnitControllerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 by Stefan Schubert under the MIT License (MIT). + * Copyright (c) 2024 by Stefan Schubert under the MIT License (MIT). * See project LICENSE file for the detailed terms and conditions. */ @@ -14,9 +14,11 @@ import de.bluewhale.sabi.model.ParameterTo; import de.bluewhale.sabi.model.UnitTo; import de.bluewhale.sabi.model.UserTo; +import de.bluewhale.sabi.persistence.model.LocalizedUnitEntity; import de.bluewhale.sabi.persistence.model.ParameterEntity; import de.bluewhale.sabi.persistence.model.UnitEntity; import de.bluewhale.sabi.persistence.model.UserEntity; +import de.bluewhale.sabi.persistence.repositories.LocalizedUnitRepository; import de.bluewhale.sabi.persistence.repositories.ParameterRepository; import de.bluewhale.sabi.persistence.repositories.UnitRepository; import de.bluewhale.sabi.persistence.repositories.UserRepository; @@ -62,6 +64,8 @@ public class UnitControllerTest { @MockBean UnitRepository unitRepository; @MockBean + LocalizedUnitRepository localizedUnitRepository; + @MockBean ParameterRepository parameterRepository; @MockBean UserRepository userRepository; @@ -98,11 +102,18 @@ public void testListAvailableUnits() throws Exception { UnitTo unitTo = testDataFactory.getTestUnitTo(); UnitEntity unitEntity = unitMapper.mapUnitToEntity(unitTo); + LocalizedUnitEntity localizedUnitEntity = new LocalizedUnitEntity(); + localizedUnitEntity.setUnitId(unitEntity.getId()); + localizedUnitEntity.setDescription(unitTo.getDescription()); + localizedUnitEntity.setLanguage("en"); + unitEntity.setLocalizedUnitEntities(List.of(localizedUnitEntity)); List unitEntityList = new ArrayList(); unitEntityList.add(unitEntity); given(this.unitRepository.findAll()).willReturn(unitEntityList); + given(this.localizedUnitRepository.findByLanguageAndUnitId("en", unitEntity.getId())).willReturn(localizedUnitEntity); + // and we need a valid authentication token for our mocked user String authToken = TokenAuthenticationService.createAuthorizationTokenFor(MOCKED_USER); @@ -112,7 +123,7 @@ public void testListAvailableUnits() throws Exception { HttpEntity requestEntity = new HttpEntity<>(headers); // Notice the that the controller defines a list, the rest-template will get it as array. - ResponseEntity responseEntity = restTemplate.exchange("/api/units/list", HttpMethod.GET, requestEntity, String.class); + ResponseEntity responseEntity = restTemplate.exchange("/api/units/list/en", HttpMethod.GET, requestEntity, String.class); // then we should get a 202 as result. assertThat(responseEntity.getStatusCode(), equalTo(HttpStatus.ACCEPTED)); @@ -149,7 +160,7 @@ public void testFetchUnitParameterInfo() throws Exception { HttpEntity requestEntity = new HttpEntity<>(headers); // Notice the that the controller defines a list, the rest-template will get it as array. - ResponseEntity responseEntity = restTemplate.exchange(Endpoint.UNITS + "/parameter/" + parameterEntity.getBelongingUnitId(), HttpMethod.GET, requestEntity, String.class); + ResponseEntity responseEntity = restTemplate.exchange(Endpoint.UNITS + "/parameter/" + parameterEntity.getBelongingUnitId() + "/en", HttpMethod.GET, requestEntity, String.class); // Then // then we should get a 202 as result. diff --git a/sabi-webclient/pom.xml b/sabi-webclient/pom.xml index ba6101d..801eecd 100644 --- a/sabi-webclient/pom.xml +++ b/sabi-webclient/pom.xml @@ -10,7 +10,7 @@ de.bluewhale sabi-webclient - 1.2.6 + 1.2.7 jar sabi-webclient A JSF based webclient for sabi. diff --git a/sabi-webclient/src/main/java/de/bluewhale/sabi/webclient/apigateway/MeasurementService.java b/sabi-webclient/src/main/java/de/bluewhale/sabi/webclient/apigateway/MeasurementService.java index 485b431..0928782 100644 --- a/sabi-webclient/src/main/java/de/bluewhale/sabi/webclient/apigateway/MeasurementService.java +++ b/sabi-webclient/src/main/java/de/bluewhale/sabi/webclient/apigateway/MeasurementService.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 by Stefan Schubert under the MIT License (MIT). + * Copyright (c) 2024 by Stefan Schubert under the MIT License (MIT). * See project LICENSE file for the detailed terms and conditions. */ @@ -44,10 +44,11 @@ public interface MeasurementService extends Serializable { * Concrete user will be derived by the calling context (JWT Token Auth) * * @param pJWTBackendAuthtoken Bearer Auth string, which identifies the user against the backend. + * @param pLanguage ISO-639-1 language code for which the translation is being requested. * @return List of MeasurementReminderTo that belong to current user. List may be empty but never NULL. * @throws BusinessException in case of backend auth failures. */ - @NotNull List getMeasurementRemindersForUser(@NotNull String pJWTBackendAuthtoken) throws BusinessException; + @NotNull List getMeasurementRemindersForUser(@NotNull String pJWTBackendAuthtoken, @NotNull String pLanguage) throws BusinessException; /** @@ -58,11 +59,12 @@ public interface MeasurementService extends Serializable { * the backend introduces more units. * * @param pJWTBackendAuthtoken Bearer Auth string, which identifies the user against the backend. + * @param pLanguage ISO-639-1 language code for which the translation is being requested. * @return List of units known by the backend. * @throws BusinessException in case of backend auth failures. */ @Cacheable - @NotNull List getAvailableMeasurementUnits(@NotNull String pJWTBackendAuthtoken) throws BusinessException; + @NotNull List getAvailableMeasurementUnits(@NotNull String pJWTBackendAuthtoken, @NotNull String pLanguage) throws BusinessException; /** * List Users Measurements for a specific tank. Concrete user will be derived by the calling context @@ -105,13 +107,14 @@ public interface MeasurementService extends Serializable { void save(MeasurementTo measurement, @NotNull String pJWTBackendAuthtoken) throws BusinessException; /** - * Fetches detailed Parameterinfos for requested measurement unti + * Fetches detailed Parameterinfos for requested measurement unit * * @param selectedUnitId ID of measurement unit + * @param language ISO-639-1 language code for which the translation is being requested. * @param pJWTBackendAuthtoken Bearer Auth string, which identifies the user against the backend. * @return detailed info if available or null if it does not exists */ - @Null ParameterTo getParameterFor(@NotNull Integer selectedUnitId, @NotNull String pJWTBackendAuthtoken) throws BusinessException; + @Null ParameterTo getParameterFor(@NotNull Integer selectedUnitId, @NotNull String language, @NotNull String pJWTBackendAuthtoken) throws BusinessException; /** * Push a new Measurement reminder to the backend. diff --git a/sabi-webclient/src/main/java/de/bluewhale/sabi/webclient/apigateway/MeasurementServiceImpl.java b/sabi-webclient/src/main/java/de/bluewhale/sabi/webclient/apigateway/MeasurementServiceImpl.java index 810d645..9b589ba 100644 --- a/sabi-webclient/src/main/java/de/bluewhale/sabi/webclient/apigateway/MeasurementServiceImpl.java +++ b/sabi-webclient/src/main/java/de/bluewhale/sabi/webclient/apigateway/MeasurementServiceImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 by Stefan Schubert under the MIT License (MIT). + * Copyright (c) 2024 by Stefan Schubert under the MIT License (MIT). * See project LICENSE file for the detailed terms and conditions. */ @@ -40,14 +40,13 @@ @Slf4j public class MeasurementServiceImpl extends APIServiceImpl implements MeasurementService { - static List cachedAvailableMeasurementUnits = Collections.emptyList(); - // TODO STS (04.05.21): Revisit and check after i18n of ParameterTo... + static Map> cachedAvailableMeasurementUnits = new HashMap<>(); static Map cachedUnitParameterMap = new HashMap<>(); @Override - public List getMeasurementRemindersForUser(String pJWTBackendAuthtoken) throws BusinessException { + public List getMeasurementRemindersForUser(String pJWTBackendAuthtoken, String pLanguage) throws BusinessException { - String listMeasurementReminderUri = sabiBackendUrl + Endpoint.MEASUREMENTS + "/reminder/list"; + String listMeasurementReminderUri = sabiBackendUrl + Endpoint.MEASUREMENTS + "/reminder/list/"+pLanguage; ResponseEntity responseEntity = getAPIResponseFor(listMeasurementReminderUri, pJWTBackendAuthtoken, HttpMethod.GET); MeasurementReminderTo[] measurementReminderTos; try { @@ -102,18 +101,18 @@ public void addMeasurementReminder(MeasurementReminderTo measurementReminderTo, @Override - public @NotNull List getAvailableMeasurementUnits (@NotNull String pJWTBackendAuthtoken) throws + public @NotNull List getAvailableMeasurementUnits (@NotNull String pJWTBackendAuthtoken, @NotNull String pLanguage) throws BusinessException { - String listMeasurementUnitsUri = sabiBackendUrl + Endpoint.UNITS + "/list"; + String listMeasurementUnitsUri = sabiBackendUrl + Endpoint.UNITS + "/list" + "/" +pLanguage; - if (cachedAvailableMeasurementUnits.isEmpty()) { + if (cachedAvailableMeasurementUnits.containsKey(pLanguage) == false) { ResponseEntity responseEntity = getAPIResponseFor(listMeasurementUnitsUri, pJWTBackendAuthtoken, HttpMethod.GET); try { UnitTo[] myObjects = objectMapper.readValue(responseEntity.getBody(), UnitTo[].class); - cachedAvailableMeasurementUnits = Arrays.asList(myObjects); + cachedAvailableMeasurementUnits.put(pLanguage, Arrays.asList(myObjects)); } catch (JsonProcessingException e) { log.error(String.format("Didn't understand response from %s got parsing exception %s", listMeasurementUnitsUri, e.getMessage()), e.getMessage()); e.printStackTrace(); @@ -121,11 +120,11 @@ public void addMeasurementReminder(MeasurementReminderTo measurementReminderTo, } } - return cachedAvailableMeasurementUnits; + return cachedAvailableMeasurementUnits.get(pLanguage); } @Override - public ParameterTo getParameterFor (Integer selectedUnitId, String pJWTBackendAuthtoken) throws + public ParameterTo getParameterFor (Integer selectedUnitId, String pLanguage, String pJWTBackendAuthtoken) throws BusinessException { if (selectedUnitId != null && cachedUnitParameterMap.containsKey(selectedUnitId)) { @@ -133,7 +132,7 @@ public ParameterTo getParameterFor (Integer selectedUnitId, String pJWTBackendAu return cachedUnitParameterMap.get(selectedUnitId); } else { - String listUnitsParameterUri = sabiBackendUrl + Endpoint.UNITS + "/parameter/" + selectedUnitId; + String listUnitsParameterUri = sabiBackendUrl + Endpoint.UNITS + "/parameter/" + selectedUnitId + "/"+pLanguage; ResponseEntity responseEntity = getAPIResponseFor(listUnitsParameterUri, pJWTBackendAuthtoken, HttpMethod.GET); diff --git a/sabi-webclient/src/main/java/de/bluewhale/sabi/webclient/controller/AbstractControllerTools.java b/sabi-webclient/src/main/java/de/bluewhale/sabi/webclient/controller/AbstractControllerTools.java index 61f595e..f0d13f5 100644 --- a/sabi-webclient/src/main/java/de/bluewhale/sabi/webclient/controller/AbstractControllerTools.java +++ b/sabi-webclient/src/main/java/de/bluewhale/sabi/webclient/controller/AbstractControllerTools.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 by Stefan Schubert under the MIT License (MIT). + * Copyright (c) 2024 by Stefan Schubert under the MIT License (MIT). * See project LICENSE file for the detailed terms and conditions. */ @@ -53,8 +53,8 @@ public String getUnitSignForId(Integer unitId, List fromUnitList) { */ @NotNull public String getUnitDescriptionForId(Integer unitId, List fromUnitList) { - // TODO STS (13.04.21): Improvment: instead of providing the list of known units those should be fetched here - // wee need to change the auth scope on the api for this + // TODO STS (13.04.21): Improvement: instead of providing the list of known units those should be fetched here + // we need to change the auth scope on the api for this String result = ""; if (unitId != null) { for (UnitTo unitTo : fromUnitList) { diff --git a/sabi-webclient/src/main/java/de/bluewhale/sabi/webclient/controller/MeasurementListView.java b/sabi-webclient/src/main/java/de/bluewhale/sabi/webclient/controller/MeasurementListView.java index 446b772..fd555af 100644 --- a/sabi-webclient/src/main/java/de/bluewhale/sabi/webclient/controller/MeasurementListView.java +++ b/sabi-webclient/src/main/java/de/bluewhale/sabi/webclient/controller/MeasurementListView.java @@ -21,7 +21,7 @@ import lombok.Getter; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.context.annotation.SessionScope; +import org.springframework.web.context.annotation.RequestScope; import java.io.Serializable; import java.util.Collections; @@ -36,7 +36,7 @@ * @author Stefan Schubert */ @Named -@SessionScope +@RequestScope @Slf4j @Getter public class MeasurementListView extends AbstractControllerTools implements Serializable { @@ -74,7 +74,7 @@ public void init() { } try { - knownUnits = measurementService.getAvailableMeasurementUnits(userSession.getSabiBackendToken()); + knownUnits = measurementService.getAvailableMeasurementUnits(userSession.getSabiBackendToken(),userSession.getLanguage()); } catch (BusinessException e) { knownUnits = Collections.emptyList(); log.error(e.getLocalizedMessage()); @@ -160,7 +160,7 @@ public String getGetThresholdInfoFor(Integer unitId) { String result = ""; if (unitId != null && unitId != 0) { try { - ParameterTo parameterTo = measurementService.getParameterFor(unitId, userSession.getSabiBackendToken()); + ParameterTo parameterTo = measurementService.getParameterFor(unitId, userSession.getLanguage(), userSession.getSabiBackendToken()); Locale usersLocale = userSession.getLocale(); if (parameterTo != null && usersLocale != null) { result = String.format(usersLocale, "min = %.03f / max = %.03f", parameterTo.getMinThreshold(), parameterTo.getMaxThreshold()); diff --git a/sabi-webclient/src/main/java/de/bluewhale/sabi/webclient/controller/ReportView.java b/sabi-webclient/src/main/java/de/bluewhale/sabi/webclient/controller/ReportView.java index 881e70d..73022b7 100644 --- a/sabi-webclient/src/main/java/de/bluewhale/sabi/webclient/controller/ReportView.java +++ b/sabi-webclient/src/main/java/de/bluewhale/sabi/webclient/controller/ReportView.java @@ -28,7 +28,7 @@ import org.primefaces.model.charts.line.LineChartOptions; import org.primefaces.model.charts.optionconfig.title.Title; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.context.annotation.SessionScope; +import org.springframework.web.context.annotation.RequestScope; import java.io.Serializable; import java.time.LocalDate; @@ -46,7 +46,7 @@ * @author Stefan Schubert */ @Named -@SessionScope +@RequestScope @Slf4j @Getter @Setter @@ -246,7 +246,7 @@ private void applyThresholdLineToLineChartModell(@NotNull ChartData chartData, @ ParameterTo parameterTo = null; try { - parameterTo = measurementService.getParameterFor(selectedUnitId, userSession.getSabiBackendToken()); + parameterTo = measurementService.getParameterFor(selectedUnitId, userSession.getLanguage(),userSession.getSabiBackendToken()); } catch (Exception e) { log.error("Could not Reach Backend to access detail parameter infos for unit {}", selectedUnitId); e.printStackTrace(); @@ -302,7 +302,7 @@ public void init() { // TODO STS (12.04.21): Refactor this. To make use of the request scope here, this should went into // users session, it does not make sense that we to this in measureview and in report view again. tanks = tankService.getUsersTanks(userSession.getSabiBackendToken()); - knownUnits = measurementService.getAvailableMeasurementUnits(userSession.getSabiBackendToken()); + knownUnits = measurementService.getAvailableMeasurementUnits(userSession.getSabiBackendToken(), userSession.getLanguage()); if (tanks.size() == 1) { // default selection if user has only one tank this.selectedTankId = (tanks.get(0).getId()); diff --git a/sabi-webclient/src/main/java/de/bluewhale/sabi/webclient/controller/TankListView.java b/sabi-webclient/src/main/java/de/bluewhale/sabi/webclient/controller/TankListView.java index 2eae401..93d777b 100644 --- a/sabi-webclient/src/main/java/de/bluewhale/sabi/webclient/controller/TankListView.java +++ b/sabi-webclient/src/main/java/de/bluewhale/sabi/webclient/controller/TankListView.java @@ -18,7 +18,7 @@ import lombok.Getter; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.context.annotation.SessionScope; +import org.springframework.web.context.annotation.RequestScope; import java.io.Serializable; import java.util.ArrayList; @@ -35,7 +35,7 @@ * @author Stefan Schubert */ @Named -@SessionScope +@RequestScope @Slf4j @Getter public class TankListView implements Serializable { diff --git a/sabi-webclient/src/main/java/de/bluewhale/sabi/webclient/controller/UserProfileView.java b/sabi-webclient/src/main/java/de/bluewhale/sabi/webclient/controller/UserProfileView.java index e09afaf..48dd827 100644 --- a/sabi-webclient/src/main/java/de/bluewhale/sabi/webclient/controller/UserProfileView.java +++ b/sabi-webclient/src/main/java/de/bluewhale/sabi/webclient/controller/UserProfileView.java @@ -67,8 +67,8 @@ public void init() { selectedLocale = userSession.getLocale(); try { - measurementReminderTos = measurementService.getMeasurementRemindersForUser(userSession.getSabiBackendToken()); - knownMeasurementUnits = measurementService.getAvailableMeasurementUnits(userSession.getSabiBackendToken()); + measurementReminderTos = measurementService.getMeasurementRemindersForUser(userSession.getSabiBackendToken(),selectedLocale.getLanguage()); + knownMeasurementUnits = measurementService.getAvailableMeasurementUnits(userSession.getSabiBackendToken(), userSession.getLanguage()); } catch (BusinessException e) { measurementReminderTos = new ArrayList<>(); knownMeasurementUnits = new ArrayList<>(); @@ -125,7 +125,7 @@ public String addReminderForMeasurementUnit() { try { measurementService.addMeasurementReminder(measurementReminderTo, userSession.getSabiBackendToken()); - measurementReminderTos = measurementService.getMeasurementRemindersForUser(userSession.getSabiBackendToken()); + measurementReminderTos = measurementService.getMeasurementRemindersForUser(userSession.getSabiBackendToken(), userSession.getLanguage()); } catch (BusinessException e) { log.error("Could not add new Measurement Reminder.", e); MessageUtil.warn("messages", "common.error.internal_server_problem.t", userSession.getLocale()); diff --git a/sabi-webclient/src/main/resources/META-INF/resources/template/header.xhtml b/sabi-webclient/src/main/resources/META-INF/resources/template/header.xhtml index df1383f..756e8ae 100644 --- a/sabi-webclient/src/main/resources/META-INF/resources/template/header.xhtml +++ b/sabi-webclient/src/main/resources/META-INF/resources/template/header.xhtml @@ -1,5 +1,5 @@ @@ -12,7 +12,7 @@ - + diff --git a/sabi-webclient/src/main/resources/i18n/messages.properties b/sabi-webclient/src/main/resources/i18n/messages.properties index ece29b9..0035652 100644 --- a/sabi-webclient/src/main/resources/i18n/messages.properties +++ b/sabi-webclient/src/main/resources/i18n/messages.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2023 by Stefan Schubert under the MIT License (MIT). +# Copyright (c) 2024 by Stefan Schubert under the MIT License (MIT). # See project LICENSE file for the detailed terms and conditions. # login.welcome.h=Welcome at the SABI-Project - Seawater Aquarium Business Intelligence @@ -205,3 +205,4 @@ common.update.b=Update register.password.policy.t=(Password: Min 10 to max 20 chars. Mixture of Upper/LowerCase with Digit and Special-Character) enum.waterType.seawater.l=seawater enum.waterType.freshwater.l=freshwater +menu.b=Menu diff --git a/sabi-webclient/src/main/resources/i18n/messages_de.properties b/sabi-webclient/src/main/resources/i18n/messages_de.properties index 6200cb6..cbb0880 100644 --- a/sabi-webclient/src/main/resources/i18n/messages_de.properties +++ b/sabi-webclient/src/main/resources/i18n/messages_de.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2023 by Stefan Schubert under the MIT License (MIT). +# Copyright (c) 2024 by Stefan Schubert under the MIT License (MIT). # See project LICENSE file for the detailed terms and conditions. # register.captcha_wrongAnswer.t=Hm...das war die falsche Antwort. Bitte erneut versuchen. @@ -206,4 +206,5 @@ userprofile.meassurement.addreminder.l=Erinnerung setzen f\u00FCr: common.update.b=Aktualisieren register.password.policy.t=(Passwort: Min 10 bis 20 Zeichen. Klein/Gro\u00DFschreibung, Zahl und Sonderzeichen) enum.waterType.seawater.l=Salzwasser -enum.waterType.freshwater.l=S\u00FC\u00DFwasser \ No newline at end of file +enum.waterType.freshwater.l=S\u00FC\u00DFwasser +menu.b=Men\u00FC \ No newline at end of file diff --git a/sabi-webclient/src/main/resources/i18n/messages_en.properties b/sabi-webclient/src/main/resources/i18n/messages_en.properties index 739d963..9ec7bd5 100644 --- a/sabi-webclient/src/main/resources/i18n/messages_en.properties +++ b/sabi-webclient/src/main/resources/i18n/messages_en.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2023 by Stefan Schubert under the MIT License (MIT). +# Copyright (c) 2024 by Stefan Schubert under the MIT License (MIT). # See project LICENSE file for the detailed terms and conditions. # register.captcha_wrongAnswer.t=Sorry - wrong Answer. Please try again. @@ -204,4 +204,5 @@ userprofile.meassurement.addreminder.l=Set reminder for: common.update.b=Update register.password.policy.t=(Password: Min 10 to max 20 chars. Mixture of Upper/LowerCase with Digit and Special-Character) enum.waterType.seawater.l=seawater -enum.waterType.freshwater.l=freshwater \ No newline at end of file +enum.waterType.freshwater.l=freshwater +menu.b=Menu \ No newline at end of file diff --git a/sabi-webclient/src/main/resources/i18n/messages_es.properties b/sabi-webclient/src/main/resources/i18n/messages_es.properties index b0fe490..92d2a29 100644 --- a/sabi-webclient/src/main/resources/i18n/messages_es.properties +++ b/sabi-webclient/src/main/resources/i18n/messages_es.properties @@ -5,7 +5,7 @@ register.captcha_wrongAnswer.t=Lo sentimos - Respuesta incorrecta. Por favor, int\u00E9ntelo de nuevo. login.welcome.h=Bienvenido al proyecto SABI - Seawater Aquarium Business Intelligence logout.message.t=Su sesi\u00F3n de usuario ha finalizado. Gracias por participar en este proyecto.\ -Nos vemos \u00BFO ha cerrado la sesi\u00F3n por accidente?
~
\ +Nos vemos \u00BFO ha cerrado la sesi\u00F3n por accidente?
\

Aqu\u00ED puedes volver a unirte: logout.header.h=Adi\u00F3s - hasta la pr\u00F3xima... register.cancel.b=Cancelar @@ -42,7 +42,7 @@ La atenci\u00F3n se centra en el enfoque cient\u00EDfico. Los participantes se b Los participantes se benefician de una representaci\u00F3n gr\u00E1fica de sus datos de medici\u00F3n y de la informaci\u00F3n generada a partir del an\u00E1lisis de los datos. \ Actualmente, el proyecto se encuentra en la fase I (recopilaci\u00F3n de datos). En cuanto un n\u00FAmero suficiente de participantes\ suficientes datos de medici\u00F3n, iniciaremos la fase II (an\u00E1lisis). -preregistro.info.t=Casi perfecto. Su nombre de usuario y contrase\u00F1a han sido aceptados.\ +preregistration.info.t=Casi perfecto. Su nombre de usuario y contrase\u00F1a han sido aceptados.\ En los pr\u00F3ximos minutos recibir\u00E1 un correo electr\u00F3nico con un enlace de activaci\u00F3n para validar su direcci\u00F3n de correo electr\u00F3nico.\ Una vez que el correo electr\u00F3nico ha sido validado, puede utilizar sus credenciales para iniciar sesi\u00F3n en sabi \ a trav\u00E9s de https://sabi-project.net/login.html para\ @@ -84,8 +84,8 @@ login.forgottenPW.l=\u00BFContrase\u00F1a olvidada? \u00BFError tipogr\u00E1fico login.resetPW.b=restablecer contrase\u00F1a login.panel.h=Por favor, inicie sesi\u00F3n: projectstats.tankcount.l=Tanques registrados: -projecttats.usercount.l=Participantes del proyecto: -userportal.projecttate.l=Estado-actual-del-proyecto: +projectstats.usercount.l=Participantes del proyecto: +userportal.projectstate.l=Estado-actual-del-proyecto: userportal.currentprojectstate.l=Etapa 1 - Recogida de datos menu.measureView.l=Adquisici\u00F3n de datos de medici\u00F3n common.tankchoice.l=Tanque: @@ -99,7 +99,7 @@ credits.sponsor_wife.t=Por todas las horas extra mir\u00E1ndome delante del port common.select.l=Seleccionar una... measureview.listing.h=Grabado recientemente: crowdfounding.title.h=\u00BFD\u00F3nde ha ido a parar todo el dinero? Informe sobre peque\u00F1as finanzas: -crowdfunding.introduction.t=

Hay varias maneras de apoyar este proyecto de ciencia abierta:

\ +crowdfunding.introduction.t=

Hay varias maneras de apoyar este proyecto de ciencia abierta:

\
    \
  • Como desarrollador a trav\u00E9s de github
  • \
  • Como Participante para compartir sus datos m\u00E9tricos
  • \ @@ -158,10 +158,10 @@ sessionExpired.message.t=Su sesi\u00F3n de usuario ha alcanzado un tiempo l\u00E projectstats.measurementcount.l=Cuento de mediciones: menu.plagueView.l=Centro de plagas credits.sponsor_magazin_article.t=Para poder anunciar este proyecto a trav\u00E9s de un art\u00EDculo en la revista KORALLE-Magazine (Edici\u00F3n 136). -login.register.l=\u00BFA\u00FAn no se ha registrado? --> +login.register.l=\u00BFA\u00FAn no se ha registrado? plague.center.introduction.h=Bienvenido al Centro de Plagas SABIs. \u00BFDe qu\u00E9 se trata? plague.center.introduction.t=La visi\u00F3n central de SABI es identificar posibles correlaciones entre las mediciones de la calidad del agua y las plagas. \ -Para que esto sea posible, no s\u00F3lo deben registrarse regularmente los valores del agua, sino tambi\u00E9n la aparici\u00F3n y el curso de plagas espec\u00EDficas. +Para que esto sea posible, no s\u00F3lo deben registrarse regularmente los valores del agua, sino tambi\u00E9n la aparici\u00F3n y el curso de plagas espec\u00EDficas. \ plagas espec\u00EDficas de forma estructurada. Si el proyecto tiene \u00E9xito, podremos \ deducir la probabilidad de aparici\u00F3n de plagas en el acuario marino a partir de los valores del agua registrados \ y actuar como una especie de sistema de alerta temprana con recomendaciones sobre contramedidas adecuadas. @@ -188,7 +188,7 @@ reportview.14mp.chart.h=Revisi\u00F3n reciente de los puntos de medici\u00F3n plagueview.duration.l=Duraci\u00F3n en d\u00EDas: userportal.meassurement.reminder.h=Recordatorio de sus mediciones: userportal.meassurement.nosetting.t=Aqu\u00ED se le puede recordar si desea medir algo con regularidad. \ -Para ello, vaya a su perfil de usuario y guarde el intervalo de medici\u00F3n deseado.\ +Para ello, vaya a su perfil de usuario y guarde el intervalo de medici\u00F3n deseado. userprofile.reminderinfo.t=Si desea que se le recuerde en la p\u00E1gina de inicio que debe medir un determinado valor de agua, \ puede establecer aqu\u00ED un intervalo de medici\u00F3n para el valor correspondiente. La pr\u00F3xima vez que inicie sesi\u00F3n, \ SABI comprobar\u00E1 cu\u00E1ndo ha medido el valor del agua por \u00FAltima vez y si el intervalo de medici\u00F3n previsto ha expirado. @@ -203,4 +203,5 @@ userprofile.meassurement.addreminder.l=Configurar recordatorio para: common.update.b=Actualizar register.password.policy.t=(Contrase\u00F1a: M\u00EDnimo 10 y m\u00E1ximo 20 caracteres. Mezcla de may\u00FAsculas/min\u00FAsculas con d\u00EDgitos y caracteres especiales) enum.waterType.seawater.l=agua de mar -enum.waterType.freshwater.l=agua dulce \ No newline at end of file +enum.waterType.freshwater.l=agua dulce +menu.b=Men\u00FA \ No newline at end of file diff --git a/sabi-webclient/src/main/resources/i18n/messages_fr.properties b/sabi-webclient/src/main/resources/i18n/messages_fr.properties index 70c6200..30fb7e3 100644 --- a/sabi-webclient/src/main/resources/i18n/messages_fr.properties +++ b/sabi-webclient/src/main/resources/i18n/messages_fr.properties @@ -6,7 +6,7 @@ register.captcha_wrongAnswer.t=Mais... ce n'\u00E9tait pas la bonne r\u00E9ponse login.welcome.h=Bienvenue au projet SABI - Seawater Aquarium Business Intelligence logout.message.t=La session utilisateur a \u00E9t\u00E9 ferm\u00E9e. Nous vous remercions de votre participation au projet.
    Nous vous remercions de votre participation au projet.\ A la prochaine fois ! Ou simplement d\u00E9connect\u00E9 par erreur ?
    \ -

    Voici le retour : +

    Voici le retour: logout.header.h=\u00C0 la prochaine fois... register.cancel.b=Annuler register.register.b=Cr\u00E9er un compte utilisateur @@ -47,7 +47,6 @@ des valeurs de mesure ainsi que des connaissances acquises au cours du projet. \ Actuellement, le projet se trouve en phase I (collecte de donn\u00E9es). D\u00E8s que le nombre de \ participants se sont r\u00E9unis et ont fourni une quantit\u00E9 suffisante de donn\u00E9es de mesure \ le projet passera \u00E0 la phase II (analyse). - preregistration.info.t=Presque termin\u00E9. Le nom d'utilisateur n'\u00E9tait pas encore attribu\u00E9 et a \u00E9t\u00E9 cr\u00E9\u00E9 avec succ\u00E8s. \ Dans la minute qui suit, vous recevrez un e-mail avec un lien d'activation pour confirmer que votre adresse e-mail est valide. \ D\u00E8s que votre adresse e-mail a \u00E9t\u00E9 v\u00E9rifi\u00E9e par ce biais, votre login est activ\u00E9 et vous pouvez vous connecter via \ @@ -206,4 +205,5 @@ userprofile.meassurement.addreminder.l=D\u00E9finir un rappel pour : common.update.b=Mise \u00E0 jour register.password.policy.t=(mot de passe : min 10 \u00E0 20 caract\u00E8res. Minuscules/majuscules, chiffre et caract\u00E8res sp\u00E9ciaux) enum.waterType.seawater.l=Eau sal\u00E9e -enum.waterType.freshwater.l=Eau douce \ No newline at end of file +enum.waterType.freshwater.l=Eau douce +menu.b=Menu diff --git a/sabi-webclient/src/main/resources/i18n/messages_it.properties b/sabi-webclient/src/main/resources/i18n/messages_it.properties index d9e4c0c..b6d9fc9 100644 --- a/sabi-webclient/src/main/resources/i18n/messages_it.properties +++ b/sabi-webclient/src/main/resources/i18n/messages_it.properties @@ -47,8 +47,7 @@ valori misurati e delle conoscenze acquisite nel corso del progetto. \ Il progetto \u00E8 attualmente nella Fase I (raccolta dati). Non appena un numero sufficiente di \ partecipanti che hanno fornito un numero sufficientemente elevato di dati di misurazione, il progetto passer\u00E0 alla fase I (raccolta dati). \ dati, il progetto passer\u00E0 alla fase II (analisi). - -preregistrazione.info.t=Quasi finito. Il nome utente non era ancora stato assegnato ed \u00E8 stato creato con successo. \ +preregistration.info.t=Quasi finito. Il nome utente non era ancora stato assegnato ed \u00E8 stato creato con successo. \ Entro un minuto riceverete un'e-mail con un link di attivazione per confermare la validit\u00E0 del vostro indirizzo e-mail. \ Non appena l'indirizzo e-mail \u00E8 stato verificato, il login sar\u00E0 attivato e sar\u00E0 possibile accedere tramite \ https://sabi-project.net/login.html per accedere. @@ -99,7 +98,7 @@ measureview.value.l=Valore misurato: common.unitchoise.l=Unit\u00E0: measureview.date.l=Misurato il giorno: common.new_record.b=Nuovo inserimento -crediti.sponsor_moglie.l=moglie +credits.sponsor_wife.l=moglie credits.sponsor_wife.t=Per il tempo sacrificato trascorso insieme davanti al computer dopo il lavoro. common.select.l=Selezione... measureview.listing.h=Le ultime misurazioni: @@ -139,8 +138,8 @@ measureview.mode.editrecord.l=Modalit\u00E0: modifica set di dati esistenti measureview.mode.newrecord.l=Modalit\u00E0: aggiungere un record di dati userprofile.h=Profilo utente per common.additional.info.t=A causa del budget volutamente ridotto all'inizio del progetto, questo servizio \u00E8 attualmente \ -esclusivamente nel "nuovo" Internet basato su IPv6. -accessibile. Se il provider Internet locale non fornisce l'IPv6, \code(0144)\. +esclusivamente nel "nuovo" Internet basato su IPv6. \ +accessibile. Se il provider Internet locale non fornisce l'IPv6, \ c'\u00E8 di solito la possibilit\u00E0 di accedervi tramite telefono cellulare (con WLAN disattivata). impressum.role.t=Fondatore e responsabile del progetto: gdpr.menu.l=GDPR @@ -159,21 +158,21 @@ sessionExpired.message.t=La sessione utente \u00E8 scaduta dopo un timeout. Se q

    Eseguire nuovamente il login: projectstats.measurementcount.l=Numero di dati di misurazione: menu.plagueView.l=Centro della peste -credits.sponsor_magazine_article.t=Per aver pubblicizzato il progetto in un articolo della rivista KORALLE (numero 136). +credits.sponsor_magazin_article.t=Per aver pubblicizzato il progetto in un articolo della rivista KORALLE (numero 136). login.register.l=Senza login? --> -plague.centre.introduction.h=Benvenuto nel centro peste della SABI. Di cosa si tratta? -plague.centre.introduction.t=La visione centrale della SABI \u00E8 quella di identificare possibili correlazioni tra le misurazioni della qualit\u00E0 dell'acqua e le pestilenze. \ +plague.center.introduction.h=Benvenuto nel centro peste della SABI. Di cosa si tratta? +plague.center.introduction.t=La visione centrale della SABI \u00E8 quella di identificare possibili correlazioni tra le misurazioni della qualit\u00E0 dell'acqua e le pestilenze. \ Per rendere possibile questo, non solo i valori dell'acqua devono essere registrati regolarmente, ma soprattutto l'insorgenza e il decorso di specifiche pestilenze. \ e il decorso di specifiche epidemie devono essere registrati in modo strutturato. Se il progetto avr\u00E0 successo, potremo \u00B4\u00B4 ricavare la probabilit\u00E0 di insorgenza delle piaghe. \ ricavare la probabilit\u00E0 di insorgenza di parassiti nell'acquario marino sulla base dei valori dell'acqua riportati e utilizzarla come una sorta di sistema di \u25A0 allarme precoce con raccomandazioni per le opportune contromisure. \ come una sorta di sistema di allerta precoce con raccomandazioni di contromisure adeguate. -plague.centre.mystatus.h=Peste attualmente segnalate nei miei acquari: -plague.centre.mystatus.noplague.t=-- nessuna voce -- -plague.centre.addrecord.h=Segnala una nuova piaga o aggiorna lo stato: -plague.centre.info.t=La storia della peste attuale viene riassunta automaticamente e termina solo con il messaggio di terminazione. +plague.center.mystatus.h=Peste attualmente segnalate nei miei acquari: +plague.center.mystatus.noplague.t=-- nessuna voce -- +plague.center.addrecord.h=Segnala una nuova piaga o aggiorna lo stato: +plague.center.info.t=La storia della peste attuale viene riassunta automaticamente e termina solo con il messaggio di terminazione. \ messaggio di terminazione. -plague.centre.history.h=Direttore delle piaghe sopravvissute -plague.centre.history.norecords.t=-- nessuna voce fino ad ora -- +plague.center.history.h=Direttore delle piaghe sopravvissute +plague.center.history.norecords.t=-- nessuna voce fino ad ora -- tankview.tempApiKey.l=ApiKey per i messaggi automatici di temperatura dai dispositivi IoT: tankview.tempApiKey.b=generazione chiave API projectstats.plagueObservationRecordCount.l=evoluzioni osservate della peste: @@ -206,4 +205,5 @@ userprofile.meassurement.addreminder.l=Impostare un promemoria per: common.update.b=Aggiornamento register.password.policy.t=(Password: minimo 10-20 caratteri. Maiuscole/minuscole, numeri e caratteri speciali). enum.waterType.seawater.l=acqua salata -enum.waterType.freshwater.l=acqua dolce \ No newline at end of file +enum.waterType.freshwater.l=acqua dolce +menu.b=Menu