Class ModelTranslations

    • Field Detail

      • locale

        @Autowired
        private Locale locale
      • messages

        @Autowired
        @Qualifier("messageSource")
        private org.springframework.context.MessageSource messages
    • Constructor Detail

      • ModelTranslations

        public ModelTranslations()
    • Method Detail

      • getLocalDisplayName

        public java.lang.String getLocalDisplayName​(EWeapon weapon)
        Retrieve the localized display name for id.
        Parameters:
        weapon - ennumeration
        Returns:
        localized weapon name.
      • getLocalDisplayName

        public java.lang.String getLocalDisplayName​(IWare ware)
        Retrieve the localized display name for id.
        Parameters:
        ware - to be localized
        Returns:
        localized ware name
      • getLocalDisplayName

        public java.lang.String getLocalDisplayName​(ICareer career)
      • getLocalDisplayName

        public java.lang.String getLocalDisplayName​(ESocialRank rank)
      • getLocalDisplayName

        public java.lang.String getLocalDisplayName​(EShipType type)
      • getLocalDisplayNameWithArticle

        public java.lang.String getLocalDisplayNameWithArticle​(EShipType type,
                                                               boolean upperCaseArticle)
      • getLocalDisplayDistinctArticle

        public java.lang.String getLocalDisplayDistinctArticle​(boolean male,
                                                               boolean uppercase)
      • toShortDate

        public java.lang.String toShortDate​(java.time.LocalDateTime c)
        Convert the date into the form {Day in month}. {Month}
        Parameters:
        c - date to be localized
        Returns:
        localized short date format
      • getEndOfWeekInternal

        private java.time.LocalDateTime getEndOfWeekInternal​(java.time.LocalDateTime date)
        Retrieve the date of the of the Sunday of last week.
        Parameters:
        date - for which to calculate the end of week
        Returns:
        local date of the last Sunday
      • getEndOfWeek

        public java.lang.String getEndOfWeek​(java.time.LocalDateTime date)
        Retrieve the date of the end of the week in the form {Day of month}. {Month}. The week ends with Sunday
        Parameters:
        date - from which to calculate the last Sunday
        Returns:
        localized short date of the last Sunday.
      • toDisplayString

        public java.lang.String toDisplayString​(int day,
                                                int month,
                                                int year)
        Retrieve the date in long form {Day of month}. {Month} {Year}.
        Parameters:
        day - of month
        month - of year
        year - to be displayed
        Returns:
        localized long date.
      • toDisplayStringLongFormat

        private java.lang.String toDisplayStringLongFormat​(int day,
                                                           int month,
                                                           int year)
      • toDisplayString

        public java.lang.String toDisplayString​(java.time.LocalDateTime date)
        Create a string representation for the user interface of the form {Day of month}. {Month} {Year}.
        Specified by:
        toDisplayString in interface IModelTranslationService
        Parameters:
        date - to be localized in the long form
        Returns:
        localized long date of date
      • toDisplayStringLongFormat

        public java.lang.String toDisplayStringLongFormat​(java.time.LocalDateTime date)
        Create a string representation for the user interface of the form {Day of month}. {Month} {Year} with long month format.
        Parameters:
        date - to be localized in the long form
        Returns:
        localized long date of date
      • getStartOfWeek

        public java.lang.String getStartOfWeek​(java.time.LocalDateTime date)
        Retrieve the date of the start of the week in the form {Day of month}. {Month}. The week starts with Monday.
        Parameters:
        date - from which to calculate the last Monday
        Returns:
        localized short date of the last Monday per date
      • getStartOfWeekInternal

        private java.time.LocalDateTime getStartOfWeekInternal​(java.time.LocalDateTime date)
        Retrieve the date of the start of the last week
        Returns:
        Date of the Monday of the previous week.
      • getLocalDisplayName

        public java.lang.String getLocalDisplayName​(IBuilding building)
        Localize the name of the building
        Parameters:
        building - to be localized
        Returns:
        localized building name.