Difference between revisions of "Tips for translators"

From Apertium
Jump to navigation Jump to search
Line 4: Line 4:
Then you could change it to e.g.
Then you could change it to e.g.
<pre>Today's date is <a rel="DATE"/>, and the weather outside is <a rel="WEATHER"/>.</pre>
<pre>Today's date is <a rel="DATE"/>, and the weather outside is <a rel="WEATHER"/>.</pre>
and translate it with apertium -f html, then strip the html you added after it's translated.
and translate it with apertium -f html, then strip the html you added after it's translated, e.g.

<pre>$ cat input.html
Today's date is <a rel="DATE"/>, and the weather outside is <a rel="WEATHER"/>
$ apertium en-ca -f html input.html | sed 's%<a rel="\([^"]*\)"/>%\1%g'
Avui la data &eacute;s DATE, i el temps exterior &eacute;s WEATHER</pre>


==See also==
==See also==

Revision as of 11:16, 5 November 2011

Not translating certain parts of the text

To ensure certain text is not translated, you can use the HTML format and put it in e.g. an html attribute. Say you're translating for some software and you have the input string:

Today's date is DATE, and the weather outside is WEATHER.

Then you could change it to e.g.

Today's date is <a rel="DATE"/>, and the weather outside is <a rel="WEATHER"/>.

and translate it with apertium -f html, then strip the html you added after it's translated, e.g.

$ cat input.html 
Today's date is <a rel="DATE"/>, and the weather outside is <a rel="WEATHER"/>
$ apertium en-ca -f html input.html | sed 's%<a rel="\([^"]*\)"/>%\1%g'
Avui  la data és DATE, i el temps exterior és WEATHER

See also