Index: tools/grit/grit/tclib.py |
diff --git a/tools/grit/grit/tclib.py b/tools/grit/grit/tclib.py |
index 846ce15135e26989a9aadb3692a013512e342c1d..d97d6756a37611db62063f407e7677bdc0217c4d 100644 |
--- a/tools/grit/grit/tclib.py |
+++ b/tools/grit/grit/tclib.py |
@@ -144,14 +144,24 @@ class BaseMessage(object): |
class Message(BaseMessage): |
'''A message.''' |
- def __init__(self, text='', placeholders=[], description='', meaning=''): |
+ def __init__(self, text='', placeholders=[], description='', meaning='', |
+ assigned_id=None): |
BaseMessage.__init__(self, text, placeholders, description, meaning) |
+ self.assigned_id = assigned_id |
def ToTclibMessage(self): |
msg = grit.extern.tclib.Message('utf-8', meaning=self.meaning) |
self.FillTclibBaseMessage(msg) |
return msg |
+ def GetId(self): |
+ '''Use the assigned id if we have one.''' |
+ if self.assigned_id: |
+ return self.assigned_id |
+ |
+ return BaseMessage.GetId(self) |
+ |
+ |
class Translation(BaseMessage): |
'''A translation.''' |