mirror of https://github.com/BOINC/boinc.git
- added a script (from Nicolas) to generate en.po
svn path=/trunk/boinc/; revision=16151
This commit is contained in:
parent
ff2df1eba6
commit
56c203a9a2
|
@ -8144,3 +8144,9 @@ David 7 Oct 2008
|
|||
file_names.h
|
||||
file_xfer.cpp
|
||||
time_stats.cpp
|
||||
|
||||
David 7 Oct 2008
|
||||
- added a script (from Nicolas) to generate en.po
|
||||
|
||||
html/ops
|
||||
build_po.php
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
#!/usr/bin/php
|
||||
<?php
|
||||
|
||||
if (!isset($argv[1])) {
|
||||
die('Usage: build_po.php [PROJECT_PATH]');
|
||||
}
|
||||
$path = $argv[1];
|
||||
|
||||
$date = strftime('%Y-%m-%d %H:%M %Z');
|
||||
$header = <<<HDR
|
||||
# BOINC web translation
|
||||
# Copyright (C) 2008 University of California
|
||||
#
|
||||
# This file is distributed under the same license as BOINC.
|
||||
#
|
||||
# FileID : \$Id\$
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: BOINC \$Id\$\\n"
|
||||
"Report-Msgid-Bugs-To: BOINC translation team <translate@boinc.berkeley.edu>\\n"
|
||||
"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"
|
||||
|
||||
msgid "LANG_NAME_NATIVE"
|
||||
msgstr "English"
|
||||
|
||||
msgid "LANG_NAME_INTERNATIONAL"
|
||||
msgstr "English"
|
||||
|
||||
|
||||
HDR;
|
||||
|
||||
$out = fopen("$path/html/languages/translations/web.pot", "w");
|
||||
fwrite($out, $header);
|
||||
$pipe = popen("xgettext --omit-header -o - --keyword=tra -L PHP --no-location $path/html/inc/*.inc $path/html/user/*.php $path/html/project.sample/*.*", "r");
|
||||
stream_copy_to_stream($pipe, $out);
|
||||
fclose($pipe);
|
||||
fclose($out);
|
||||
|
||||
system("msgen -o $path/html/languages/translations/en.po $path/html/languages/translations/web.pot");
|
||||
?>
|
|
@ -16,8 +16,7 @@
|
|||
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
// delete_file [-host_id host_id -file_name file_name]
|
||||
// -host_id number of host to upload from
|
||||
// or 'all' if for all active hosts
|
||||
// -host_id number of host to delete file from
|
||||
// -file_name name of the file to delete
|
||||
//
|
||||
// Create a msg_to_host_that requests that the host delete the
|
||||
|
@ -39,6 +38,15 @@
|
|||
#include "sched_config.h"
|
||||
#include "sched_util.h"
|
||||
|
||||
void usage(char** argv) {
|
||||
fprintf(stderr,
|
||||
"Arrange to delete a file from a host.\n\n"
|
||||
"Usage: %s -host_id H -file_name F\n",
|
||||
argv[0]
|
||||
);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
int delete_host_file(int host_id, const char* file_name) {
|
||||
DB_MSG_TO_HOST mth;
|
||||
int retval;
|
||||
|
@ -66,30 +74,22 @@ int main(int argc, char** argv) {
|
|||
|
||||
check_stop_daemons();
|
||||
|
||||
for(i=1; i<argc; i++) {
|
||||
for (i=1; i<argc; i++) {
|
||||
if (!strcmp(argv[i], "-host_id")) {
|
||||
host_id = atoi(argv[++i]);
|
||||
} else if(!strcmp(argv[i], "-file_name")) {
|
||||
strcpy(file_name, argv[++i]);
|
||||
} else if (!strcmp(argv[i], "-help")) {
|
||||
fprintf(stdout,
|
||||
"delete_file: deletes a file on a specific host\n\n"
|
||||
"It takes the following arguments and types:\n"
|
||||
"-host_id (int); the number of the host\n"
|
||||
"-file_name (string); the name of the file to delete\n");
|
||||
} else if (!strcmp(argv[i], "--help") || !strcmp(argv[i], "-h")) {
|
||||
usage(argv);
|
||||
exit(0);
|
||||
} else {
|
||||
if (!strncmp("-",argv[i],1)) {
|
||||
fprintf(stderr, "delete_file: bad argument '%s'\n", argv[i]);
|
||||
fprintf(stderr, "type delete_file -help for more information\n");
|
||||
exit(1);
|
||||
}
|
||||
fprintf(stderr, "bad arg %s\n", argv[i]);
|
||||
usage(argv);
|
||||
}
|
||||
}
|
||||
|
||||
if (!strlen(file_name) || host_id == 0) {
|
||||
fprintf(stderr, "delete_file: bad command line, requires a valid host_id and file_name\n");
|
||||
exit(1);
|
||||
usage(argv);
|
||||
}
|
||||
|
||||
retval = config.parse_file(".");
|
||||
|
|
Loading…
Reference in New Issue