Terminal/discordapps.dev

Languages should be sort in alphabetical order

p4rkrs opened this issue · 2 comments

As the title says, it will be nice to have the list of languages in alphabetical order, to make it easier to search.

7coil commented

I've put my brain to this now, and am drafting some ideas on how to make this work

The easiest method of doing this would be using clientside JavaScript, as the server would have i18n outside of the template to process the order of the internationalised languages. Will look at soon

7coil commented

This has been pushed to ls13
Wow it's been nearly 4 months.

this.state.unusedLanguages
  .map(language => {
    return {
      language,
      message: intl.formatMessage({
        id: `locales.${language}`
      })
    }
  })
  .sort((a, b) => a.message.localeCompare(b.message))
  .map(({language, message}) => {
    return (
      <option value={language}>{message || ''}</option>
    )
  })