loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Improve backport-locales.go (#23807)

ps: there are more broken translation strings in 1.20 (main), most of
them are still caused by incorrect quoting/unquoting. For example,
translators might write text ``` `my text ```, such incorrect encoding
might break crowdin & Gitea's locale package.

In the future, a Go `update-locales.go` should replace the legacy
`update-locales.sh`.

authored by

wxiaoguang and committed by
GitHub
71afbcaf 74225033

+5 -4
+5 -4
build/backport-locales.go
··· 77 77 if secNew.HasKey(keyEnUs.Name()) { 78 78 oldStr := secOld.Key(keyEnUs.Name()).String() 79 79 newStr := secNew.Key(keyEnUs.Name()).String() 80 - // A bug: many of new translations with ";" are broken in Crowdin (due to last messy restoring) 81 - // As the broken strings are gradually fixed, this workaround check could be removed (in a few months?) 82 - if strings.Contains(oldStr, ";") && !strings.Contains(newStr, ";") { 83 - println("skip potential broken string", path, secEnUS.Name(), keyEnUs.Name()) 80 + if oldStr != "" && strings.Count(oldStr, "%") != strings.Count(newStr, "%") { 81 + fmt.Printf("WARNING: locale %s [%s]%s has different number of arguments, skipping\n", path, secEnUS.Name(), keyEnUs.Name()) 82 + fmt.Printf("\told: %s\n", oldStr) 83 + fmt.Printf("\tnew: %s\n", newStr) 84 + fmt.Println("---- ") 84 85 continue 85 86 } 86 87 secOld.Key(keyEnUs.Name()).SetValue(newStr)