~ubuntu-branches/ubuntu/jaunty/localization-config/jaunty

« back to all changes in this revision

Viewing changes to conffiles.d/woody/links

  • Committer: Bazaar Package Importer
  • Author(s): Konstantinos Margaritis
  • Date: 2005-05-23 00:36:51 UTC
  • Revision ID: james.westby@ubuntu.com-20050523003651-2xfe4l262j5ij3xa
Tags: 0.116
* Translatios
  - Bulgarian added. Closes: #308129
  - Updated Greek and Vietnamese. Closes: #309055
  - Fixed templates file that included extra test messages for session
  chooser
* Closes forgotten bugs. Closes: #306084, #306052.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
use strict;
5
5
use warnings;
6
6
 
 
7
require '/usr/lib/localization-config/common/log.pl';
 
8
 
7
9
my $file = '/etc/links.cfg';
8
 
my $debug = 0;
9
10
 
10
11
# Define the associative array to hold key/value pairs
11
12
my %lang_map = (
37
38
                );
38
39
 
39
40
# If no locale is given as argument, quit
40
 
my $lang = $ARGV[0] or die "No language given";
 
41
my $lang = $ARGV[0] or log_die("$0: No language given");
41
42
 
42
43
# List supported locales
43
44
if ("supported" eq $lang) {
51
52
# the 'Language' entry in the links config file.
52
53
if(defined(my $conf = $lang_map{$lang})) {
53
54
    my $links_lang = $conf->{'LANGUAGE'};
54
 
    print "Links language: $links_lang\n" if $debug;
 
55
    log_msg("$0: Links language: $links_lang");
55
56
    UpdateCfgFile($file, $links_lang)
56
 
            or die "$0: Can't save file: $!\n";
 
57
            or log_die("$0: Can't save file: $!");
57
58
} else {
58
 
    die "$0: No support for language '$lang'\n";
 
59
    log_msg("$0: No support for language $lang");
59
60
}
60
61
 
61
62
# This is the helper subroutine to change the value of the variable
89
90
    }
90
91
 
91
92
    if ($updated) {
92
 
        print "Updating $file\n" if $debug;
93
 
        open(FILE, ">$file.new") or die "Unable to write to $file.new";
 
93
        log_msg("$0:UpdateCfgFile(): Updating $file");
 
94
        open(FILE, ">$file.new") or log_die("$0:UpdateCfgFile(): Unable to write to $file.new");
94
95
        print FILE @lines;
95
96
        close(FILE);
96
97
        rename "$file.new", $file;