diff options
author | tetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46> | 2006-10-23 20:14:15 +0000 |
---|---|---|
committer | tetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46> | 2006-10-23 20:14:15 +0000 |
commit | 56aefde186c4eba2ddd34017980d35683985417a (patch) | |
tree | 6203ab594f9ad4af65cf2221e8adf06939cc049d /LedgerSMB/Form.pm | |
parent | af66021ef163a3f51895db8eb89c957d292f8997 (diff) |
Convert locales to Locale::Maketext::Lexicon
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@264 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB/Form.pm')
-rwxr-xr-x | LedgerSMB/Form.pm | 108 |
1 files changed, 0 insertions, 108 deletions
diff --git a/LedgerSMB/Form.pm b/LedgerSMB/Form.pm index deb374d2..b42f68bb 100755 --- a/LedgerSMB/Form.pm +++ b/LedgerSMB/Form.pm @@ -3110,112 +3110,4 @@ sub audittrail { $rv; } -package Locale; - -sub new { - my ($type, $country, $NLS_file) = @_; - my $self = {}; - - %self = (); - - if ($country && -d "locale/$country") { - $self->{countrycode} = $country; - eval { require "locale/$country/$NLS_file"; }; - } - - $self->{NLS_file} = $NLS_file; - $self->{charset} = $self{charset}; - - push @{ $self->{LONG_MONTH} }, ("January", "February", "March", "April", "May ", "June", "July", "August", "September", "October", "November", "December"); - push @{ $self->{SHORT_MONTH} }, (qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec)); - - bless $self, $type; -} - - -sub text { - my ($self, $text) = @_; - return (exists $self{texts}{$text}) ? $self{texts}{$text} : $text; -} - - -sub date { - - my ($self, $myconfig, $date, $longformat) = @_; - - my $longdate = ""; - my $longmonth = ($longformat) ? 'LONG_MONTH' : 'SHORT_MONTH'; - - - if ($date) { - - # get separator - $spc = $myconfig->{dateformat}; - $spc =~ s/\w//g; - $spc = substr($spc, 0, 1); - - if ($date =~ /\D/) { - - if ($myconfig->{dateformat} =~ /^yy/) { - ($yy, $mm, $dd) = split /\D/, $date; - } - - if ($myconfig->{dateformat} =~ /^mm/) { - ($mm, $dd, $yy) = split /\D/, $date; - } - - if ($myconfig->{dateformat} =~ /^dd/) { - ($dd, $mm, $yy) = split /\D/, $date; - } - - } else { - - $date = substr($date, 2); - ($yy, $mm, $dd) = ($date =~ /(..)(..)(..)/); - } - - $dd *= 1; - $mm--; - $yy += 2000 if length $yy == 2; - - if ($myconfig->{dateformat} =~ /^dd/) { - - $mm++; - $dd = substr("0$dd", -2); - $mm = substr("0$mm", -2); - $longdate = "$dd$spc$mm$spc$yy"; - - if (defined $longformat) { - $longdate = "$dd"; - $longdate .= ($spc eq '.') ? ". " : " "; - $longdate .= &text($self, $self->{$longmonth}[--$mm])." $yy"; - } - - } elsif ($myconfig->{dateformat} =~ /^yy/) { - - $mm++; - $dd = substr("0$dd", -2); - $mm = substr("0$mm", -2); - $longdate = "$yy$spc$mm$spc$dd"; - - if (defined $longformat) { - $longdate = &text($self, $self->{$longmonth}[--$mm])." $dd $yy"; - } - - } else { - - $mm++; - $dd = substr("0$dd", -2); - $mm = substr("0$mm", -2); - $longdate = "$mm$spc$dd$spc$yy"; - - if (defined $longformat) { - $longdate = &text($self, $self->{$longmonth}[--$mm])." $dd $yy"; - } - } - } - - $longdate; -} - 1; |