mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-22 22:25:28 +01:00
Order language dropdown in CheckoutExperience
Solves the same issue as described in the first part of #2971 and solved in #2972, except in the Settings instead of the checkout UI.
This commit is contained in:
parent
3d3016fdca
commit
0119ad452b
1 changed files with 1 additions and 1 deletions
|
@ -21,7 +21,7 @@ namespace BTCPayServer.Models.StoreViewModels
|
|||
public void SetLanguages(LanguageService langService, string defaultLang)
|
||||
{
|
||||
defaultLang = langService.GetLanguages().Any(language => language.Code == defaultLang) ? defaultLang : "en";
|
||||
var choices = langService.GetLanguages().Select(o => new Format() { Name = o.DisplayName, Value = o.Code }).ToArray();
|
||||
var choices = langService.GetLanguages().Select(o => new Format() { Name = o.DisplayName, Value = o.Code }).ToArray().OrderBy(o => o.Name);
|
||||
var chosen = choices.FirstOrDefault(f => f.Value == defaultLang) ?? choices.FirstOrDefault();
|
||||
Languages = new SelectList(choices, nameof(chosen.Value), nameof(chosen.Name), chosen);
|
||||
DefaultLang = chosen.Value;
|
||||
|
|
Loading…
Add table
Reference in a new issue