Name

LocaleDatabase — specify database that contains locale settings

SYNOPSIS

database_name

DESCRIPTION

The directive specifies Interchange database that contains Locale settings.

DIRECTIVE TYPE AND DEFAULT VALUE

Catalog directive

EXAMPLES

Example: Defining LocaleDatabase

Database locale locale.asc TAB
LocaleDatabase locale

Example: LocaleDatabase table structure

code	en_US	en_GB	fr_FR	de_DE	nl_NL
color	color	colour	couleur	Farbe	kleur

NOTES

Settings from LocaleDatabase add on to (and override) any that are already defined in the catalog configuration files through the use of Locale.

AVAILABILITY

LocaleDatabase is available in Interchange versions:

4.6.0-5.9.0 (git-head)

SOURCE

Interchange 5.9.0:

Source: lib/Vend/Config.pm
Line 613

['LocaleDatabase',   'configdb',         ''],

Source: lib/Vend/Config.pm
Line 4683 (context shows lines 4683-4733)

sub parse_configdb {
my ($var, $value) = @_;

my ($file, $type);
return '' if ! $value;
local($Vend::Cfg) = $C;
my ($db, $table);
eval {
  ($db, $table) = get_configdb($var, $value);
};
::logGlobal("$var $value: $@") if $@;
return '' if ! $db;

my ($k, @f);  # key and fields
my @l;      # refs to locale repository
my @n;      # names of locales
my @h;      # names of locales

my $base_direc = $var;
$base_direc =~ s/Database$//;
my $repos_name = $base_direc . '_repository';
my $repos = $C->{$repos_name} ||= {};

@n = $db->columns();
shift @n;
my $i;
if($Columnar{$base_direc}) {
  my @l;
  for(@n) {
    $repos->{$_} ||= {};
    push @l, $repos->{$_};
  }
  my $i;
  while( ($k , undef, @f ) = $db->each_record) {
    for ($i = 0; $i < @f; $i++) {
      next unless length($f[$i]);
      $l[$i]->{$k} = $f[$i];
    }
  }
}
else {
  while( ($k, undef, @f ) = $db->each_record) {
    for ($i = 0; $i < @f; $i++) {
      next unless length($f[$i]);
      $repos->{$k}{$n[$i]} = $f[$i];
    }
  }
}
$db->close_table();
return $table;
}

AUTHORS

Interchange Development Group

SEE ALSO

DocBook! Interchange!