3 # Fix up pidgin-sipe.pot after an update with intltool-update --pot
4 # This is required to make it acceptable for Transifex
10 open(my $fh, "+<", "pidgin-sipe.pot")
11 or die "$0: can't open POT file: $!\n";
15 my(undef, $min, $hour, $mday, $mon, $year) = gmtime(time());
16 $date = sprintf("%4d-%02d-%02d %02d:%02d+0000",
17 $year + 1900, $mon + 1, $mday, $hour, $min);
20 # Must be 19 lines (same as header created by intltool-update)
21 my @lines = ( <<"END_OF_HEADER"
22 # (English) English User Interface strings for pidgin-sipe.
23 # Copyright (C) 2008-2011 SIPE Project <http://sipe.sourceforge.net/>
24 # This file is distributed under the same license as the pidgin-sipe package.
30 "Project-Id-Version: pidgin sipe\\n"
31 "Report-Msgid-Bugs-To: http://sourceforge.net/tracker/?group_id=194563&atid=949931\\n"
32 "POT-Creation-Date: 2010-11-30 23:36+0200\\n"
33 "PO-Revision-Date: $date\\n"
34 "Last-Translator: stefanb <chemobejk\@gmail.com>\\n"
35 "Language-Team: English <LL\@li.org>\\n"
36 "MIME-Version: 1.0\\n"
37 "Content-Type: text/plain; charset=UTF-8\\n"
38 "Content-Transfer-Encoding: 8bit\\n"
40 "Plural-Forms: nplurals=2; plural=(n != 1)\\n"
50 # Copy original text from msgid to msgstr
51 if (/^msgstr ("")$/) {
53 push(@lines, qq{msgstr ""\n}, $lastid);
56 push(@lines, qq{msgstr "$lastid"\n});
59 } elsif ($multiline) {
61 } elsif (/^msgid "(.*)"$/) {
63 $multiline = 1 if $lastid eq "";
71 or die "$0: can't rewind POT file: $!\n";
74 or die "$0: can't write to POT file: $!\n";