for (final GWTJahiaLanguage sourceLang : JahiaGWTParameters.getSiteLanguages()) {
for (final GWTJahiaLanguage destLang : JahiaGWTParameters.getSiteLanguages()) {
if (!destLang.getDisplayName().equals(sourceLang.getDisplayName()) &&
(destLang.getLanguage().equals(currentLanguage) ||
sourceLang.getLanguage().equals(currentLanguage))) {
final LinkerSelectionContext lh = linker.getSelectionContext();
if (PermissionsUtils.isPermitted("jcr:modifyProperties_" + JahiaGWTParameters.getWorkspace() + "_" + destLang.getLanguage(), lh.getSelectionPermissions())) {
MenuItem item = new MenuItem(
sourceLang.getDisplayName() + "->" + destLang.getDisplayName());
item.addSelectionListener(new SelectionListener<MenuEvent>() {
@Override
public void componentSelected(MenuEvent ce) {
if (lh.getSingleSelection() != null) {
new TranslateContentEngine(lh.getSingleSelection(), linker,
sourceLang, destLang).show();
}
}
});
menu.add(item);