001/*-
002 * #%L
003 * Smile CDR - CDR
004 * %%
005 * Copyright (C) 2016 - 2024 Smile CDR, Inc.
006 * %%
007 * All rights reserved.
008 * #L%
009 */
010package ca.cdr.api.i18n;
011
012import ca.cdr.api.annotations.CdrPublicAPI;
013import jakarta.annotation.Nonnull;
014
015import java.time.ZonedDateTime;
016import java.util.Date;
017
018/**
019 * This interface permits you to fetch messages out of the cdr-messages.properties file for localization
020 */
021@CdrPublicAPI
022public interface ILocalizer {
023
024        String formatDateDaysElapsed(Date theDate);
025
026        @Nonnull
027        String formatDateTime(Date theDate);
028
029        @Nonnull
030        String formatTime(Date theDate);
031
032        @SuppressWarnings("unused")
033        /**
034         * Used in Thymeleaf templates - Returns an empty string if the parameter is null
035         */
036        @Nonnull
037        String formatDate(Date theDate);
038
039        @SuppressWarnings("unused")
040        /**
041         * Used in Thymeleaf templates - Returns an empty string if the parameter is null
042         */
043        @Nonnull
044        String formatDateTimeMillis(Date theDate);
045
046        String getMessage(Class<?> theType, String theKey, Object... theParameters);
047
048        @SuppressWarnings("null")
049        @Nonnull
050        String getMessage(String theQualifiedKey, Object... theParameters);
051
052        String getMessageAndEvaluateAsMarkdown(String theQualifiedKey, Object... theParameters);
053
054        boolean hasKey(String theKey);
055
056        ZonedDateTime convertServerTimeToUserTime(Date theDate);
057}