source: branches/libc-0.6/src/libctests/glibc/intl/po2test.sed

Last change on this file was 2036, checked in by bird, 20 years ago

Initial revision

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 1.6 KB
Line 
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#
24s/^msgid[ ]*"\(.*\)"/INPUT ("\1")/
25# Clear flag from last substitution and jump if matching
26tb
27
28#
29# Copy the translations as well and enclose them with OUTPUT ( ).
30#
31s/^msgstr[ ]*"\(.*\)"/OUTPUT ("\1")/
32# Clear flag from last substitution and jump if matching
33tb
34
35d
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 '\'.
42s/\(.*\)")\(\n\)"\(.*\)"/\1\\\2\3")/
43P
44ta
45# No, go to the top and process it. Note that `D' includes a jump to the start!!
46D
47# Yes, we found a continuation line.
48:a
49# We cannot use the sed command `D' here
50s/[^\n]*\n//
51# Clear the substitution flag and do the next line.
52tb
Note: See TracBrowser for help on using the repository browser.