2000-01-22 06:50:49 +01:00
|
|
|
# po2test.sed - Convert Uniforum style .po file to C code for testing.
|
2003-03-29 22:00:58 +01:00
|
|
|
# Copyright (C) 2000,2003 Free Software Foundation, Inc.
|
2000-01-22 06:50:49 +01:00
|
|
|
# Ulrich Drepper <drepper@cygnus.com>, 2000.
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
# any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
#
|
2003-03-29 22:00:58 +01:00
|
|
|
|
2000-01-22 06:50:49 +01:00
|
|
|
#
|
|
|
|
# We copy the original message as a comment into the .msg file. But enclose
|
|
|
|
# them with INPUT ( ).
|
|
|
|
#
|
2003-03-30 23:55:45 +02:00
|
|
|
s/^msgid[ ]*"\(.*\)"/INPUT ("\1")/
|
2003-03-29 22:00:58 +01:00
|
|
|
# Clear flag from last substitution and jump if matching
|
|
|
|
tb
|
|
|
|
|
2000-01-22 06:50:49 +01:00
|
|
|
#
|
|
|
|
# Copy the translations as well and enclose them with OUTPUT ( ).
|
|
|
|
#
|
2003-03-30 23:55:45 +02:00
|
|
|
s/^msgstr[ ]*"\(.*\)"/OUTPUT ("\1")/
|
2003-03-29 22:00:58 +01:00
|
|
|
# Clear flag from last substitution and jump if matching
|
|
|
|
tb
|
|
|
|
|
|
|
|
d
|
|
|
|
|
|
|
|
:b
|
2000-01-22 06:50:49 +01:00
|
|
|
# Append the next line.
|
2003-03-29 22:00:58 +01:00
|
|
|
$!N
|
|
|
|
# Check whether second part is a continuation line. If so, before printing
|
|
|
|
# insert '\'.
|
|
|
|
s/\(.*\)")\(\n\)"\(.*\)"/\1\\\2\3")/
|
|
|
|
P
|
|
|
|
ta
|
|
|
|
# No, go to the top and process it. Note that `D' includes a jump to the start!!
|
|
|
|
D
|
|
|
|
# Yes, we found a continuation line.
|
|
|
|
:a
|
2000-01-22 06:50:49 +01:00
|
|
|
# We cannot use the sed command `D' here
|
2003-03-29 22:00:58 +01:00
|
|
|
s/[^\n]*\n//
|
|
|
|
# Clear the substitution flag and do the next line.
|
|
|
|
tb
|