Name

LANG — contains the current locale for language (localization) display

SYNOPSIS

@@LANG@@

DESCRIPTION

This variable contains the current locale for language localization and display. The variable is not set in the configuration files, but is manipulated by the Interchange daemon while it is runnning.

If you want to define catalog default language, set the MV_LANG variable.

VARIABLE TYPE

Global variable,
Catalog variable

EXAMPLES

Example: Reading value of LANG

Add the following to a test Interchange page:

Currency: @@LANG@@

Example: Defining default language for a catalog

Put the following in catalog.cfg:

Variable MV_LANG fr_FR

NOTES

AVAILABILITY

LANG is available in Interchange versions:

4.8.0-5.7.0 (cvs-head)

SOURCE

Interchange 5.7.0:

Source: lib/Vend/Dispatch.pm (rev. 1.104 from Thu Nov 27 00:01:24 2008)
Line 1537 (context shows lines 1527-1541 in dispatch():1223)

# LEGACY
ROUTINES: {
  last ROUTINES unless index($Vend::FinalPath, "/$Vend::Cfg->{ProcessPage}/") == 0;
  while ($Vend::FinalPath =~ s{/$Vend::Cfg->{ProcessPage}/(locale|language \
|currency)/([^/]*)/}{/$Vend::Cfg->{ProcessPage}/}) {
    $::Scratch->{"mv_$1"} = $2;
  }
  $Vend::FinalPath =~ s{/$Vend::Cfg->{ProcessPage}/page/}{/};
}

if(my $locale = $::Scratch->{mv_language}) {
  $Global::Variable->{LANG}
    = $::Variable->{LANG} = $locale;
}
# END LEGACY


Source: lib/Vend/Config.pm (rev. 2.239 from Sat Oct 11 00:01:22 2008)
Line 3244 (context shows lines 3234-3248 in parse_hash():3132)

  }
},

  Locale => sub {
#::logDebug("Doing Locale dispatch...");
      my $locale = $::Scratch->{mv_locale};
      my $curr = $::Scratch->{mv_currency};
      $locale || $curr    or return;

      if($locale and ! $::Scratch->{mv_language}) {
          $Global::Variable->{LANG}
                  = $::Variable->{LANG}
                  = $::Scratch->{mv_language}
                  = $locale;
      }

Source: lib/Vend/File.pm (rev. 2.29 from Tue Nov 11 00:01:23 2008)
Line 150 (context shows lines 140-154 in readfile_db():138)

return unless $Vend::Cfg->{FileDatabase};
my ($tab, $col) = split /:+/, $Vend::Cfg->{FileDatabase};
my $db = $Vend::Interpolate::Db{$tab} || ::database_exists_ref($tab)
  or return undef;
#::logDebug("tab=$tab exists, db=$db");

# I guess this is the best test
if($col) {
  return undef unless $db->column_exists($col);
}
elsif ( $col = $Global::Variable->{LANG} and $db->column_exists($col) ) {
  #do nothing
}
else {
  $col = 'default';

AUTHORS

Interchange Development Group

SEE ALSO

DocBook! Interchange!