diff --git a/src/main/java/net/gepafin/tendermanagement/config/MessageSourceConfig.java b/src/main/java/net/gepafin/tendermanagement/config/MessageSourceConfig.java index 6f9767c6..79ef4d11 100644 --- a/src/main/java/net/gepafin/tendermanagement/config/MessageSourceConfig.java +++ b/src/main/java/net/gepafin/tendermanagement/config/MessageSourceConfig.java @@ -1,8 +1,12 @@ package net.gepafin.tendermanagement.config; +import org.springframework.web.servlet.LocaleResolver; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.support.ResourceBundleMessageSource; +import org.springframework.web.servlet.i18n.SessionLocaleResolver; + +import java.util.Locale; @Configuration public class MessageSourceConfig { @@ -14,4 +18,12 @@ public class MessageSourceConfig { messageSource.setUseCodeAsDefaultMessage(true); return messageSource; } + + @Bean + public LocaleResolver localeResolver() { + // Force the locale resolver to always use Italian + SessionLocaleResolver localeResolver = new SessionLocaleResolver(); + localeResolver.setDefaultLocale(Locale.ITALIAN); + return localeResolver; + } } diff --git a/src/main/resources/message_en.properties b/src/main/resources/message_en.properties index c7b9a3f3..51d4983d 100644 --- a/src/main/resources/message_en.properties +++ b/src/main/resources/message_en.properties @@ -53,7 +53,7 @@ call.update.successfully=Call updated successfully. call.fetch.success=Call details fetched successfully. call.not.found=Call not found. score.not.null=Score cannot be null or cannot be zero. -field.not.null={0} cannot be null. +field.not.null={0} cannot be empty. field.not.empty={0} cannot be empty. update_call_status_success_msg=The call status has been updated successfully. status.same.error=Status is already set. diff --git a/src/main/resources/message_it.properties b/src/main/resources/message_it.properties index 88d38ab1..8689fc2c 100644 --- a/src/main/resources/message_it.properties +++ b/src/main/resources/message_it.properties @@ -53,7 +53,7 @@ call.update.successfully=Chiamata aggiornata con successo. call.fetch.success=Dettagli della chiamata recuperati con successo. call.not.found=Chiamata non trovata. score.not.null=Il punteggio non pu? essere nullo o zero. -field.not.null={0} non pu? essere nullo. +field.not.null={0} non puņ essere vuoto. field.not.empty=la {0} non pu? essere vuota. update_call_status_success_msg=Lo stato della chiamata ? stato aggiornato con successo. status.same.error=Lo stato ? gi? impostato. @@ -387,3 +387,4 @@ validation.failed.checklist=Convalida fallita per la checklist. error.invalid.limit=Il limite dovrebbe essere compreso tra 1 e 3000. insufficient.score.msg = Punteggio non sufficiente per passaggio alla valutazione tecnica ed economico finanziaria +validation.table.message=I dati per il campo {0} non sono presenti. \ No newline at end of file