diff --git a/gui/default/syncthing/core/aboutModalView.html b/gui/default/syncthing/core/aboutModalView.html
index eff2b17b2..478b31322 100644
--- a/gui/default/syncthing/core/aboutModalView.html
+++ b/gui/default/syncthing/core/aboutModalView.html
@@ -18,7 +18,7 @@ Jakob Borg, Audrius Butkevicius, Alexander Graf, Anderson Mesquita, Antony Male,
Syncthing includes the following software or portions thereof:
-
+
- Bootstrap, Copyright © 2011-2016 Twitter, Inc.
- AngularJS, Copyright © 2010-2016 Google, Inc.
- bkaradzic/go-lz4, Copyright © 2011-2012 Branimir Karadzic, 2013 Damian Gryski.
diff --git a/script/translate.go b/script/translate.go
index 89d767636..358df70a3 100644
--- a/script/translate.go
+++ b/script/translate.go
@@ -22,16 +22,30 @@ import (
var trans = make(map[string]string)
var attrRe = regexp.MustCompile(`\{\{'([^']+)'\s+\|\s+translate\}\}`)
+// exceptions to the untranslated text warning
+var noStringRe = regexp.MustCompile(
+ `^((\W*\{\{.*?\}\} ?.?\W*)+(\.stignore)?|[^a-zA-Z]+.?[^a-zA-Z]*|Twitter|JS\W?|DEV|https?://\S+)$`)
+
+// exceptions to the untranslated text warning specific to aboutModalView.html
+var aboutRe = regexp.MustCompile(`^([^/]+/[^/]+|(The Go Pro|Font Awesome ).+)$`)
+
func generalNode(n *html.Node, filename string) {
translate := false
if n.Type == html.ElementNode {
if n.Data == "translate" { // for Text
translate = true
+ } else if n.Data == "style" {
+ return
} else {
for _, a := range n.Attr {
if a.Key == "translate" {
translate = true
break
+ } else if a.Key == "id" && (a.Val == "contributor-list" ||
+ a.Val == "copyright-notices") {
+ // Don't translate a list of names and
+ // copyright notices of other projects
+ return
} else {
if matches := attrRe.FindStringSubmatch(a.Val); len(matches) == 2 {
translation(matches[1])
@@ -41,7 +55,9 @@ func generalNode(n *html.Node, filename string) {
}
} else if n.Type == html.TextNode {
v := strings.TrimSpace(n.Data)
- if len(v) > 1 && !(strings.HasPrefix(v, "{{") && strings.HasSuffix(v, "}}")) {
+ if len(v) > 1 && !noStringRe.MatchString(v) &&
+ !(filename == "aboutModalView.html" && aboutRe.MatchString(v)) &&
+ !(filename == "logbar.html" && (v == "warn" || v == "errors")) {
log.Println("Untranslated text node (" + filename + "):")
log.Print("\t" + v)
}