annotate intl/po2tbl.sed.in @ 1424:9d8cf2e12e68

[gaim-migrate @ 1434] Umm committer: Tailor Script <tailor@pidgin.im>
author Rob Flynn <gaim@robflynn.com>
date Thu, 25 Jan 2001 00:54:42 +0000
parents d64101dc5c7e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
347
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1 # po2tbl.sed - Convert Uniforum style .po file to lookup table for catgets
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
2 # Copyright (C) 1995 Free Software Foundation, Inc.
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
3 # Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
4 #
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
5 # This program is free software; you can redistribute it and/or modify
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
6 # it under the terms of the GNU General Public License as published by
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
7 # the Free Software Foundation; either version 2, or (at your option)
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
8 # any later version.
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
9 #
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
10 # This program is distributed in the hope that it will be useful,
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
13 # GNU General Public License for more details.
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
14 #
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
15 # You should have received a copy of the GNU General Public License
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
16 # along with this program; if not, write to the Free Software
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
17 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
18 #
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
19 1 {
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
20 i\
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
21 /* Automatically generated by po2tbl.sed from @PACKAGE NAME@.pot. */\
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
22 \
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
23 #if HAVE_CONFIG_H\
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
24 # include <config.h>\
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
25 #endif\
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
26 \
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
27 #include "libgettext.h"\
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
28 \
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
29 const struct _msg_ent _msg_tbl[] = {
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
30 h
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
31 s/.*/0/
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
32 x
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
33 }
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
34 #
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
35 # Write msgid entries in C array form.
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
36 #
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
37 /^msgid/ {
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
38 s/msgid[ ]*\(".*"\)/ {\1/
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
39 tb
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
40 # Append the next line
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
41 :b
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
42 N
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
43 # Look whether second part is continuation line.
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
44 s/\(.*\)"\(\n\)"\(.*"\)/\1\2\3/
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
45 # Yes, then branch.
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
46 ta
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
47 # Because we assume that the input file correctly formed the line
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
48 # just read cannot be again be a msgid line. So it's safe to ignore
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
49 # it.
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
50 s/\(.*\)\n.*/\1/
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
51 bc
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
52 # We found a continuation line. But before printing insert '\'.
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
53 :a
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
54 s/\(.*\)\(\n.*\)/\1\\\2/
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
55 P
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
56 # We cannot use D here.
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
57 s/.*\n\(.*\)/\1/
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
58 # Some buggy seds do not clear the `successful substitution since last ``t'''
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
59 # flag on `N', so we do a `t' here to clear it.
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
60 tb
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
61 # Not reached
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
62 :c
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
63 x
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
64 # The following nice solution is by
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
65 # Bruno <Haible@ma2s2.mathematik.uni-karlsruhe.de>
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
66 td
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
67 # Increment a decimal number in pattern space.
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
68 # First hide trailing `9' digits.
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
69 :d
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
70 s/9\(_*\)$/_\1/
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
71 td
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
72 # Assure at least one digit is available.
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
73 s/^\(_*\)$/0\1/
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
74 # Increment the last digit.
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
75 s/8\(_*\)$/9\1/
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
76 s/7\(_*\)$/8\1/
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
77 s/6\(_*\)$/7\1/
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
78 s/5\(_*\)$/6\1/
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
79 s/4\(_*\)$/5\1/
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
80 s/3\(_*\)$/4\1/
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
81 s/2\(_*\)$/3\1/
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
82 s/1\(_*\)$/2\1/
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
83 s/0\(_*\)$/1\1/
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
84 # Convert the hidden `9' digits to `0's.
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
85 s/_/0/g
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
86 x
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
87 G
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
88 s/\(.*\)\n\([0-9]*\)/\1, \2},/
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
89 s/\(.*\)"$/\1/
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
90 p
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
91 }
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
92 #
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
93 # Last line.
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
94 #
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
95 $ {
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
96 i\
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
97 };\
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
98
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
99 g
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
100 s/0*\(.*\)/int _msg_tbl_length = \1;/p
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
101 }
d64101dc5c7e [gaim-migrate @ 357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
102 d