I18n Sling Models Injector

Available since version 4.0.0


Allows for Sling Models classes and interfaces to be injected with I18n objects and / or values.

Injections are available when adapting either a Resource or SlingHttpServletRequest object. Note: Out of performance reasons, only the I18n can be injected using the generic @Inject. The String values need to be annotated with @I18N.


@Model(adaptables = { SlingHttpServletRequest.class, Resource.class })
public class TestModel {

    private I18n i18n;

    private String backButtonText
    public void init(){
        String text = i18n.get("com.adobe.i18n.backButtonText");
        //do something
    public String getBackButtonText() {
        return backButtonText;