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

Unified Diff: grit/format/js_map_format.py

Issue 9965022: Allow substitution of messages as variables in other messages. (Closed) Base URL: https://grit-i18n.googlecode.com/svn/trunk
Patch Set: Fix unit tests for policy writers. Created 8 years, 9 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 | « grit/format/interface.py ('k') | grit/format/policy_templates/template_formatter.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: grit/format/js_map_format.py
diff --git a/grit/format/js_map_format.py b/grit/format/js_map_format.py
index 2eedbfbb5c780b39f3683560f25ee768cf084684..d17617982249f0810f23940807c4ae086e6ba866 100644
--- a/grit/format/js_map_format.py
+++ b/grit/format/js_map_format.py
@@ -18,13 +18,10 @@ from grit.node import io
class TopLevel(interface.ItemFormatter):
"""Writes out the required preamble for JS files."""
- def Format(self, item, lang='en', begin_item=True, output_dir='.'):
+ def Format(self, item, lang='en', output_dir='.'):
"""Format the JS file header."""
assert isinstance(lang, types.StringTypes)
- if not begin_item:
- return ''
- else:
- return '''// Copyright %d Google Inc. All Rights Reserved.
+ return '''// Copyright %d Google Inc. All Rights Reserved.
// This file is automatically generated by GRIT. Do not edit.
''' % (util.GetCurrentYear())
@@ -32,21 +29,15 @@ class TopLevel(interface.ItemFormatter):
class StringTable(interface.ItemFormatter):
"""Writes out the string table."""
- def Format(self, item, lang='en', begin_item=True, output_dir='.'):
- if begin_item:
- return ''
- else:
- return '\n'
+ def FormatEnd(self, item, lang='en', output_dir='.'):
+ return '\n'
class Message(interface.ItemFormatter):
"""Writes out a single message."""
- def Format(self, item, lang='en', begin_item=True, output_dir='.'):
+ def Format(self, item, lang='en', output_dir='.'):
"""Format a single message."""
- if not begin_item:
- return ''
-
from grit.node import message
assert isinstance(lang, types.StringTypes)
« no previous file with comments | « grit/format/interface.py ('k') | grit/format/policy_templates/template_formatter.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698