digest: add function to calculate HMAC(SHA-1)
[siplcs.git] / po / transifex-pot-fixup.pl
blob4b55e6111477c81cf79f1f31cfc88f233e7cd5b7
1 #!/usr/bin/perl -w
3 # Fix up pidgin-sipe.pot after an update to make it acceptable for Transifex
5 # Transifex update procedure:
7 # $ cd po
8 # $ intltool-update --pot -g pidgin-sipe # update POT file
9 # $ ./transifex-pot-fixup.pl # this script
10 # $ cd ..
11 # $ tx push -s # update POT file on Transifex
13 # [optional: update the languages you know on Transifex]
15 # $ tx pull -s # fetch updated translations
16 # $ git add -u po/*.po po/*.pot # add files to next commit
17 # $ git commit -e
19 use 5.008;
20 use strict;
21 use warnings;
23 open(my $fh, "+<", "pidgin-sipe.pot")
24 or die "$0: can't open POT file: $!\n";
26 my $date;
28 my(undef, $min, $hour, $mday, $mon, $year) = gmtime(time());
29 $date = sprintf("%4d-%02d-%02d %02d:%02d+0000",
30 $year + 1900, $mon + 1, $mday, $hour, $min);
33 # Must be 19 lines (same as header created by intltool-update)
34 my @lines = ( <<"END_OF_HEADER"
35 # (English) English User Interface strings for pidgin-sipe.
36 # Copyright (C) 2008-2011 SIPE Project <http://sipe.sourceforge.net/>
37 # This file is distributed under the same license as the pidgin-sipe package.
41 msgid ""
42 msgstr ""
43 "Project-Id-Version: pidgin sipe\\n"
44 "Report-Msgid-Bugs-To: http://sourceforge.net/tracker/?group_id=194563&atid=949931\\n"
45 "POT-Creation-Date: 2010-11-30 23:36+0200\\n"
46 "PO-Revision-Date: $date\\n"
47 "Last-Translator: stefanb <chemobejk\@gmail.com>\\n"
48 "Language-Team: English <LL\@li.org>\\n"
49 "MIME-Version: 1.0\\n"
50 "Content-Type: text/plain; charset=UTF-8\\n"
51 "Content-Transfer-Encoding: 8bit\\n"
52 "Language: en\\n"
53 "Plural-Forms: nplurals=2; plural=(n != 1)\\n"
54 END_OF_HEADER
57 while (<$fh>) {
58 # skip header
59 next if $. < 20;
61 push(@lines, $_);
64 # Update pot file
65 seek($fh, 0, 0)
66 or die "$0: can't rewind POT file: $!\n";
67 print $fh @lines;
68 close($fh)
69 or die "$0: can't write to POT file: $!\n";
71 # That's all folks
72 exit 0;