Mercurial > p > roundup > code
comparison roundup/cgi/TAL/talgettext.py @ 2382:c7a05bddd453
escape quotes in msgids
| author | Alexander Smishlajev <a1s@users.sourceforge.net> |
|---|---|
| date | Sat, 29 May 2004 04:32:00 +0000 |
| parents | 0d302e93abd3 |
| children | 85cbfc4a5946 |
comparison
equal
deleted
inserted
replaced
| 2381:00001a0e3fe5 | 2382:c7a05bddd453 |
|---|---|
| 12 # FOR A PARTICULAR PURPOSE. | 12 # FOR A PARTICULAR PURPOSE. |
| 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 in msgids | |
| 17 | 18 |
| 18 """Program to extract internationalization markup from Page Templates. | 19 """Program to extract internationalization markup from Page Templates. |
| 19 | 20 |
| 20 Once you have marked up a Page Template file with i18n: namespace tags, use | 21 Once you have marked up a Page Template file with i18n: namespace tags, use |
| 21 this program to extract GNU gettext .po file entries. | 22 this program to extract GNU gettext .po file entries. |
| 40 from roundup.cgi.TAL.TALInterpreter import TALInterpreter | 41 from roundup.cgi.TAL.TALInterpreter import TALInterpreter |
| 41 from roundup.cgi.TAL.DummyEngine import DummyEngine | 42 from roundup.cgi.TAL.DummyEngine import DummyEngine |
| 42 #from ITALES import ITALESEngine | 43 #from ITALES import ITALESEngine |
| 43 from roundup.cgi.TAL.TALDefs import TALESError | 44 from roundup.cgi.TAL.TALDefs import TALESError |
| 44 | 45 |
| 45 __version__ = '$Revision: 1.3 $' | 46 __version__ = '$Revision: 1.4 $' |
| 46 | 47 |
| 47 pot_header = '''\ | 48 pot_header = '''\ |
| 48 # SOME DESCRIPTIVE TITLE. | 49 # SOME DESCRIPTIVE TITLE. |
| 49 # Copyright (C) YEAR ORGANIZATION | 50 # Copyright (C) YEAR ORGANIZATION |
| 50 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. | 51 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. |
| 302 for msgid in msgids: | 303 for msgid in msgids: |
| 303 positions = catalog[msgid] | 304 positions = catalog[msgid] |
| 304 for filename, position in positions: | 305 for filename, position in positions: |
| 305 outfile.write('#: %s:%s\n' % (filename, position[0])) | 306 outfile.write('#: %s:%s\n' % (filename, position[0])) |
| 306 | 307 |
| 307 outfile.write('msgid "%s"\n' % msgid) | 308 outfile.write('msgid "%s"\n' % msgid.replace('"', '\\"')) |
| 308 outfile.write('msgstr ""\n') | 309 outfile.write('msgstr ""\n') |
| 309 outfile.write('\n') | 310 outfile.write('\n') |
| 310 | 311 |
| 311 | 312 |
| 312 if __name__ == '__main__': | 313 if __name__ == '__main__': |
