diff --git a/cgi/top_translators.pl b/cgi/top_translators.pl index e332c9207d4f5..387a7dd42882b 100644 --- a/cgi/top_translators.pl +++ b/cgi/top_translators.pl @@ -36,6 +36,11 @@ ProductOpener::Display::init(); +# Passing values to the template +my $template_data_ref = { + lang => \&lang, +}; + $scripts .= < @@ -92,41 +97,10 @@ ; $initjs .= $js; -my $html = '

' . lang('translators_lead') . '

'; - -my $translators_column_name = lang('translators_column_name'); -my $translators_column_translated_words = lang('translators_column_translated_words'); -my $translators_column_target_words = lang('translators_column_target_words'); -my $translators_column_approved_words = lang('translators_column_approved_words'); -my $translators_column_votes_made = lang('translators_column_votes_made'); - -$html .= < - - - $translators_column_name - $translators_column_translated_words - $translators_column_target_words - $translators_column_approved_words - $translators_column_votes_made - - - - - $translators_column_name - $translators_column_translated_words - $translators_column_target_words - $translators_column_approved_words - $translators_column_votes_made - - - - - -HTML -; +my $html; -$html .= '

' . lang('translators_renewal_notice') . '

'; +$tt->process('top_translators.tt.html', $template_data_ref, \$html); +$html .= "

" . $tt->error() . "

"; display_new( { title=>lang('translators_title'), diff --git a/lib/ProductOpener/Display.pm b/lib/ProductOpener/Display.pm index ff3a29e360cb6..82b4237f33b34 100644 --- a/lib/ProductOpener/Display.pm +++ b/lib/ProductOpener/Display.pm @@ -110,6 +110,7 @@ BEGIN @lcs $cc $country + $tt $nutriment_table @@ -239,7 +240,7 @@ if (defined $options{export_limit}) { } # Initialize the Template module -my $tt = Template->new({ +$tt = Template->new({ INCLUDE_PATH => $data_root . '/templates', INTERPOLATE => 1, EVAL_PERL => 1, diff --git a/templates/top_translators.tt.html b/templates/top_translators.tt.html new file mode 100755 index 0000000000000..b9ee0cbfeef71 --- /dev/null +++ b/templates/top_translators.tt.html @@ -0,0 +1,25 @@ +

[% lang('translators_lead') %]

+ + + + + + + + + + + + + + + + + + + + + + +
[% lang('translators_title') %]
[% lang('translators_column_name') %][% lang('translators_column_translated_words') %][% lang('translators_column_target_words') %][% lang('translators_column_approved_words') %][% lang('translators_column_votes_made') %]
[% lang('translators_column_name') %][% lang('translators_column_translated_words') %][% lang('translators_column_target_words') %][% lang('translators_column_approved_words') %][% lang('translators_column_votes_made') %]
+

[% lang('translators_renewal_notice') %]