Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

how to get a node or page language?

Avatar

Not applicable

For example: there is a node:/content/geometrixx/en/services, so you can see the page is English. But the developer how to use JCR API to get the language?

Anyone experience on it please comment here, thanks a lot.

1 Accepted Solution

Avatar

Correct answer by
Employee

If you have a Page object already, you can just do page.getLanguage(false). See http://docs.adobe.com/docs/fr/aem/6-0/develop/ref/javadoc/com/day/cq/wcm/api/Page.html#getLanguage(b...)

Regards,

Justin

View solution in original post

4 Replies

Avatar

Correct answer by
Employee

If you have a Page object already, you can just do page.getLanguage(false). See http://docs.adobe.com/docs/fr/aem/6-0/develop/ref/javadoc/com/day/cq/wcm/api/Page.html#getLanguage(b...)

Regards,

Justin

Avatar

Not applicable

Thanks for your reply, How to get the jar to invoke it's method?

Avatar

Not applicable

Now i get the jar, and i invode this method " LanguageUtil.getLanguageRoot(path)", but the result is not my need. For example: " LanguageUtil.getLanguageRoot(/content/geometrixx/en/services);" it will return "/content/geometrixx/en". Actually if there is any API to get language, like the country code or language name "en" "fr" and so on.