Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Locale::CLDR 'bignum' workaround removal #7671

Merged
merged 3 commits into from
Oct 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 28 additions & 28 deletions cpanfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,35 +37,35 @@ recommends 'Cpanel::JSON::XS', '3.0206'; # 3.0206 adds 'allow_bignum' option
recommends 'JSON::PP', '2.00'; # 1.99_01 adds 'allow_bignum'
requires 'JSONSchema::Validator';
requires 'List::MoreUtils';
requires 'Locale::CLDR';
requires 'Locale::CLDR', '0.34.2';
# Keep thoss in sync with the languages defined in Pg-database.sql
requires 'Locale::CLDR::Locales::Ar';
requires 'Locale::CLDR::Locales::Bg';
requires 'Locale::CLDR::Locales::Ca';
requires 'Locale::CLDR::Locales::Cs';
requires 'Locale::CLDR::Locales::Da';
requires 'Locale::CLDR::Locales::De';
requires 'Locale::CLDR::Locales::El';
requires 'Locale::CLDR::Locales::En';
requires 'Locale::CLDR::Locales::Es';
requires 'Locale::CLDR::Locales::Et';
requires 'Locale::CLDR::Locales::Fi';
requires 'Locale::CLDR::Locales::Fr';
requires 'Locale::CLDR::Locales::Hu';
requires 'Locale::CLDR::Locales::Id';
requires 'Locale::CLDR::Locales::Is';
requires 'Locale::CLDR::Locales::It';
requires 'Locale::CLDR::Locales::Lt';
requires 'Locale::CLDR::Locales::Ms';
requires 'Locale::CLDR::Locales::Nb';
requires 'Locale::CLDR::Locales::Nl';
requires 'Locale::CLDR::Locales::Pl';
requires 'Locale::CLDR::Locales::Pt';
requires 'Locale::CLDR::Locales::Ru';
requires 'Locale::CLDR::Locales::Sv';
requires 'Locale::CLDR::Locales::Tr';
requires 'Locale::CLDR::Locales::Uk';
requires 'Locale::CLDR::Locales::Zh';
requires 'Locale::CLDR::Locales::Ar', '0.34.2';
requires 'Locale::CLDR::Locales::Bg', '0.34.2';
requires 'Locale::CLDR::Locales::Ca', '0.34.2';
requires 'Locale::CLDR::Locales::Cs', '0.34.2';
requires 'Locale::CLDR::Locales::Da', '0.34.2';
requires 'Locale::CLDR::Locales::De', '0.34.2';
requires 'Locale::CLDR::Locales::El', '0.34.2';
requires 'Locale::CLDR::Locales::En', '0.34.2';
requires 'Locale::CLDR::Locales::Es', '0.34.2';
requires 'Locale::CLDR::Locales::Et', '0.34.2';
requires 'Locale::CLDR::Locales::Fi', '0.34.2';
requires 'Locale::CLDR::Locales::Fr', '0.34.2';
requires 'Locale::CLDR::Locales::Hu', '0.34.2';
requires 'Locale::CLDR::Locales::Id', '0.34.2';
requires 'Locale::CLDR::Locales::Is', '0.34.2';
requires 'Locale::CLDR::Locales::It', '0.34.2';
requires 'Locale::CLDR::Locales::Lt', '0.34.2';
requires 'Locale::CLDR::Locales::Ms', '0.34.2';
requires 'Locale::CLDR::Locales::Nb', '0.34.2';
requires 'Locale::CLDR::Locales::Nl', '0.34.2';
requires 'Locale::CLDR::Locales::Pl', '0.34.2';
requires 'Locale::CLDR::Locales::Pt', '0.34.2';
requires 'Locale::CLDR::Locales::Ru', '0.34.2';
requires 'Locale::CLDR::Locales::Sv', '0.34.2';
requires 'Locale::CLDR::Locales::Tr', '0.34.2';
requires 'Locale::CLDR::Locales::Uk', '0.34.2';
requires 'Locale::CLDR::Locales::Zh', '0.34.2';
requires 'Locale::Maketext::Lexicon', '0.62';
requires 'Locales';
requires 'Log::Any';
Expand Down
4 changes: 0 additions & 4 deletions lib/LedgerSMB.pm
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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