=cut
sub desc {
- my $self = shift;
+ my( $self, $locale ) = @_;
if ( $self->pkgnum > 0 ) {
- $self->itemdesc || $self->part_pkg->pkg;
+ $self->itemdesc || $self->part_pkg->pkg_locale($locale);
} else {
my $desc = $self->itemdesc || 'Tax';
$desc .= ' '. $self->itemcomment if $self->itemcomment =~ /\S/;
my $cust_main = $self->cust_main;#for per-agent cust_bill-line_item-ate_style
# and location labels
+ my $locale = $cust_main->locale;
my @b = ();
my ($s, $r, $u) = ( undef, undef, undef );
my $type = $display->type;
- my $desc = $cust_bill_pkg->desc;
+ my $desc = $cust_bill_pkg->desc( $cust_main->locale );
$desc = substr($desc, 0, $maxlength). '...'
if $format eq 'latex' && length($desc) > $maxlength;
=item pkg_locale LOCALE
Returns a customer-viewable string representing this package for the given
-locale, from the part_pkg_msgcat table. If no localized string is found,
-returns the base pkg field.
+locale, from the part_pkg_msgcat table. If the given locale is empty or no
+localized string is found, returns the base pkg field.
=cut
sub pkg_locale {
my( $self, $locale ) = @_;
+ return $self->pkg unless $locale;
my $part_pkg_msgcat = $self->part_pkg_msgcat($locale) or return $self->pkg;
$part_pkg_msgcat->pkg;
}
my $conf = new FS::Conf;
my $taxproducts = $conf->exists('enable_taxproducts');
-my @locales = grep { ! /^en_/i } $conf->config('available-locales');
+my @locales = grep { ! /^en_/i } $conf->config('available-locales'); #should filter from the default locale lang instead of en_
my %locale_labels = map {
( $_ => 'Package -- '. FS::Locales->description($_) )
} @locales;