blob: fa88732ce8b75bb38d8c50b9c4955873158ec121 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
#!/usr/bin/perl
use FS::UID qw(adminsuidsetup);
use FS::msgcat;
my $user = shift or die &usage;
adminsuidsetup $user;
foreach my $del_msgcat ( qsearchs('msgcat', {}) ) {
my $error = $del_msgcat->delete;
die $error if $error;
}
my %messages = messages();
foreach $msgcode ( keys %messages ) {
foreach my $locale ( keys %{$messages{$msgcode}} ) {
my $msgcat = new FS::msgcat( {
'msgcode' => $msgcode,
'locale' => $locale,
});
my $error = $msgcat->insert;
die $error if $error;
}
}
sub messages {
# 'msgcode' => {
# 'en_US' => 'Message',
# },
(
'msgcode' => {
'en_US' => 'Message',
},
);
}
sub usage {
die "Usage:\n\n populate-msgcat user\n";
}
|