Threshold for existing languages to be included (75%)

This commit is contained in:
Jakob Borg 2014-10-08 13:57:11 +02:00
parent fcf60e7f7c
commit 9eb185ec39

View File

@ -63,12 +63,11 @@ func main() {
var langs []string
for code, stat := range stats {
code = strings.Replace(code, "_", "-", 1)
if !curValidLangs[code] {
if pct := 100 * stat.Translated / (stat.Translated + stat.Untranslated); pct < 95 {
log.Printf("Skipping language %q (too low completion ratio %d%%)", code, pct)
os.Remove("lang-" + code + ".json")
continue
}
pct := 100 * stat.Translated / (stat.Translated + stat.Untranslated)
if pct < 75 || !curValidLangs[code] && pct < 95 {
log.Printf("Skipping language %q (too low completion ratio %d%%)", code, pct)
os.Remove("lang-" + code + ".json")
continue
}
langs = append(langs, code)