Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

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

Avatar

Level 4

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

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

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

Avatar

Level 8

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