[Koha-cvs] CVS: koha/misc/translator tmpl_process3.pl,1.11,1.12

Ambrose C. LI acli at users.sourceforge.net
Tue Feb 24 01:48:10 CET 2004


Update of /cvsroot/koha/koha/misc/translator
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4299

Modified Files:
	tmpl_process3.pl 
Log Message:
We now have a --help option.
Minor comment update

Removed forced backups and the comment about interrupting xgettext.pl
corrupting the po file, now that we seem to be detecting the situation.


Index: tmpl_process3.pl
===================================================================
RCS file: /cvsroot/koha/koha/misc/translator/tmpl_process3.pl,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** tmpl_process3.pl	23 Feb 2004 22:16:08 -0000	1.11
--- tmpl_process3.pl	24 Feb 2004 00:47:53 -0000	1.12
***************
*** 128,131 ****
--- 128,158 ----
  ###############################################################################
  
+ sub usage ($) {
+     my($exitcode) = @_;
+     my $h = $exitcode? *STDERR: *STDOUT;
+     print $h <<EOF;
+ Usage: $0 create [OPTION]
+   or:  $0 update [OPTION]
+   or:  $0 install [OPTION]
+   or:  $0 --help
+ Create or update PO files from templates, or install translated templates.
+ 
+   -i, --input=SOURCE          Get or update strings from SOURCE file.
+                               SOURCE is a directory if -r is also specified.
+   -o, --outputdir=DIRECTORY   Install translation(s) to specified DIRECTORY
+       --pedantic-warnings     Issue warnings even for detected problems
+                               which are likely to be harmless
+   -r, --recursive             SOURCE in the -i option is a directory
+   -s, --str-file=FILE         Specify FILE as the translation (po) file
+                               for input (install) or output (create, update)
+   -x, --exclude=REGEXP        Exclude files matching the given REGEXP
+       --help                  Display this help and exit
+ 
+ The -o option is ignored for the "create" and "update" actions.
+ EOF
+     exit($exitcode);
+ }
+ 
+ ###############################################################################
  sub usage_error (;$) {
      for my $msg (split(/\n/, $_[0])) {
***************
*** 145,148 ****
--- 172,176 ----
      'exclude|x=s'			=> \@excludes,
      'pedantic-warnings|pedantic'	=> sub { $pedantic_p = 1 },
+     'help'				=> \&usage,
  ) || usage_error;
  
***************
*** 150,156 ****
  VerboseWarnings::set_pedantic_mode $pedantic_p;
  
- # try to make sure .po files are backed up (see BUGS)
- $ENV{VERSION_CONTROL} = 't';
- 
  # keep the buggy Locale::PO quiet if it says stupid things
  $SIG{__WARN__} = sub {
--- 178,181 ----
***************
*** 331,336 ****
  =head1 BUGS
  
- The --help option has not been implemented yet.
- 
  xgettext.pl must be present in the current directory; the
  msgmerge(1) command must also be present in the search path.
--- 356,359 ----
***************
*** 338,344 ****
  dependent commands are present.
  
- If xgettext.pl is interrupted by the user, a corrupted po file
- will result. This is very seriously wrong.
- 
  Locale::PO(3) has a lot of bugs. It can neither parse nor
  generate GNU PO files properly; a couple of workarounds have
--- 361,364 ----





More information about the Koha-cvs mailing list