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

Side by Side Diff: grit/gather/txt.py

Issue 1442863002: Remove contents of grit's SVN repository. (Closed) Base URL: http://grit-i18n.googlecode.com/svn/trunk/
Patch Set: Created 5 years, 1 month 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/tr_html_unittest.py ('k') | grit/gather/txt_unittest.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/env python
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
4 # found in the LICENSE file.
5
6 '''Supports making amessage from a text file.
7 '''
8
9 from grit.gather import interface
10 from grit import tclib
11
12
13 class TxtFile(interface.GathererBase):
14 '''A text file gatherer. Very simple, all text from the file becomes a
15 single clique.
16 '''
17
18 def Parse(self):
19 self.text_ = self._LoadInputFile()
20 self.clique_ = self.uberclique.MakeClique(tclib.Message(text=self.text_))
21
22 def GetText(self):
23 '''Returns the text of what is being gathered.'''
24 return self.text_
25
26 def GetTextualIds(self):
27 return [self.extkey]
28
29 def GetCliques(self):
30 '''Returns the MessageClique objects for all translateable portions.'''
31 return [self.clique_]
32
33 def Translate(self, lang, pseudo_if_not_available=True,
34 skeleton_gatherer=None, fallback_to_english=False):
35 return self.clique_.MessageForLanguage(lang,
36 pseudo_if_not_available,
37 fallback_to_english).GetRealContent()
OLDNEW
« no previous file with comments | « grit/gather/tr_html_unittest.py ('k') | grit/gather/txt_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698