code: public void sort() {
          if (IndexTerm.getTermLocale() == null ||
                  IndexTerm.getTermLocale().getLanguage().trim().length() == 0) {
              IndexTerm.setTermLocale(new Locale(LANGUAGE_EN,
                      COUNTRY_US));
          }
  
          /*
           * Sort all the terms recursively
           */
          for (final IndexTerm term : termList) {
              term.sortSubTerms();
          }
  
          Collections.sort(termList);
      }
docs: Sort term list extracted from dita files base on Locale.