Get all Available Translations of a Folder or Document
The org.hippoecm.hst.content.beans.standard.HippoBean interface (implemented by e.g. HippoDocument or HippoFolder, so typically, all your document beans will benefit from this) has the following method:
The HippoAvailableTranslationsBean contains all the translations for your document or folder bean. HippoAvailableTranslationsBean provides the following methods:
In your template, you can directly get all available translations from a bean without writing any code yourself. The example snippet below loops through all available translations. bean.localeString returns the name of the bean's language.
JSP
Freemarker
Because crBean.availableTranslations.translations returns the list of translations including the current one, the snippet below is an example that treats the current bean differently (no link). We use the equalComparator for this (see org.hippoecm.hst.content.beans.standard.HippoBean javadocs)
JSP
Freemarker