comparison roundup/cgi/TAL/talgettext.py @ 2802:e816a232f988

don't collect empty msgids
author Alexander Smishlajev <a1s@users.sourceforge.net>
date Wed, 20 Oct 2004 10:23:37 +0000
parents 85cbfc4a5946
children 6e3e4f24c753
comparison
equal deleted inserted replaced
2801:ee9c3b850f9e 2802:e816a232f988
13 # 13 #
14 ############################################################################## 14 ##############################################################################
15 # Modifications for Roundup: 15 # Modifications for Roundup:
16 # 1. commented out ITALES references 16 # 1. commented out ITALES references
17 # 2. escape quotes and line feeds in msgids 17 # 2. escape quotes and line feeds in msgids
18 # 3. don't collect empty msgids
18 19
19 """Program to extract internationalization markup from Page Templates. 20 """Program to extract internationalization markup from Page Templates.
20 21
21 Once you have marked up a Page Template file with i18n: namespace tags, use 22 Once you have marked up a Page Template file with i18n: namespace tags, use
22 this program to extract GNU gettext .po file entries. 23 this program to extract GNU gettext .po file entries.
41 from roundup.cgi.TAL.TALInterpreter import TALInterpreter 42 from roundup.cgi.TAL.TALInterpreter import TALInterpreter
42 from roundup.cgi.TAL.DummyEngine import DummyEngine 43 from roundup.cgi.TAL.DummyEngine import DummyEngine
43 #from ITALES import ITALESEngine 44 #from ITALES import ITALESEngine
44 from roundup.cgi.TAL.TALDefs import TALESError 45 from roundup.cgi.TAL.TALDefs import TALESError
45 46
46 __version__ = '$Revision: 1.5 $' 47 __version__ = '$Revision: 1.6 $'
47 48
48 pot_header = '''\ 49 pot_header = '''\
49 # SOME DESCRIPTIVE TITLE. 50 # SOME DESCRIPTIVE TITLE.
50 # Copyright (C) YEAR ORGANIZATION 51 # Copyright (C) YEAR ORGANIZATION
51 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. 52 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
116 117
117 def translate(self, msgid, domain=None, mapping=None, default=None, 118 def translate(self, msgid, domain=None, mapping=None, default=None,
118 # XXX position is not part of the ITALESEngine 119 # XXX position is not part of the ITALESEngine
119 # interface 120 # interface
120 position=None): 121 position=None):
122
123 if not msgid: return 'x'
121 124
122 if domain not in self.catalog: 125 if domain not in self.catalog:
123 self.catalog[domain] = {} 126 self.catalog[domain] = {}
124 domain = self.catalog[domain] 127 domain = self.catalog[domain]
125 128

Roundup Issue Tracker: http://roundup-tracker.org/