io.spotnext.cms.service.impl.CmsMessageResolver Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spot-cms-base Show documentation
Show all versions of spot-cms-base Show documentation
The spOt microservice framework.
package io.spotnext.cms.service.impl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.thymeleaf.context.ITemplateContext;
import org.thymeleaf.messageresolver.IMessageResolver;
import io.spotnext.core.infrastructure.service.L10nService;
@Service
public class CmsMessageResolver implements IMessageResolver {
@Autowired
protected L10nService l10nService;
@Override
public String getName() {
return this.getClass().getSimpleName();
}
@Override
public Integer getOrder() {
return 0;
}
@Override
public String resolveMessage(ITemplateContext context, Class> origin, String key, Object[] messageParameters) {
return l10nService.getMessage(key, null, messageParameters);
}
@Override
public String createAbsentMessageRepresentation(ITemplateContext context, Class> origin, String key,
Object[] messageParameters) {
return "[" + key + "]";
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy