feat: add localized ledger explorer dashboard

This commit is contained in:
2026-08-15 00:47:56 +03:30
parent ce5f8b4a84
commit 5b4cb5a2a3
31 changed files with 5458 additions and 42 deletions
+23
View File
@@ -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)
}
}