Translations of this page?:

Escaping

Escaping is a method that allows us to tell a computer to do something special with the text we supply or to ignore the special function of a character. To tell the computer that it should expect an escape character we use a special escape marker, we usually make use of the backslash (\). So an escaped sequence consists of the escape marker followed by another character.

Types of Escape Characters

Each escape sequence has a special meaning:

Escape Sequence Effect Description
\n newline Adds a newline at that place in the text
\t tab Add a tab marker at that spot in the text
\r carriage return Return without advancing the line
\\
print a real backslash If you need a real backslash then you need to escape the backslash, the computer will only print one backslash
\” ignore the ” (quote) Usually a double quote ends a string therefore by escaping the double quote the computer ignores the effect of a closing double quote and thus the string continues. Eg 'We \”helped\” him' would be displayed as - We “helped” him
\uxxxx Unicode character Sometime you want to refer to Unicode characters using normal ASCII. Many programs and programmers use \u to refer to the Unicode character. Where xxxx is the hexadecimal or decimal value for the specific Unicode character.

Escape Characters in Your Translations

What you see What it means What you do
…server active.\nDo you want… This is easy to recognise as the newline appears between two sentences. When the program runs the sentences will appear on different lines. The best option is to place your \n escape in the same place
…jobs and/or\nOLE actions… This is harder to recognise. There will be a line break between “and/or” and “OLE”. Look at the structure of the whole translation, in a case like this the author is using newlines to balance the text (i.e. make the lines appear to be equal in length). If that is the case then balance your translations in a similar way.

Dos and Don'ts

  • DO
    • Copy the escape exactly as you see it. In some of the Translate Toolkit programs there is a bug that uses \\n instead of \n. Make sure you also use \\n
    • Move the placement of escapes if they are being used to balance sentences
    • Make sure you have exactly the same number of escapes as in the original
    • Drop \” or \' escapes if your language does not use the “double” or 'single' quote method of emphasis that English uses. Be aware that the doublequote and singlequote tests of pofilter will no longer be useful.
    • Place ” or ' around the same concept as the English i.e. around the same word or words that the English had surrounded.
  • DON'T
    • Change the escape in any way. Do not use /n instead of \n just because you can't find \ on your keyboard
    • Confuse sentences like this “File \ Open \ New” as an escape. If they are not in the above list then they are most likely not escape characters.
    • Add or delete spaces around the escape. If its there keep it, if not don't add it.
guide/translation/escaping.txt · Last modified: 2008/01/05 00:50 by dwaynebailey
SourceForge.net Logo
Recent changes RSS feed Creative Commons License Driven by DokuWiki