Might want to keep English as a valid language...

This commit is contained in:
Jakob Borg 2014-07-28 15:17:43 +02:00
parent 6805ac915b
commit 5b9469eed3
3 changed files with 7 additions and 6 deletions

File diff suppressed because one or more lines are too long

View File

@ -30,18 +30,19 @@ func main() {
var langs []string var langs []string
for code, stat := range stats { for code, stat := range stats {
shortCode := code[:2] shortCode := code[:2]
if shortCode == "en" {
continue
}
if pct := 100 * stat.Translated / (stat.Translated + stat.Untranslated); pct < 95 { if pct := 100 * stat.Translated / (stat.Translated + stat.Untranslated); pct < 95 {
log.Printf("Skipping language %q (too low completion ratio %d%%)", shortCode, pct) log.Printf("Skipping language %q (too low completion ratio %d%%)", shortCode, pct)
os.Remove("lang-" + shortCode + ".json") os.Remove("lang-" + shortCode + ".json")
continue continue
} }
langs = append(langs, shortCode)
if shortCode == "en" {
continue
}
log.Printf("Updating language %q", shortCode) log.Printf("Updating language %q", shortCode)
langs = append(langs, shortCode)
resp := req("https://www.transifex.com/api/2/project/syncthing/resource/gui/translation/" + code) resp := req("https://www.transifex.com/api/2/project/syncthing/resource/gui/translation/" + code)
var t translation var t translation
err := json.NewDecoder(resp.Body).Decode(&t) err := json.NewDecoder(resp.Body).Decode(&t)

View File

@ -9,7 +9,7 @@
var syncthing = angular.module('syncthing', ['pascalprecht.translate']); var syncthing = angular.module('syncthing', ['pascalprecht.translate']);
var urlbase = 'rest'; var urlbase = 'rest';
var validLangs = ["de","es","fr","pt","sv"]; var validLangs = ["de","en","es","fr","pt","sv"];
syncthing.config(function ($httpProvider, $translateProvider) { syncthing.config(function ($httpProvider, $translateProvider) {
$httpProvider.defaults.xsrfHeaderName = 'X-CSRF-Token'; $httpProvider.defaults.xsrfHeaderName = 'X-CSRF-Token';