@Override
  public int compare(Portlet portlet1, Portlet portlet2) {
    String portletTitle1 = StringPool.BLANK;
    String portletTitle2 = StringPool.BLANK;

    if (_servletContext != null) {
      portletTitle1 = PortalUtil.getPortletTitle(portlet1, _servletContext, _locale);
      portletTitle2 = PortalUtil.getPortletTitle(portlet2, _servletContext, _locale);
    } else {
      portletTitle1 = PortalUtil.getPortletTitle(portlet1, _locale);
      portletTitle2 = PortalUtil.getPortletTitle(portlet2, _locale);
    }

    if (Validator.isNull(portletTitle1) && Validator.isNull(portletTitle2)) {

      return 0;
    }

    if (Validator.isNull(portletTitle1)) {
      return 1;
    }

    if (Validator.isNull(portletTitle2)) {
      return -1;
    }

    Collator collator = Collator.getInstance(_locale);

    return collator.compare(portletTitle1, portletTitle2);
  }
  @Override
  public String getName(Locale locale) {
    ResourceBundle resourceBundle =
        ResourceBundleUtil.getBundle("content.Language", locale, getClass());

    String portletTitle = PortalUtil.getPortletTitle(WikiPortletKeys.WIKI, resourceBundle);

    return portletTitle.concat(StringPool.SPACE).concat(LanguageUtil.get(locale, "template"));
  }
  protected String getPortletTitle(
      PortletRequest portletRequest, Portlet portlet, PortletPreferences portletPreferences) {

    ThemeDisplay themeDisplay = (ThemeDisplay) portletRequest.getAttribute(WebKeys.THEME_DISPLAY);

    String portletTitle =
        PortletConfigurationUtil.getPortletTitle(portletPreferences, themeDisplay.getLanguageId());

    if (Validator.isNull(portletTitle)) {
      ServletContext servletContext = (ServletContext) portletRequest.getAttribute(WebKeys.CTX);

      portletTitle = PortalUtil.getPortletTitle(portlet, servletContext, themeDisplay.getLocale());
    }

    return portletTitle;
  }