mirror of https://github.com/BOINC/boinc.git
developer tools: a script to build en.po from PHP files to ease translation. Usage: build_po.pl [PROJECT_PATH]
svn path=/trunk/boinc/; revision=15745
This commit is contained in:
parent
02ae8d647c
commit
2b8a9e9bba
|
@ -6094,3 +6094,10 @@ David 3 Aug 2008
|
||||||
client/
|
client/
|
||||||
file_xfer.C
|
file_xfer.C
|
||||||
http_curl.C,h
|
http_curl.C,h
|
||||||
|
|
||||||
|
Rytis 4 Aug 2008
|
||||||
|
- developer tools: a script to build en.po from PHP files to ease
|
||||||
|
translation. Usage: build_po.pl [PROJECT_PATH]
|
||||||
|
|
||||||
|
tools/
|
||||||
|
build_po.pl
|
||||||
|
|
|
@ -0,0 +1,37 @@
|
||||||
|
#!/usr/bin/perl
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
|
my $path = $ARGV[0];
|
||||||
|
if ($path eq "") {
|
||||||
|
die "Usage: build_po.pl [PROJECT_PATH]";
|
||||||
|
}
|
||||||
|
system("xgettext --omit-header --directory=".$path."/html/inc -o en.po --keyword=tra -L PHP --no-location ".$path."/html/inc/*");
|
||||||
|
system("xgettext --omit-header --directory=".$path."/html/user -j -o en.po --keyword=tra -L PHP --no-location ".$path."/html/user/*");
|
||||||
|
system("xgettext --omit-header --directory=".$path."/html/project -j -o en.po --keyword=tra -L PHP --no-location ".$path."/html/project/*");
|
||||||
|
|
||||||
|
my @timedata = localtime(time);
|
||||||
|
my $header = "";
|
||||||
|
$header .= "# Language: English (International)\n";
|
||||||
|
$header .= "# FileID : \$Id\$\n";
|
||||||
|
$header .= "msgid \"\"\n";
|
||||||
|
$header .= "msgstr \"\"\n";
|
||||||
|
$header .= "PO-Revision-Date: ".($timedata[5]+1900)."-".($timedata[4]+1)."-".$timedata[3]." ".$timedata[2].":".$timedata[1]."\n";
|
||||||
|
$header .= "Last-Translator: Generated automatically from source files\n";
|
||||||
|
$header .= "MIME-Version: 1.0\n";
|
||||||
|
$header .= "Content-Type: text/plain; charset=utf-8\n";
|
||||||
|
$header .= "Content-Transfer-Encoding: 8bit\n";
|
||||||
|
$header .= "X-Poedit-SourceCharset: utf-8\n";
|
||||||
|
$header .= "\n\n";
|
||||||
|
|
||||||
|
my $content = "";
|
||||||
|
open (IN, "en.po");
|
||||||
|
while (my $line = <IN>) {
|
||||||
|
$content .= $line;
|
||||||
|
}
|
||||||
|
close(IN);
|
||||||
|
open (OUT, ">en.po");
|
||||||
|
print OUT $header;
|
||||||
|
print OUT $content;
|
||||||
|
close(OUT);
|
Loading…
Reference in New Issue