Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: build.py

Issue 29587910: Issue 104 - added checktranslations function
Patch Set: Proposed changes Created Oct. 28, 2017, 4:21 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | localeTools.py » ('j') | localeTools.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build.py
diff --git a/build.py b/build.py
index aa3c2035eea5688fcbbd9468ccafa250757f161c..4e42f3bd9f561d74c66a6204f5b8c99487134143 100644
--- a/build.py
+++ b/build.py
@@ -382,6 +382,16 @@ def updatePSL(baseDir, scriptName, opts, args, type):
publicSuffixListUpdater.updatePSL(baseDir)
+def check_translations(baseDir, scriptName, opts, args, type):
+ from buildtools.packager import readMetadata
+ metadata = readMetadata(baseDir, type)
+
+ localeConfig = readLocaleConfig(baseDir, type, metadata)
+
+ import buildtools.localeTools as localetools
+ localetools.check_translations(localeConfig)
+
+
with addCommand(lambda baseDir, scriptName, opts, args, type: usage(scriptName, type), ('help', '-h', '--help')) as command:
command.shortDescription = 'Show this message'
@@ -440,6 +450,10 @@ with addCommand(updatePSL, 'updatepsl') as command:
command.description = 'Downloads Public Suffix List (see http://publicsuffix.org/) and generates lib/publicSuffixList.js from it.'
command.supportedTypes = {'chrome'}
+with addCommand(check_translations, 'checktranslations') as command:
+ command.shortDescription = 'Perform translation checks.'
+ command.description = 'Checks translations files for structure and for overlong translations.'
+
def getType(baseDir, scriptName, args):
# Look for an explicit type parameter (has to be the first parameter)
« no previous file with comments | « no previous file | localeTools.py » ('j') | localeTools.py » ('J')

Powered by Google App Engine
This is Rietveld