Skip to content

Commit 9230a1e

Browse files
committed
#2464 test for missing English translations for scripts
1 parent 54d5448 commit 9230a1e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

devtools/scripts/releaseAddOn.groovy

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ int updateScripts(Proxy.Node root) {
4949
errors << "The root node ${root.plainText} has no 'scripts' child. Please create it or better run 'Check Add-on'"
5050
return 0
5151
}
52+
Proxy.Node englishTranslationsNode = root.children.find{ it.plainText == 'translations' }?.children?.find{ it.plainText == 'en' }
53+
if (!englishTranslationsNode) {
54+
errors << "There are no English translations. Please create them or better run 'Check Add-on'"
55+
return 0
56+
}
5257
scriptsNode.children.findAll{ it.plainText.matches('.*\\.\\w+') }.each {
5358
File scriptFile = new File(scriptsDir, expand(root, it.plainText))
5459
if (!scriptFile.exists()) {
@@ -60,6 +65,9 @@ int updateScripts(Proxy.Node root) {
6065
count++
6166
}
6267
it.folded = true
68+
def menuTitleKey = it.attributes.getFirst('menuTitleKey')
69+
if (!englishTranslationsNode.attributes.getFirst(menuTitleKey))
70+
errors << "Missing English translation for '${menuTitleKey}'. 'Check Add-on' may help."
6371
}
6472
return count
6573
}

0 commit comments

Comments
 (0)