diff --git a/src/main/java/me/crespel/karaplan/domain/User.java b/src/main/java/me/crespel/karaplan/domain/User.java index 988da3d..06c73f8 100644 --- a/src/main/java/me/crespel/karaplan/domain/User.java +++ b/src/main/java/me/crespel/karaplan/domain/User.java @@ -17,6 +17,7 @@ import jakarta.validation.constraints.NotNull; import org.hibernate.annotations.SortComparator; +import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.data.annotation.CreatedDate; import org.springframework.data.annotation.LastModifiedDate; import org.springframework.data.jpa.domain.support.AuditingEntityListener; @@ -101,6 +102,9 @@ public Locale getLocaleParsed() { if (locale != null) { localeParsed = Locale.forLanguageTag(locale); } + if (locale == null) { + localeParsed = LocaleContextHolder.getLocale(); + } return localeParsed; }