Marty O'Brien > I22r-Translate-0.94 > I22r::Translate::Filter::HTML

Download:
I22r-Translate-0.94.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.94   Source  

NAME ^

I22r::Translate::Filter::HTML - protect HTML tags in input to I22r::Translate

SYNOPSIS ^

    I22r::Translate->config(
       ...,
       filter => [ 'HTML' ]
    );

    $t = I22r::Translate->translate_string(
       src => ..., dest => ..., text => 'string that might have HTML markup',
       filter => [ 'HTML' ] )

DESCRIPTION ^

A preprocessing and postprocessing filter that protects HTML tags from being altered in a translation engine.

Sometimes, content that you wish to translate may have HTML tags or other markup. Consider this English text:

    <strong>Roses</strong> are <a href="http://red.com/" style="">red</a>.

If you wished to translate this text into, say, Spanish, you would probably not want to translate the words inside the HTML tags, even though some of those words are recognizably English. That is, you would hope the translator would output something like

    <strong>Rosas</strong> son <a href="http://red.com/" style="">rojas</a>.

rather than (in the worst case)

    <fuerte>Rosas</fuerte> son <un href="http://rojo.com/" estilo="">rojas</a>.

which would surely not be rendered correctly in a web browser.

This I22r::Translate::Filter::HTML module is a filter that can hide HTML tags from a translation backend, but restore the HTML in the appropriate place in the translation output.

SEE ALSO ^

I22r::Translate::Filter, I22r::Translate::Filter::Literal, I22r::Translate.

syntax highlighting: