Skip to content

Commit

Permalink
Sort locale hyperlinks in chat listing
Browse files Browse the repository at this point in the history
  • Loading branch information
Meorawr committed Nov 9, 2022
1 parent 1e4038e commit 78916d4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions AddonLocale.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,15 @@ end
local function DisplayAvailableAddonLocales()
DisplayFormattedMessage(L.PROMPT_SET_LOCALE_CHOICES)

local locales = {}

for localeName in pairs(AVAILABLE_LOCALES) do
table.insert(locales, localeName)
end

table.sort(locales)

for _, localeName in ipairs(locales) do
local choiceLinkPrefix, choiceLinkSuffix = GenerateCommandHyperlink("set", localeName)
local choiceLinkInfix = GenerateLocaleDisplayText(localeName)
local choiceLink = string.join("", choiceLinkPrefix, choiceLinkInfix, choiceLinkSuffix)
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## 1.1
- '/addonlocale <locale>' is now accepted as an alias for '/addonlocale set <locale>'.
- The list of locales printed by `/addonlocale set' is now sorted.
- Updated TOC for patch 10.0.2.

## 1.0
Expand Down

0 comments on commit 78916d4

Please sign in to comment.