feat: add localized ledger explorer dashboard
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package web
|
||||
|
||||
import (
|
||||
"net/http/httptest"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestLocaleURLPreservesExplorerQuery(t *testing.T) {
|
||||
request := httptest.NewRequest("GET", "/accounts?class=USER_AVAILABLE&asset_id=9", nil)
|
||||
value := localeURL(request, LocalePersian)
|
||||
for _, expected := range []string{"/accounts?", "class=USER_AVAILABLE", "asset_id=9", "lang=fa"} {
|
||||
if !strings.Contains(value, expected) {
|
||||
t.Fatalf("locale URL %q did not preserve %q", value, expected)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestTranslationFallsBackToEnglish(t *testing.T) {
|
||||
if got := tr(Locale("invalid"), "overview"); got != "Overview" {
|
||||
t.Fatalf("unexpected fallback translation: %q", got)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user