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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
|
#!/usr/bin/perl -Tw
use strict;
use FS::UID qw(adminsuidsetup);
use FS::Record qw(qsearch);
use FS::msgcat;
my $user = shift or die &usage;
adminsuidsetup $user;
foreach my $del_msgcat ( qsearch('msgcat', {}) ) {
my $error = $del_msgcat->delete;
die $error if $error;
}
my %messages = messages();
foreach my $msgcode ( keys %messages ) {
foreach my $locale ( keys %{$messages{$msgcode}} ) {
my $msgcat = new FS::msgcat( {
'msgcode' => $msgcode,
'locale' => $locale,
'msg' => $messages{$msgcode}{$locale},
});
my $error = $msgcat->insert;
die $error if $error;
}
}
print "Message catalog initialized sucessfully\n";
sub messages {
# 'msgcode' => {
# 'en_US' => 'Message',
# },
(
'passwords_dont_match' => {
'en_US' => "Passwords don't match",
},
'invalid_card' => {
'en_US' => 'Invalid credit card number',
},
'unknown_card_type' => {
'en_US' => 'Unknown card type',
},
'not_a' => {
'en_US' => 'Not a ',
},
'empty_password' => {
'en_US' => 'Empty password',
},
'no_access_number_selected' => {
'en_US' => 'No access number selected',
},
'illegal_text' => {
'en_US' => 'Illegal (text)',
#'en_US' => 'Only letters, numbers, spaces, and the following punctuation symbols are permitted: ! @ # $ % & ( ) - + ; : \' " , . ? / in field',
},
'illegal_or_empty_text' => {
'en_US' => 'Illegal or empty (text)',
#'en_US' => 'Only letters, numbers, spaces, and the following punctuation symbols are permitted: ! @ # $ % & ( ) - + ; : \' " , . ? / in required field',
},
'illegal_username' => {
'en_US' => 'Illegal username',
},
'illegal_password' => {
'en_US' => 'Illegal password',
},
'username_in_use' => {
'en_US' => 'Username in use',
},
'illegal_email_invoice_address' => {
'en_US' => 'Illegal email invoice address',
},
'illegal_name' => {
'en_US' => 'Illegal (name)',
#'en_US' => 'Only letters, numbers, spaces and the following punctuation symbols are permitted: , . - \' in field',
},
'illegal_phone' => {
'en_US' => 'Illegal (phone)',
#'en_US' => '',
},
'illegal_zip' => {
'en_US' => 'Illegal (zip)',
#'en_US' => '',
},
);
}
sub usage {
die "Usage:\n\n populate-msgcat user\n";
}
|