2008-10-07 20:24:16 +00:00
|
|
|
#!/usr/bin/php
|
|
|
|
<?php
|
|
|
|
|
2009-05-22 20:55:06 +00:00
|
|
|
// generate translation template "en.po" for project-specific pages
|
2009-05-13 23:16:11 +00:00
|
|
|
//
|
2009-05-22 20:55:06 +00:00
|
|
|
// Run this in project_root/html/.
|
2009-05-13 23:16:11 +00:00
|
|
|
// edit the definition of FILE_LIST line so that it includes only your pages
|
2009-05-22 20:55:06 +00:00
|
|
|
// (not BOINC-supplied pages)
|
2009-05-13 23:16:11 +00:00
|
|
|
|
2009-05-22 20:55:06 +00:00
|
|
|
//$FILE_LIST = "user/index.php project/project.inc";
|
2009-03-24 21:54:12 +00:00
|
|
|
|
2009-10-02 18:32:40 +00:00
|
|
|
$cli_only = true;
|
2009-09-15 18:14:37 +00:00
|
|
|
require_once("../inc/util_ops.inc");
|
|
|
|
|
2009-05-22 20:55:06 +00:00
|
|
|
if (!isset($FILE_LIST)) {
|
|
|
|
echo "You must edit build_po.php to specify your project's .php files\n";
|
|
|
|
exit;
|
2008-10-07 20:24:16 +00:00
|
|
|
}
|
2009-05-13 23:16:11 +00:00
|
|
|
|
2022-06-12 07:46:44 +00:00
|
|
|
$date = date(DATE_RFC2822);
|
2008-10-07 20:24:16 +00:00
|
|
|
$header = <<<HDR
|
2016-11-28 18:10:33 +00:00
|
|
|
# PROJECT translation
|
|
|
|
# Copyright (C) PROJECT
|
2008-10-07 20:24:16 +00:00
|
|
|
#
|
|
|
|
# This file is distributed under the same license as BOINC.
|
|
|
|
#
|
|
|
|
msgid ""
|
|
|
|
msgstr ""
|
2016-11-28 18:10:33 +00:00
|
|
|
"Project-Id-Version: PROJECT"
|
|
|
|
"Report-Msgid-Bugs-To: BOINC translation team <boinc_loc@ssl.berkeley.edu>\\n"
|
2008-10-07 20:24:16 +00:00
|
|
|
"POT-Creation-Date: $date\\n"
|
|
|
|
"Last-Translator: Generated automatically from source files\\n"
|
|
|
|
"MIME-Version: 1.0\\n"
|
|
|
|
"Content-Type: text/plain; charset=utf-8\\n"
|
|
|
|
"Content-Transfer-Encoding: 8bit\\n"
|
|
|
|
"X-Poedit-SourceCharset: utf-8\\n"
|
|
|
|
|
2009-05-14 21:03:21 +00:00
|
|
|
|
2008-10-07 20:24:16 +00:00
|
|
|
HDR;
|
|
|
|
|
2009-05-22 20:55:06 +00:00
|
|
|
$out = fopen("en.po", "w");
|
2009-05-14 21:03:21 +00:00
|
|
|
|
2008-10-07 20:24:16 +00:00
|
|
|
fwrite($out, $header);
|
2009-05-14 21:03:21 +00:00
|
|
|
|
2009-05-13 23:16:11 +00:00
|
|
|
$pipe = popen(
|
2009-05-14 21:03:21 +00:00
|
|
|
"xgettext --omit-header -o - --keyword=tra -L PHP $FILE_LIST",
|
2009-05-13 23:16:11 +00:00
|
|
|
"r"
|
|
|
|
);
|
2008-10-07 20:24:16 +00:00
|
|
|
stream_copy_to_stream($pipe, $out);
|
2009-05-14 21:03:21 +00:00
|
|
|
|
2008-10-07 20:24:16 +00:00
|
|
|
fclose($pipe);
|
|
|
|
fclose($out);
|
|
|
|
|
|
|
|
?>
|