Various fixes to avoid JetBrains IDE problem detection.

This commit is contained in:
2021-02-07 17:46:47 +08:00
parent bf58ad3861
commit 82cb71ac60
6 changed files with 142 additions and 147 deletions

33
script/maketext Executable file → Normal file
View File

@ -1,31 +1,30 @@
#! /usr/bin/perl -w
# Command-line interface to Locale::Maketext::Gettext (and Locale::Maketext)
# Copyright (c) 2003-2007 imacat. All rights reserved. This program is free
# Copyright (c) 2003-2021 imacat. All rights reserved. This program is free
# software; you can redistribute it and/or modify it under the same terms
# as Perl itself.
# First written: 2003-05-03
# First written: 2003/5/3
use 5.008;
use strict;
use warnings;
use Getopt::Long qw(GetOptions);
use Locale::Maketext::Gettext::Functions;
use vars qw($VERSION);
$VERSION = 0.05;
our $VERSION = 0.05;
# Prototype declaration
sub main();
sub parse_args();
use vars qw($THIS_FILE $SHORTHELP $VERSTR $SEARCH $HELP);
our ($THIS_FILE, $SHORT_HELP, $VER_STR, $SEARCH, $HELP);
$THIS_FILE = $0;
$THIS_FILE =~ s/^.*\///;
$SHORTHELP = "Try `$THIS_FILE --help' for more information.";
$VERSTR = "$THIS_FILE v$VERSION by imacat <imacat\@mail.imacat.idv.tw>";
$SHORT_HELP = "Try `$THIS_FILE --help' for more information.";
$VER_STR = "$THIS_FILE v$VERSION by imacat <imacat\@mail.imacat.idv.tw>";
$SEARCH = join " ", @Locale::Maketext::Gettext::Functions::SYSTEM_LOCALEDIRS;
$HELP = << "EOT";
Usage: maketext [OPTION] [--domain=TEXTDOMAIN] MSGKEY [PARAM...]
or: maketext [OPTION] -s MSGID [PARAM...]
or: maketext [OPTION] -s MSGKEY [PARAM...]
Maketext and display native language translation of a textual message.
@ -46,14 +45,14 @@ Standard search directories: $SEARCH
Report bugs to <imacat\@mail.imacat.idv.tw>.
EOT
use vars qw($DOMAIN $LOCALEDIR $ECHO $KEY @PARAM);
our ($DOMAIN, $LOCALEDIR, $ECHO, $KEY, @PARAM);
$ECHO = 0;
# Main program
main();
exit 0;
# main: Main program
# Main program
sub main() {
local ($_, %_);
@ -69,18 +68,18 @@ sub main() {
return;
}
# parse_args: Parse the arguments
# Parse the arguments
sub parse_args() {
local ($_, %_);
# Get the arguments <20><><EFBFBD>o<EFBFBD>Ѽ<EFBFBD>
# Get the arguments
$_ = eval {
local $SIG{__WARN__} = sub { die $_[0]; };
Getopt::Long::Configure("no_auto_abbrev");
GetOptions( "domain|d=s"=>\$DOMAIN,
"s"=>sub { $ECHO = 1; },
"help|h"=>sub { print $HELP; exit 0; },
"version|V"=>sub { print "$VERSTR\n"; exit 0; });
"version|V"=>sub { print "$VER_STR\n"; exit 0; });
return 1;
};
die "$THIS_FILE: $@" if !defined $_;
@ -108,7 +107,7 @@ maketext - translate and make messages
=head1 SYNOPSIS
maketext [OPTION] [--domain=TEXTDOMAIN] MSGKEY [PARAM...]
maketext [OPTION] -s MSGID [PARAM...]
maketext [OPTION] -s MSGKEY [PARAM...]
=head1 DESCRIPTION
@ -174,7 +173,7 @@ parameter is not given.
=item TEXTDOMAINDIR
TEXTDOMAINDIR is used to search the message catelog/MO file if it
TEXTDOMAINDIR is used to search the message catalog/MO file if it
does not reside in the system locale directories.
=back
@ -200,7 +199,7 @@ L<Locale::Maketext::Gettext(3)|Locale::Maketext::Gettext/3>,
L<Locale::Maketext::Gettext::Functions(3)|Locale::Maketext::Gettext::Functions/3>,
L<bindtextdomain(3)|bindtextdomain/3>, L<textdomain(3)|textdomain/3>.
Also, please refer to the official GNU gettext manual at
L<http://www.gnu.org/software/gettext/manual/>.
L<https://www.gnu.org/software/gettext/manual/>.
=head1 AUTHOR
@ -208,7 +207,7 @@ imacat <imacat@mail.imacat.idv.tw>
=head1 COPYRIGHT
Copyright (c) 2003-2007 imacat. All rights reserved. This program is free
Copyright (c) 2003-2021 imacat. All rights reserved. This program is free
software; you can redistribute it and/or modify it under the same terms
as Perl itself.