summary refs log tree commit diff stats
path: root/po/sv.po
diff options
context:
space:
mode:
authorDiogo Sousa <diogogsousa@gmail.com>2013-05-24 16:46:35 +0100
committerDiogo Sousa <diogogsousa@gmail.com>2013-05-24 16:46:35 +0100
commit4402ea34def027b971a8523844fd95e13cfa2e57 (patch)
treeb9cfe9e7bce3cf230e75c8adbb09cc8c294e87bd /po/sv.po
parentfaa53a5335d2536afc33c1082bf7a946061740e1 (diff)
Fixed mistake in last commit.
Diffstat (limited to 'po/sv.po')
0 files changed, 0 insertions, 0 deletions
' href='#n53'>53 54 55






















































                                                              
#!/usr/bin/env python3

import sys

inf = open(sys.argv[1])
eventf = open(sys.argv[2], 'w')
enumsf = open(sys.argv[3], 'w')

enumsf.write(\
'''
/* this file is auto generated, edit textevents.in instead! */

enum
{
''')

eventf.write(\
'''
/* this file is auto generated, edit textevents.in instead! */

const struct text_event te[] = {
''')

try:
	while True:
		name = inf.readline().strip()
		event_enum = inf.readline().strip()
		event_help = inf.readline().strip()
		event_str = inf.readline().strip()
		args = inf.readline().strip()
		translate = True

		if args[0] == 'n':
			args = int(args[1]) | 128
			translate = False
		else:
			args = int(args)

		if translate:
			event_str = 'N_("%s")' %event_str
		else:
			event_str = '"%s"' %event_str

		enumsf.write('\t%s,\n' %event_enum)
		eventf.write('\n{"%s", %s, %u,\n%s},\n' %(
			name, event_help, args, event_str,
		))

		inf.readline() # whitespace
except IndexError:
    pass

enumsf.write('\tNUM_XP\n};\n')
eventf.write('};\n')