Issues (1963)

html/ops/build_po.php (1 issue)

1
#!/usr/bin/php
2
<?php
3
4
// generate translation template "en.po" for project-specific pages
5
//
6
// Run this in project_root/html/.
7
// edit the definition of FILE_LIST line so that it includes only your pages
8
// (not BOINC-supplied pages)
9
10
//$FILE_LIST = "user/index.php project/project.inc";
11
12
$cli_only = true;
13
require_once("../inc/util_ops.inc");
14
15
if (!isset($FILE_LIST)) {
16
    echo "You must edit build_po.php to specify your project's .php files\n";
17
    exit;
18
}
19
20
$date = date(DATE_RFC2822);
21
$header = <<<HDR
0 ignored issues
show
Use of heredoc and nowdoc syntax ("<<<") is not allowed; use standard strings or inline HTML instead
Loading history...
22
# PROJECT translation
23
# Copyright (C) PROJECT
24
#
25
# This file is distributed under the same license as BOINC.
26
#
27
msgid ""
28
msgstr ""
29
"Project-Id-Version: PROJECT"
30
"Report-Msgid-Bugs-To: BOINC translation team <[email protected]>\\n"
31
"POT-Creation-Date: $date\\n"
32
"Last-Translator: Generated automatically from source files\\n"
33
"MIME-Version: 1.0\\n"
34
"Content-Type: text/plain; charset=utf-8\\n"
35
"Content-Transfer-Encoding: 8bit\\n"
36
"X-Poedit-SourceCharset: utf-8\\n"
37
38
39
HDR;
40
41
$out = fopen("en.po", "w");
42
43
fwrite($out, $header);
44
45
$pipe = popen(
46
    "xgettext --omit-header -o - --keyword=tra -L PHP $FILE_LIST",
47
    "r"
48
);
49
stream_copy_to_stream($pipe, $out);
50
51
fclose($pipe);
52
fclose($out);
53
54
?>
55