Merge features-c2: the docs portal and its links in English and Turkish

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ilker ManapandClaude Opus 5.5 committed 2026-10-05 00:15:25 +02:00
commit e8a62b23b7
201 files changed
+26276 -630

No files matched your search

+21
View File
@@ -457,3 +457,24 @@ func TestACatalogueWithAKeyTwiceIsRefused(t *testing.T) {
t.Errorf("%v %v", m, err)
}
}
// The docs portal's own pages are translated; the documents themselves are
// English, and a Turkish reader is told so rather than left to find out.
func TestTheDocsPortalSpeaksTurkishAroundEnglishDocuments(t *testing.T) {
r := httptest.NewRequest(http.MethodGet, "/docs", nil)
r.Header.Set("Accept-Language", "tr")
w := httptest.NewRecorder()
Docs("v1", true)(w, r)
body := w.Body.String()
for _, want := range []string{`<html lang="tr">`, "llmgw belgeleri", "Tüm belgeler", "yalnızca İngilizcedir", `href="/_lang/en"`} {
if !strings.Contains(body, want) {
t.Errorf("the Turkish docs index lacks %q", want)
}
}
r = httptest.NewRequest(http.MethodGet, "/docs", nil)
w = httptest.NewRecorder()
Docs("v1", true)(w, r)
if strings.Contains(w.Body.String(), "İngilizce") || !strings.Contains(w.Body.String(), "Every document") {
t.Error("the English docs index is not as it was")
}
}