1 | # po2test.sed - Convert Uniforum style .po file to C code for testing.
|
---|
2 | # Copyright (C) 2000,2003 Free Software Foundation, Inc.
|
---|
3 | # Ulrich Drepper <drepper@cygnus.com>, 2000.
|
---|
4 | #
|
---|
5 | # This program is free software; you can redistribute it and/or modify
|
---|
6 | # it under the terms of the GNU General Public License as published by
|
---|
7 | # the Free Software Foundation; either version 2, or (at your option)
|
---|
8 | # any later version.
|
---|
9 | #
|
---|
10 | # This program is distributed in the hope that it will be useful,
|
---|
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
13 | # GNU General Public License for more details.
|
---|
14 | #
|
---|
15 | # You should have received a copy of the GNU General Public License
|
---|
16 | # along with this program; if not, write to the Free Software
|
---|
17 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
---|
18 | #
|
---|
19 |
|
---|
20 | #
|
---|
21 | # We copy the original message as a comment into the .msg file. But enclose
|
---|
22 | # them with INPUT ( ).
|
---|
23 | #
|
---|
24 | s/^msgid[ ]*"\(.*\)"/INPUT ("\1")/
|
---|
25 | # Clear flag from last substitution and jump if matching
|
---|
26 | tb
|
---|
27 |
|
---|
28 | #
|
---|
29 | # Copy the translations as well and enclose them with OUTPUT ( ).
|
---|
30 | #
|
---|
31 | s/^msgstr[ ]*"\(.*\)"/OUTPUT ("\1")/
|
---|
32 | # Clear flag from last substitution and jump if matching
|
---|
33 | tb
|
---|
34 |
|
---|
35 | d
|
---|
36 |
|
---|
37 | :b
|
---|
38 | # Append the next line.
|
---|
39 | $!N
|
---|
40 | # Check whether second part is a continuation line. If so, before printing
|
---|
41 | # insert '\'.
|
---|
42 | s/\(.*\)")\(\n\)"\(.*\)"/\1\\\2\3")/
|
---|
43 | P
|
---|
44 | ta
|
---|
45 | # No, go to the top and process it. Note that `D' includes a jump to the start!!
|
---|
46 | D
|
---|
47 | # Yes, we found a continuation line.
|
---|
48 | :a
|
---|
49 | # We cannot use the sed command `D' here
|
---|
50 | s/[^\n]*\n//
|
---|
51 | # Clear the substitution flag and do the next line.
|
---|
52 | tb
|
---|