Class ModelTranslations
- java.lang.Object
-
- ch.sahits.game.openpatrician.model.service.ModelTranslations
-
- All Implemented Interfaces:
IModelTranslationService
@Service @Lazy @DependentInitialisation(StartNewGameBean.class) public class ModelTranslations extends java.lang.Object implements IModelTranslationService
Service that provides the proper translations for enumeration values and constants.- Author:
- Andi Hotz, (c) Sahits GmbH, 2014 Created on Nov 26, 2014
-
-
Constructor Summary
Constructors Constructor Description ModelTranslations()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetEndOfWeek(java.time.LocalDateTime date)Retrieve the date of the end of the week in the form {Day of month}.java.lang.StringgetLocalDisplayDistinctArticle(boolean male, boolean uppercase)java.lang.StringgetLocalDisplayName(IBuilding building)Localize the name of the buildingjava.lang.StringgetLocalDisplayName(ESocialRank rank)java.lang.StringgetLocalDisplayName(ICareer career)java.lang.StringgetLocalDisplayName(IWare ware)Retrieve the localized display name forid.java.lang.StringgetLocalDisplayName(EShipType type)java.lang.StringgetLocalDisplayName(EWeapon weapon)Retrieve the localized display name forid.java.lang.StringgetLocalDisplayNameWithArticle(EShipType type, boolean upperCaseArticle)java.lang.StringgetStartOfWeek(java.time.LocalDateTime date)Retrieve the date of the start of the week in the form {Day of month}.java.lang.StringtoDisplayString(int day, int month, int year)Retrieve the date in long form {Day of month}.java.lang.StringtoDisplayString(java.time.LocalDateTime date)Create a string representation for the user interface of the form {Day of month}.java.lang.StringtoDisplayStringLongFormat(java.time.LocalDateTime date)Create a string representation for the user interface of the form {Day of month}.java.lang.StringtoShortDate(java.time.LocalDateTime c)Convert the date into the form {Day in month}.
-
-
-
Method Detail
-
getLocalDisplayName
public java.lang.String getLocalDisplayName(EWeapon weapon)
Retrieve the localized display name forid.- Parameters:
weapon- ennumeration- Returns:
- localized weapon name.
-
getLocalDisplayName
public java.lang.String getLocalDisplayName(IWare ware)
Retrieve the localized display name forid.- 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
-
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 monthmonth- of yearyear- to be displayed- Returns:
- localized long date.
-
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:
toDisplayStringin interfaceIModelTranslationService- 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
-
getLocalDisplayName
public java.lang.String getLocalDisplayName(IBuilding building)
Localize the name of the building- Parameters:
building- to be localized- Returns:
- localized building name.
-
-