// install language sub-menus
Map<String, String> supportedLanguages = Messages.getResourceBundle().getSupportedLanguages();
if ( supportedLanguages != null && supportedLanguages.keySet() != null && !supportedLanguages.isEmpty() ) {
MenuBar langMenu = (MenuBar) languageMenu.getManagedObject();
langMenu.insertSeparator( 0 );
for ( String lang : supportedLanguages.keySet() ) {
MenuItem langMenuItem = new MenuItem( supportedLanguages.get( lang ), new SwitchLocaleCommand( lang ) );
langMenuItem.getElement().setId( supportedLanguages.get( lang ) + "_menu_item" ); //$NON-NLS-1$
langMenu.insertItem( langMenuItem, 0 );
}