RT# 82949 - changes section name from fees to pricing, better opiton
[freeside.git] / httemplate / browse / msgcat.html
1 <& elements/browse.html,
2      title         => mt('Translation strings'),
3      name_singular => 'string', #mt? no, we need to do it through the quant/PL stuff
4      query         => { 'table'     => 'msgcat', 
5                         'hashref'   => { 'locale' => $locale, },
6                       },
7      count_query   => $count_query,
8      header        => [ mt('Message code'), mt('Message string') ],
9      fields        => [ 'msgcode', 'msg' ],
10      links         => $locale eq 'en_US' ? [] : [ $link, $link ],
11      html_init     => $html_init,
12 &>
13 <%init>
14
15 my $curuser = $FS::CurrentUser::CurrentUser;
16
17 die "access denied"
18   unless $curuser->access_right('Configuration');
19
20 my $locale = $cgi->param('locale') || 'en_US';
21 die "invalid locale" unless $locale =~ /^[A-Za-z_]+$/;
22
23 my $count_query = "SELECT COUNT(*) FROM msgcat where locale = '$locale'";
24
25 my $link = [ "${p}edit/msgcat.html?", 'msgnum' ];
26
27 my $html_init = '';
28 foreach my $alocale ( FS::Locales->locales ) {
29      my %info = FS::Locales->locale_info($alocale);
30      my $selectedstart = $alocale eq $locale ? '<B>' : '';
31      my $selectedend = $alocale eq $locale ? '</B>' : '';
32      $html_init .= qq!<A HREF="msgcat.html?locale=$alocale">$selectedstart$info{name} ($info{country})$selectedend</A> &nbsp; !;
33 }
34 $html_init .= '<BR><BR>';
35
36 </%init>