From fb977dc61d867640722505b641cc14d74f2d1dbd Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Mon, 3 Mar 2025 08:11:20 +0100 Subject: [PATCH] build: correct API call for Weblate statistics Something changed... --- script/weblatedl.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/script/weblatedl.go b/script/weblatedl.go index 730c841cd..692cca11e 100644 --- a/script/weblatedl.go +++ b/script/weblatedl.go @@ -45,11 +45,11 @@ func main() { } log.Println(curValidLangs) - resp := req("https://hosted.weblate.org/exports/stats/syncthing/gui/?format=json", token) - - var stats []stat - err := json.NewDecoder(resp.Body).Decode(&stats) - if err != nil { + resp := req("https://hosted.weblate.org/api/components/syncthing/gui/statistics/", token) + var statRes struct { + Results []stat + } + if err := json.NewDecoder(resp.Body).Decode(&statRes); err != nil { log.Fatal(err) } resp.Body.Close() @@ -57,7 +57,7 @@ func main() { names := make(map[string]string) var langs []string - for _, stat := range stats { + for _, stat := range statRes.Results { code := reformatLanguageCode(stat.Code) pct := 100 * stat.Translated / stat.Total if _, valid := curValidLangs[code]; pct < 75 || !valid && pct < 95 {