class LanguageComparator implements Comparator<Language> {

  private final ResourceBundle messages;
  private final String extLangSuffix;

  LanguageComparator(ResourceBundle messages, String extLangSuffix) {
    this.messages = messages;
    this.extLangSuffix = extLangSuffix;
  }

  @Override
  public int compare(Language o1, Language o2) {
    return getTranslatedName(o1).compareTo(getTranslatedName(o2));
  }

  private String getTranslatedName(Language language) {<FILL_FUNCTION_BODY>}
}

    if (language.isExternal()) {
      return language.getName() + extLangSuffix;
    } else {
      return language.getTranslatedName(messages);
    }
  
<no_super_class>