Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Unified Diff: tools/grit/grit/format/chrome_messages_json_unittest.py

Issue 1676793002: Skip missing translations when generating JSON resources. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix fake-bidi support Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/grit/grit/format/chrome_messages_json.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/grit/grit/format/chrome_messages_json_unittest.py
diff --git a/tools/grit/grit/format/chrome_messages_json_unittest.py b/tools/grit/grit/format/chrome_messages_json_unittest.py
index ec188cc508f9156d505fd929df800521d5d151a4..0a3ae2e940c6d503578ba183091c88cc951b7fe1 100755
--- a/tools/grit/grit/format/chrome_messages_json_unittest.py
+++ b/tools/grit/grit/format/chrome_messages_json_unittest.py
@@ -108,7 +108,8 @@ class ChromeMessagesJsonFormatUnittest(unittest.TestCase):
""")
buf = StringIO.StringIO()
- build.RcBuilder.ProcessNode(root, DummyOutput('chrome_messages_json', 'fr'), buf)
+ build.RcBuilder.ProcessNode(root, DummyOutput('chrome_messages_json', 'fr'),
+ buf)
output = buf.getvalue()
test = u"""
{
@@ -118,6 +119,31 @@ class ChromeMessagesJsonFormatUnittest(unittest.TestCase):
"ID_HELLO_USER": {
"message": "H\\u00e9P\\u00e9ll\\u00f4P\\u00f4 %s"
}
+}
+"""
+ self.assertEqual(test.strip(), output.strip())
+
+ def testSkipMissingTranslations(self):
+ grd = """<?xml version="1.0" encoding="UTF-8"?>
+<grit latest_public_release="2" current_release="3" source_lang_id="en"
+ base_dir="%s">
+ <outputs>
+ </outputs>
+ <release seq="3" allow_pseudo="False">
+ <messages fallback_to_english="true">
+ <message name="ID_HELLO_NO_TRANSLATION">Hello not translated</message>
+ </messages>
+ </release>
+</grit>"""
+ root = grd_reader.Parse(StringIO.StringIO(grd), dir=".")
+
+ buf = StringIO.StringIO()
+ build.RcBuilder.ProcessNode(root, DummyOutput('chrome_messages_json', 'fr'),
+ buf)
+ output = buf.getvalue()
+ test = u"""
+{
+
}
"""
self.assertEqual(test.strip(), output.strip())
« no previous file with comments | « tools/grit/grit/format/chrome_messages_json.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698