X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fbrowse%2Fmsgcat.html;h=7509cf7d412270373d3a13a7a6fe5bea9ae62bf7;hp=b7fe17ad68f8303e33f4d5835a7848813f7dea3e;hb=833cfe5c9938d33c3e6b97ed610c25a7afa6eb04;hpb=645538bbc9e4d15f399181db04411f45805d37c8 diff --git a/httemplate/browse/msgcat.html b/httemplate/browse/msgcat.html index b7fe17ad6..7509cf7d4 100644 --- a/httemplate/browse/msgcat.html +++ b/httemplate/browse/msgcat.html @@ -1,13 +1,14 @@ <& elements/browse.html, - title => mt('Message catalog'), - name_singular => 'string', #mt? - menubar => $menubar, - query => { 'table' => 'msgcat', + title => mt('Translation strings'), + name_singular => 'string', #mt? no, we need to do it through the quant/PL stuff + query => { 'table' => 'msgcat', + 'hashref' => { 'locale' => $locale, }, }, count_query => $count_query, header => [ mt('Message code'), mt('Message string') ], fields => [ 'msgcode', 'msg' ], - links => [ $link, $link ], + links => $locale eq 'en_US' ? [] : [ $link, $link ], + html_init => $html_init, &> <%init> @@ -16,12 +17,20 @@ my $curuser = $FS::CurrentUser::CurrentUser; die "access denied" unless $curuser->access_right('Configuration'); -my $menubar = [ mt('Add a string') => $p.'edit/msgcat.html' ]; +my $locale = $cgi->param('locale') || 'en_US'; +die "invalid locale" unless $locale =~ /^[A-Za-z_]+$/; -my $where = ''; - -my $count_query = 'SELECT COUNT(*) FROM msgcat'; +my $count_query = "SELECT COUNT(*) FROM msgcat where locale = '$locale'"; my $link = [ "${p}edit/msgcat.html?", 'msgnum' ]; +my $html_init = ''; +foreach my $alocale ( FS::Locales->locales ) { + my %info = FS::Locales->locale_info($alocale); + my $selectedstart = $alocale eq $locale ? '' : ''; + my $selectedend = $alocale eq $locale ? '' : ''; + $html_init .= qq!$selectedstart$info{name} ($info{country})$selectedend   !; +} +$html_init .= '

'; +