How to translate a client page with AEM admin language when access as AEM admin? | Community
Skip to main content
bhoang
Level 4
October 1, 2018
Solved

How to translate a client page with AEM admin language when access as AEM admin?

  • October 1, 2018
  • 2 replies
  • 1034 views

Hi Friends,

I created a configuration page which have many checkboxs for AEM admin config the fields will display on the registration form. I config the configuration page use by the admin only. When the admin access to this page and checked to configuration to save into service. My site have two language (English, Chineses). I want to translate all labels and select options follow the AEM admin language. However, The AEM admin language translate when i viewproperties a page. It doesn't work when I open the configuration.html page. when i open the configuration.html page it translate follow the language of the page path. Example: en/configuration.html, zh/configuration.html . I want it follow by the AEM user language.

Please help me the solution.

Thank you so much,

BienHV

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Peter_Puzanovs

Dear BienHV,

Have a look at follow help page[0]

[0] Internationalizing UI Strings

Quote: "

To present the string in the language that is specified in the user account, use the following constructor (after importing com.day.cq.i18n.I18n):

I18n i18n = new I18n(slingRequest);

"

If I am not mistaken you should be able to achieve language requirement by using this construct.

Regards,

Peter

2 replies

Peter_Puzanovs
Community Advisor
Peter_PuzanovsCommunity AdvisorAccepted solution
Community Advisor
October 1, 2018

Dear BienHV,

Have a look at follow help page[0]

[0] Internationalizing UI Strings

Quote: "

To present the string in the language that is specified in the user account, use the following constructor (after importing com.day.cq.i18n.I18n):

I18n i18n = new I18n(slingRequest);

"

If I am not mistaken you should be able to achieve language requirement by using this construct.

Regards,

Peter

raj_mandalapu
Level 7
October 1, 2018

If the labels are authorable from the component dialog then you dont need i18n you can directly author labels by editing respective locale-specific registration components.

If the labels are not authorable then you must use 118n to implement internationalization. you can check below link to implement localization using slightly

i18n implementation using Sightly | TO THE NEW Blog