summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xLedgerSMB/CP.pm14
-rwxr-xr-xLedgerSMB/Num2text.pm67
2 files changed, 37 insertions, 44 deletions
diff --git a/LedgerSMB/CP.pm b/LedgerSMB/CP.pm
index 6d8fb11c..8e1a21f6 100755
--- a/LedgerSMB/CP.pm
+++ b/LedgerSMB/CP.pm
@@ -45,17 +45,9 @@ sub new {
$self = {};
- if ($countrycode) {
-
- if (-f "locale/$countrycode/Num2text") {
- require "locale/$countrycode/Num2text";
- } else {
- use LedgerSMB::Num2text;
- }
-
- } else {
- use LedgerSMB::Num2text;
- }
+ use LedgerSMB::Num2text;
+ use LedgerSMB::Locale;
+ $self->{'locale'} = LedgerSMB::Locale->get_handle($countrycode);
bless $self, $type;
diff --git a/LedgerSMB/Num2text.pm b/LedgerSMB/Num2text.pm
index 4cb79fec..252f8f06 100755
--- a/LedgerSMB/Num2text.pm
+++ b/LedgerSMB/Num2text.pm
@@ -34,41 +34,42 @@
sub init {
my $self = shift;
+ my $locale = $self->{'locale'};
%{ $self->{numbername} } =
- (0 => 'Zero',
- 1 => 'One',
- 2 => 'Two',
- 3 => 'Three',
- 4 => 'Four',
- 5 => 'Five',
- 6 => 'Six',
- 7 => 'Seven',
- 8 => 'Eight',
- 9 => 'Nine',
- 10 => 'Ten',
- 11 => 'Eleven',
- 12 => 'Twelve',
- 13 => 'Thirteen',
- 14 => 'Fourteen',
- 15 => 'Fifteen',
- 16 => 'Sixteen',
- 17 => 'Seventeen',
- 18 => 'Eighteen',
- 19 => 'Nineteen',
- 20 => 'Twenty',
- 30 => 'Thirty',
- 40 => 'Forty',
- 50 => 'Fifty',
- 60 => 'Sixty',
- 70 => 'Seventy',
- 80 => 'Eighty',
- 90 => 'Ninety',
- 10**2 => 'Hundred',
- 10**3 => 'Thousand',
- 10**6 => 'Million',
- 10**9 => 'Billion',
- 10**12 => 'Trillion',
+ (0 => $locale->text('Zero'),
+ 1 => $locale->text('One'),
+ 2 => $locale->text('Two'),
+ 3 => $locale->text('Three'),
+ 4 => $locale->text('Four'),
+ 5 => $locale->text('Five'),
+ 6 => $locale->text('Six'),
+ 7 => $locale->text('Seven'),
+ 8 => $locale->text('Eight'),
+ 9 => $locale->text('Nine'),
+ 10 => $locale->text('Ten'),
+ 11 => $locale->text('Eleven'),
+ 12 => $locale->text('Twelve'),
+ 13 => $locale->text('Thirteen'),
+ 14 => $locale->text('Fourteen'),
+ 15 => $locale->text('Fifteen'),
+ 16 => $locale->text('Sixteen'),
+ 17 => $locale->text('Seventeen'),
+ 18 => $locale->text('Eighteen'),
+ 19 => $locale->text('Nineteen'),
+ 20 => $locale->text('Twenty'),
+ 30 => $locale->text('Thirty'),
+ 40 => $locale->text('Forty'),
+ 50 => $locale->text('Fifty'),
+ 60 => $locale->text('Sixty'),
+ 70 => $locale->text('Seventy'),
+ 80 => $locale->text('Eighty'),
+ 90 => $locale->text('Ninety'),
+ 10**2 => $locale->text('Hundred'),
+ 10**3 => $locale->text('Thousand'),
+ 10**6 => $locale->text('Million'),
+ 10**9 => $locale->text('Billion'),
+ 10**12 => $locale->text('Trillion'),
);
}