script: Ignore units and allow translated strings as translate-values

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4120
This commit is contained in:
Simon Frei 2017-04-29 15:48:00 +00:00 committed by Jakob Borg
parent 5045842f4f
commit 9de6cdddfd

View File

@ -24,7 +24,7 @@ var attrRe = regexp.MustCompile(`\{\{'([^']+)'\s+\|\s+translate\}\}`)
// exceptions to the untranslated text warning // exceptions to the untranslated text warning
var noStringRe = regexp.MustCompile( var noStringRe = regexp.MustCompile(
`^((\W*\{\{.*?\}\} ?.?\W*)+(\.stignore)?|[^a-zA-Z]+.?[^a-zA-Z]*|Twitter|JS\W?|DEV|https?://\S+)$`) `^((\W*\{\{.*?\}\} ?.?\/?.?(bps)?\W*)+(\.stignore)?|[^a-zA-Z]+.?[^a-zA-Z]*|[kMGT]?B|Twitter|JS\W?|DEV|https?://\S+)$`)
// exceptions to the untranslated text warning specific to aboutModalView.html // exceptions to the untranslated text warning specific to aboutModalView.html
var aboutRe = regexp.MustCompile(`^([^/]+/[^/]+|(The Go Pro|Font Awesome ).+)$`) var aboutRe = regexp.MustCompile(`^([^/]+/[^/]+|(The Go Pro|Font Awesome ).+)$`)
@ -40,7 +40,6 @@ func generalNode(n *html.Node, filename string) {
for _, a := range n.Attr { for _, a := range n.Attr {
if a.Key == "translate" { if a.Key == "translate" {
translate = true translate = true
break
} else if a.Key == "id" && (a.Val == "contributor-list" || } else if a.Key == "id" && (a.Val == "contributor-list" ||
a.Val == "copyright-notices") { a.Val == "copyright-notices") {
// Don't translate a list of names and // Don't translate a list of names and