mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2026-02-22 06:34:36 +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:
committed by
Andrew Camilleri
parent
3d3016fdca
commit
0119ad452b
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user