From 3fc023c3f06bf2e607b254f2acd535bdb3d8e6e2 Mon Sep 17 00:00:00 2001 From: George Clark Date: Tue, 23 May 2017 21:37:41 -0400 Subject: [PATCH] Item14406: Can't pass the no_check flag Have to depend on try to work. Leave this as is - it avoids the crash but logs errors. Since it's only in configure, it's not a huge issue. and it is perl 5.26. --- core/lib/Foswiki/Configure/Pluggables/LANGUAGES.pm | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/core/lib/Foswiki/Configure/Pluggables/LANGUAGES.pm b/core/lib/Foswiki/Configure/Pluggables/LANGUAGES.pm index deb85ca612..9f3f59938e 100755 --- a/core/lib/Foswiki/Configure/Pluggables/LANGUAGES.pm +++ b/core/lib/Foswiki/Configure/Pluggables/LANGUAGES.pm @@ -45,15 +45,11 @@ sub construct { my $label; -# SMELL: Language::Codes _code() is documented as taking a 3rd parameter, $no_check_code -# as useful when adding languages. Set no_check_code so we don't crash for unknown languages -# ie. Klingon. As of perl 5.26, it crashes for unkown languages. - try { if ( $lang =~ m/^(\w+)-(\w+)$/ ) { my ( $lname, $cname ) = ( - ( Locale::Language::code2language( $1, undef, 1 ) || '' ), - ( Locale::Country::code2country( $2, undef, 1 ) || '' ) + ( Locale::Language::code2language($1) || '' ), + ( Locale::Country::code2country($2) || '' ) ); if ( $lname && $cname ) { $label = "$lname ($cname)"; @@ -69,7 +65,7 @@ sub construct { } } else { - $label = Locale::Language::code2language( $lang, undef, 1 ) + $label = Locale::Language::code2language($lang) || "$lang"; } }