% $text %>
<%once>
use Encode qw//;
%once>
<%init>
# Get language information from session
my $lang = $m->session->{'use_site_lang'};
my $text;
($text) = $m->content =~ m{<$lang>(.+?)$lang>}s;
if (!defined $text) {
# no translation - fallback to english
$lang = 'en';
($text) = $m->content =~ m{(.+?)}s;
}
# decode back to utf8
$text = Encode::decode_utf8($text);
%init>
####
<&| /lib/i18n &>
English text.
Czech text.
# ... another language can be added
&>