I22r::Translate::Filter::HTML - protect HTML tags in input to I22r::Translate
I22r::Translate->config( ..., filter => [ 'HTML' ] ); $t = I22r::Translate->translate_string( src => ..., dest => ..., text => 'string that might have HTML markup', filter => [ 'HTML' ] )
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.
I22r::Translate::Filter::HTML
I22r::Translate::Filter, I22r::Translate::Filter::Literal, I22r::Translate.
To install I22r::Translate, copy and paste the appropriate command in to your terminal.
cpanm
cpanm I22r::Translate
CPAN shell
perl -MCPAN -e shell install I22r::Translate
For more information on module installation, please visit the detailed CPAN module installation guide.