Class SIPTranslateMessageService
java.lang.Object
one.x1f.sip.foundation.core.translate.SIPTranslateMessageService
- All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean
@Service
public class SIPTranslateMessageService
extends Object
implements org.springframework.beans.factory.InitializingBean
Service used to get translated messages
-
Constructor Summary
ConstructorsConstructorDescriptionSIPTranslateMessageService
(org.springframework.context.MessageSource messageSource, TranslateConfiguration translateConfiguration) Creates new instance ofSIPTranslateMessageService
-
Method Summary
Modifier and TypeMethodDescriptionvoid
static SIPTranslateMessageService
get()
Get a translated message by providing its keygetTranslatedMessage
(String key, Object... args) Get a translated message by providing its key and message arguments
-
Constructor Details
-
SIPTranslateMessageService
@Autowired public SIPTranslateMessageService(org.springframework.context.MessageSource messageSource, TranslateConfiguration translateConfiguration) Creates new instance ofSIPTranslateMessageService
- Parameters:
messageSource
-MessageSource
translateConfiguration
-TranslateConfiguration
-
-
Method Details
-
getTranslatedMessage
Get a translated message by providing its key- Parameters:
key
- a key to which a message is bound- Returns:
- a translated message
-
getTranslatedMessage
Get a translated message by providing its key and message arguments- Parameters:
key
- a key to which a message is boundargs
- an array of arguments that will be filled in for params within the message- Returns:
- translated message
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
-
get
-