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

Unified Diff: tools/grit/grit/node/message.py

Issue 18478: Include webkit strings in test shell data pack. (Closed)
Patch Set: remove header Created 11 years, 11 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/node/include.py ('k') | webkit/glue/webkit_strings.grd » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/grit/grit/node/message.py
diff --git a/tools/grit/grit/node/message.py b/tools/grit/grit/node/message.py
index 3614362e6b3b4b8c98ff867184e8b896db439bbd..66afa645685fc0f1e20975a22c545b1ec0542cf6 100644
--- a/tools/grit/grit/node/message.py
+++ b/tools/grit/grit/node/message.py
@@ -174,6 +174,18 @@ class MessageNode(base.ContentNode):
else:
return self.attrs['offset']
+ def GetDataPackPair(self, output_dir, lang):
+ '''Returns a (id, string) pair that represents the string id and the string
+ in utf8. This is used to generate the data pack data file.
+ '''
+ from grit.format import rc_header
+ id_map = rc_header.Item.tids_
+ id = id_map[self.GetTextualIds()[0]]
+
+ message = self.ws_at_start + self.Translate(lang) + self.ws_at_end
+ # |message| is a python unicode string, so convert to a utf8 byte stream.
+ return id, message.encode('utf8')
+
# static method
def Construct(parent, message, name, desc='', meaning='', translateable=True):
'''Constructs a new message node that is a child of 'parent', with the
« no previous file with comments | « tools/grit/grit/node/include.py ('k') | webkit/glue/webkit_strings.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698