mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-09 14:50:56 +00:00
Might want to keep English as a valid language...
This commit is contained in:
parent
6805ac915b
commit
5b9469eed3
File diff suppressed because one or more lines are too long
@ -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)
|
||||||
|
@ -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';
|
||||||
|
Loading…
Reference in New Issue
Block a user