Expand my Community achievements bar.

SOLVED

How to get support language item list using API?

Avatar

Former Community Member

Hi there,

I realize that under the path: /libs/wcm/core/resources/languages here list lots of language.

1) These language are the AEM only support language list?

2)How to use API to get these language and return HashMap<String, String> ? In other word, how to get AEM support language and country item list?

Anyone could help point out the way? Thanks a lot in advance.

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Hi,

From my point of view these items there are just translations of language and country code to an english country and a language name, there are not outgoing references to other parts of the repository. So most likeley they are just used in the user preferences dialog. But in my projects I never used these list.

And afaik there is no direct API available to read this list, but it should be easy to do it yourself.

kind regards,
Jörg

View solution in original post

4 Replies

Avatar

Correct answer by
Employee Advisor

Hi,

From my point of view these items there are just translations of language and country code to an english country and a language name, there are not outgoing references to other parts of the repository. So most likeley they are just used in the user preferences dialog. But in my projects I never used these list.

And afaik there is no direct API available to read this list, but it should be easy to do it yourself.

kind regards,
Jörg

Avatar

Level 10

A Jorg pointed out - they are just JCR resources. Use the JCR API to query these and add them to a map (or what ever you want to do) using Java logic. If you are going to query these from within an OSGi bundle, be sure to avoid using the getAdministrativeResourceResolver. This method is deprecated in AEM 6.  

Avatar

Former Community Member

Hi Shekhar,

Thanks for your reply, but not to my question.