Skip to content

Commit

Permalink
Revert "Work around Locale::CLDR::Locales::* loading 'bignum'"
Browse files Browse the repository at this point in the history
This reverts commit ed43b77.

Starting 0.34.2, Locale::CLDR stopped loading bignum, using bigfloat instead.
  • Loading branch information
ehuelsmann committed Oct 22, 2023
1 parent 2d6317a commit b71a1cb
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 26 deletions.
4 changes: 0 additions & 4 deletions lib/LedgerSMB.pm
Expand Up @@ -233,8 +233,6 @@ use List::Util qw( pairgrep );
use Locale::CLDR;
use Locales unicode => 1;
use Log::Any;
use Math::BigFloat;
use Math::BigInt;
use PGObject;
use Plack;
use URI;
Expand Down Expand Up @@ -627,8 +625,6 @@ sub enabled_languages {
sub enabled_countries {
my ($self) = @_;

local $Math::BigInt::upgrade = undef;
local $Math::BigFloat::downgrade = undef;
my $regions = Locale::CLDR->new($self->{_user}->{language})->all_regions;
return [
map {
Expand Down
10 changes: 2 additions & 8 deletions lib/LedgerSMB/Database/Config.pm
Expand Up @@ -19,8 +19,6 @@ use namespace::autoclean;
use File::Find::Rule;
use File::Spec;
use Locale::CLDR;
use Math::BigFloat;
use Math::BigInt;

=head1 SYNOPSIS
Expand Down Expand Up @@ -127,12 +125,8 @@ sub charts_of_accounts {
###TODO: Define a parameter to the SQL directory!!
my $basedir = File::Spec->catfile('.', 'locale', 'coa');
my $countries = _list_directory($basedir);
my $cldr = do {
local $Math::BigInt::upgrade = undef;
local $Math::BigFloat::downgrade = undef;
Locale::CLDR->new($self->language);
};
my %regions = %{$cldr->all_regions};
my %regions = %{Locale::CLDR->new($self->language)
->all_regions};

return {
map {
Expand Down
8 changes: 1 addition & 7 deletions lib/LedgerSMB/I18N.pm
Expand Up @@ -21,8 +21,6 @@ we look only to the current locale.

use Locale::CLDR;
use Locales unicode => 1;
use Math::BigFloat;
use Math::BigInt;
use Moose::Role;
use namespace::autoclean;
use LedgerSMB::App_State;
Expand Down Expand Up @@ -129,11 +127,7 @@ Get a country localized list to allow user selection

sub get_country_list {
my $language = shift;
my %regions = do {
local $Math::BigInt::upgrade = undef;
local $Math::BigFloat::downgrade = undef;
Locale::CLDR->new($language)->all_regions->%*
};
my %regions = Locale::CLDR->new($language)->all_regions->%*;
return [
sort { $a->{text} cmp $b->{text} }
map { +{ value => uc($_),
Expand Down
8 changes: 1 addition & 7 deletions lib/LedgerSMB/Scripts/user.pm
Expand Up @@ -30,8 +30,6 @@ use feature 'fc';

use DateTime::Format::Duration::ISO8601;
use Locale::CLDR;
use Math::BigFloat;
use Math::BigInt;

use LedgerSMB::Locale;
use LedgerSMB::User;
Expand Down Expand Up @@ -134,11 +132,7 @@ sub preference_screen {
dateformats => $dateformats,
language_codes => _language_options(
$request,
do {
local $Math::BigInt::upgrade = undef;
local $Math::BigFloat::downgrade = undef;
Locale::CLDR->new( $prefs->{language} );
}),
Locale::CLDR->new( $prefs->{language} )),
login => $login,
numberformats => $numberformats,
password_expires => {
Expand Down

0 comments on commit b71a1cb

Please sign in to comment.