Search in sources :

Example 1 with PersonnelServiceFacade

use of org.mifos.application.admin.servicefacade.PersonnelServiceFacade in project head by mifos.

the class MessageLookup method getLocalizedMessage.

public static String getLocalizedMessage(String key) {
    // nothing found so return the key
    String message = key;
    PersonnelServiceFacade personnelServiceFacade = ApplicationContextProvider.getBean(PersonnelServiceFacade.class);
    MessageSource messageSource = ApplicationContextProvider.getBean(MessageSource.class);
    if (personnelServiceFacade != null) {
        String value = messageSource.getMessage(key, null, personnelServiceFacade.getUserPreferredLocale());
        if (StringUtils.isNotEmpty(message)) {
            message = value;
        }
    }
    return message;
}
Also used : MessageSource(org.springframework.context.MessageSource) PersonnelServiceFacade(org.mifos.application.admin.servicefacade.PersonnelServiceFacade)

Example 2 with PersonnelServiceFacade

use of org.mifos.application.admin.servicefacade.PersonnelServiceFacade in project head by mifos.

the class BaseActionForm method getLocalizedMessage.

protected String getLocalizedMessage(String key) {
    // nothing found so return the key
    String message = key;
    PersonnelServiceFacade personnelServiceFacade = ApplicationContextProvider.getBean(PersonnelServiceFacade.class);
    MessageSource messageSource = ApplicationContextProvider.getBean(MessageSource.class);
    if (personnelServiceFacade != null) {
        String value = messageSource.getMessage(key, null, personnelServiceFacade.getUserPreferredLocale());
        if (StringUtils.isNotEmpty(message)) {
            message = value;
        }
    }
    return message;
}
Also used : MessageSource(org.springframework.context.MessageSource) PersonnelServiceFacade(org.mifos.application.admin.servicefacade.PersonnelServiceFacade)

Aggregations

PersonnelServiceFacade (org.mifos.application.admin.servicefacade.PersonnelServiceFacade)2 MessageSource (org.springframework.context.MessageSource)2