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

Unified Diff: grit/format/chrome_messages_json_unittest.py

Issue 1410023007: Skip missing translations when generating JSON resources. (Closed) Base URL: https://chromium.googlesource.com/external/grit-i18n.git@master
Patch Set: Created 5 years, 2 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
« grit/format/chrome_messages_json.py ('K') | « 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: grit/format/chrome_messages_json_unittest.py
diff --git a/grit/format/chrome_messages_json_unittest.py b/grit/format/chrome_messages_json_unittest.py
index 373751eadc868c4ca5a7cf5fa7bb2eb826e35cea..4386247885e8949c24ca8f8c555be2349c9a24b1 100644
--- a/grit/format/chrome_messages_json_unittest.py
+++ b/grit/format/chrome_messages_json_unittest.py
@@ -107,6 +107,29 @@ class ChromeMessagesJsonFormatUnittest(unittest.TestCase):
"""
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>
+ <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())
+
class DummyOutput(object):
« grit/format/chrome_messages_json.py ('K') | « grit/format/chrome_messages_json.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698