i18n translation not working in AEM 6.4 | Community
Skip to main content
vijays80591732
Level 3
Dec 31, 2018 11:28 AM UTC
Solved

i18n translation not working in AEM 6.4

Hi All,

After upgrade my project from AEM 6.1 to AEM 6.4, i18n translation is not working. I could see this has been deprecated in AEM 6.4. Is this causing any issue?

I tried with below steps but didn't workout,

1) Restarted Apache Sling Internationalization Support.

2) added sling:message in /oak:index/nodetype -> declaringNodeTypes and reindexed.

can anyone help me on this?

smacdonald2008​ kautuksahni​ Arun Patidar​ jorgeh3453905​

Thanks,

Vijay

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
vijays80591732
vijays80591732Accepted solution
Level 3
Jan 9, 2019 12:48 PM UTC

Hi Puzanovs,

Thanks for your input and the issue has been fixed now.

The way of calling the service (I18nTenantRuntimeExtension) should be something different in AEM 6.4.

Below are the fix:

  • Removed felix annotations and placed OSGI annotations.
  • Added org.apache.sling.scripting.sightly.compiler.java dependency in parent.pom and bundle.pom. This is the dependency which we are using for RuntimeExtension interface.
  • In I18nTenantRuntimeExtension the property value is “i18ntranslation” in AEM 6.1, but the property value should be “i18n” in AEM 6.4

In felix (before fix):

@Component

@Service(RuntimeExtension.class)

@Properties({

    @Property(name = RuntimeExtension.NAME,

        value = I18nTenantRuntimeExtension.I18N_TRANSLATION_FUNCTION),

    @Property(name = Constants.SERVICE_RANKING, intValue = 10000)})

public class I18nTenantRuntimeExtension implements RuntimeExtension {

  @Reference

  private ConfigService configService;

  private static final Logger LOG = LoggerFactory.getLogger(I18nTenantRuntimeExtension.class);

  public static final String I18N_TRANSLATION_FUNCTION = "i18nTranslation";

  public static final String KEY_PREFIX = "Key: ";

In OSGI (after fix):

@Component(

        service = RuntimeExtension.class,immediate = true,

        property = {

I18nTenantRuntimeExtension.NAME + "=" + I18nTenantRuntimeExtension.I18N,

I18nTenantRuntimeExtension.SERVICE_RANKING + "=" + 10000

        }

)

public class I18nTenantRuntimeExtension implements RuntimeExtension {

  private ConfigService configService;

  @Reference

  public void bindConfigService(ConfigService configService) {

    this.configService = configService;

  }

  public void unbindConfigService(ConfigService configService) {

    this.configService = configService;

  }

  private static final Logger LOG = LoggerFactory.getLogger(I18nTenantRuntimeExtension.class);

  public static final String NAME = "org.apache.sling.scripting.sightly.extension.name";

  public static final String I18N = "i18n";

  public static final String SERVICE_RANKING = "service.ranking";

  public static final String KEY_PREFIX = "Key: ";

Thanks smacdonald2008​ gauravb10066713​ bsloki​ @Jorg

Thanks,
Vijay

13 replies

vijays80591732
Level 3
Jan 1, 2019 5:39 AM UTC

Hi Gaurav,

I'm facing this issue in my local AEM 6.4 and I logged in as Admin. I have verified the ACLs and I'm having the read access for the below highlighted services. Do I need to check anything apart from this?

Thanks,

Vijay

Translate
smacdonald2008
Level 10
Dec 31, 2018 5:58 PM UTC

I asked our translation team to check this thread.

Translate
Gaurav-Behl
Level 10
Dec 31, 2018 1:27 PM UTC

Try this - i18n translations are no longer working

Validate the ACL of service user that you have created in 6.4. Logging-in as Admin or any other user won't help but the ACLs configured on the service user.

Translate