[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb: [360] trunk/LedgerSMB



Revision: 360
          http://svn.sourceforge.net/ledger-smb/?rev=360&view=rev
Author:   tetragon
Date:     2006-10-28 11:24:32 -0700 (Sat, 28 Oct 2006)

Log Message:
-----------
Adjust num2text to work with new L10n framework

Modified Paths:
--------------
    trunk/LedgerSMB/CP.pm
    trunk/LedgerSMB/Num2text.pm

Modified: trunk/LedgerSMB/CP.pm
===================================================================
--- trunk/LedgerSMB/CP.pm	2006-10-28 18:01:47 UTC (rev 359)
+++ trunk/LedgerSMB/CP.pm	2006-10-28 18:24:32 UTC (rev 360)
@@ -45,18 +45,10 @@
 
 	$self = {};
 
-	if ($countrycode) {
+	use LedgerSMB::Num2text;
+	use LedgerSMB::Locale;
+	$self->{'locale'} = LedgerSMB::Locale->get_handle($countrycode);
 
-		if (-f "locale/$countrycode/Num2text") {
-			require "locale/$countrycode/Num2text";
-		} else {
-			use LedgerSMB::Num2text;
-		}
-
-	} else {
-		use LedgerSMB::Num2text;
-	}
-
 	bless $self, $type;
 
 }

Modified: trunk/LedgerSMB/Num2text.pm
===================================================================
--- trunk/LedgerSMB/Num2text.pm	2006-10-28 18:01:47 UTC (rev 359)
+++ trunk/LedgerSMB/Num2text.pm	2006-10-28 18:24:32 UTC (rev 360)
@@ -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'),
 		);
 
 }


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.