mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 06:24:24 +01:00
async i18n and json translation format (#369)
* start working on loading locales async and as json * finish off langs and UI * fix path * fix tests
This commit is contained in:
committed by
Nicolas Dorier
parent
aa1ac3da50
commit
f23e2a3ec4
@@ -58,7 +58,7 @@ namespace BTCPayServer.Models.StoreViewModels
|
||||
|
||||
public void SetLanguages(LanguageService langService, string defaultLang)
|
||||
{
|
||||
defaultLang = defaultLang ?? "en-US";
|
||||
defaultLang = defaultLang ?? "en";
|
||||
var choices = langService.GetLanguages().Select(o => new Format() { Name = o.DisplayName, Value = o.Code }).ToArray();
|
||||
var chosen = choices.FirstOrDefault(f => f.Value == defaultLang) ?? choices.FirstOrDefault();
|
||||
Languages = new SelectList(choices, nameof(chosen.Value), nameof(chosen.Name), chosen);
|
||||
|
||||
Reference in New Issue
Block a user