In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/83298dfc8d92e012de41ae52193e2fd7e2bcbd84?hp=37ca4a5b0e9f2e075b875f76e6e1d90c52288ad9>

- Log -----------------------------------------------------------------
commit 83298dfc8d92e012de41ae52193e2fd7e2bcbd84
Author: Enrico Sorcinelli <[email protected]>
Date:   Wed Sep 30 09:56:07 2009 +0200

    Make Pod::Perldoc use PERLDOC_POD2 ENV var
    
    * The "PERLDOC_POD2" environment variable could be used, to set once, the
    preferred translation (instead of using "-L" switch each time).
    
    eg. export PERLDOC_POD2=it
    
    If "PERLDOC_POD2=1", the language code will be auto-retrieved from
    locale, that is, from "LC_ALL" "LC_LANG" "LANG" environment variables
    respectively.
    
    export PERLDOC_POD2=1
    
    * bug fix: -f switch works correctly with missing translations.
    * bug fix: perldoc now correctly works with several translators
-----------------------------------------------------------------------

Summary of changes:
 ext/Pod-Perldoc/lib/Pod/Perldoc.pm |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/ext/Pod-Perldoc/lib/Pod/Perldoc.pm 
b/ext/Pod-Perldoc/lib/Pod/Perldoc.pm
index 97edc25..2dbb5d8 100644
--- a/ext/Pod-Perldoc/lib/Pod/Perldoc.pm
+++ b/ext/Pod-Perldoc/lib/Pod/Perldoc.pm
@@ -12,7 +12,7 @@ use File::Spec::Functions qw(catfile catdir splitdir);
 use vars qw($VERSION @Pagers $Bindir $Pod2man
   $Temp_Files_Created $Temp_File_Lifetime
 );
-$VERSION = '3.15';
+$VERSION = '3.15_01';
 #..........................................................................
 
 BEGIN {  # Make a DEBUG constant very first thing...
@@ -658,8 +658,11 @@ sub options_processing {
     $self->opt_n("nroff") unless $self->opt_n;
     $self->add_formatter_option( '__nroffer' => $self->opt_n );
 
+    # Get language from PERLDOC_POD2 environment variable
+    $self->opt_L || ( $ENV{PERLDOC_POD2} eq '1' ? 
$self->_elem('opt_L',(split(/\_/, $ENV{LC_ALL} || $ENV{LC_LANG} || 
$ENV{LANG}))[0] ) : $self->_elem('opt_L', $ENV{PERLDOC_POD2}) );
+
     # Adjust for using translation packages
-    $self->add_translator($self->opt_L) if $self->opt_L;
+    $self->add_translator(split(/\s+/,$self->opt_L)) if $self->opt_L;
 
     return;
 }
@@ -966,7 +969,9 @@ sub search_perlfunc {
      print "Going to perlfunc-scan for $search_re in $perlfunc\n";
 
     my $re = 'Alphabetical Listing of Perl Functions';
-    if ( $self->opt_L ) {
+
+    # Check available translator or backup to default (english)
+    if ( $self->opt_L && defined $self->{'translators'}->[0] ) {
         my $tr = $self->{'translators'}->[0];
         $re =  $tr->search_perlfunc_re if $tr->can('search_perlfunc_re');
     }

--
Perl5 Master Repository

Reply via email to