Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
gac410 committed May 24, 2017
1 parent a9205d0 commit 3fc023c
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions core/lib/Foswiki/Configure/Pluggables/LANGUAGES.pm
Expand Up @@ -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)";
Expand All @@ -69,7 +65,7 @@ sub construct {
}
}
else {
$label = Locale::Language::code2language( $lang, undef, 1 )
$label = Locale::Language::code2language($lang)
|| "$lang";
}
}
Expand Down

0 comments on commit 3fc023c

Please sign in to comment.