#266596 by pwolanin: menu performance improvement to not localize menu items which are not accessible