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

Side by Side Diff: grit/gather/interface.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, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « grit/gather/admin_template_unittest.py ('k') | grit/gather/skeleton_gatherer.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 '''Interface for all gatherers. 6 '''Interface for all gatherers.
7 ''' 7 '''
8 8
9 9
10 from grit import clique 10 from grit import clique
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 92
93 Raises: 93 Raises:
94 grit.exception.NotReady() if used before Parse() has been successfully 94 grit.exception.NotReady() if used before Parse() has been successfully
95 called. 95 called.
96 grit.exception.NoSuchTranslation() if 'pseudo_if_not_available' and 96 grit.exception.NoSuchTranslation() if 'pseudo_if_not_available' and
97 fallback_to_english are both false and there is no translation for the 97 fallback_to_english are both false and there is no translation for the
98 requested language. 98 requested language.
99 ''' 99 '''
100 raise NotImplementedError() 100 raise NotImplementedError()
101 101
102 @staticmethod
102 def FromFile(rc_file, extkey=None, encoding = 'cp1252'): 103 def FromFile(rc_file, extkey=None, encoding = 'cp1252'):
103 '''Loads the resource from the file 'rc_file'. Optionally an external key 104 '''Loads the resource from the file 'rc_file'. Optionally an external key
104 (which gets passed to the gatherer's constructor) can be specified. 105 (which gets passed to the gatherer's constructor) can be specified.
105 106
106 If 'rc_file' is a filename, it will be opened for reading using 'encoding'. 107 If 'rc_file' is a filename, it will be opened for reading using 'encoding'.
107 Otherwise the 'encoding' parameter is ignored. 108 Otherwise the 'encoding' parameter is ignored.
108 109
109 Args: 110 Args:
110 rc_file: file('') | 'filename.rc' 111 rc_file: file('') | 'filename.rc'
111 extkey: e.g. 'ID_MY_DIALOG' 112 extkey: e.g. 'ID_MY_DIALOG'
112 encoding: 'utf-8' 113 encoding: 'utf-8'
113 114
114 Return: 115 Return:
115 grit.gather.interface.GathererBase subclass 116 grit.gather.interface.GathererBase subclass
116 ''' 117 '''
117 raise NotImplementedError() 118 raise NotImplementedError()
118 FromFile = staticmethod(FromFile)
119 119
120 def SubstituteMessages(self, substituter):
121 '''Applies substitutions to all messages in the gatherer.
122
123 Args:
124 substituter: a grit.util.Substituter object.
125 '''
126 pass
127
OLDNEW
« no previous file with comments | « grit/gather/admin_template_unittest.py ('k') | grit/gather/skeleton_gatherer.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698