Code guide /

Code

Dealing with code and code-related elements is an important part of being a Gengo Translator, and the biggest challenge newbies face. Translating code correctly is especially important as mistakes can cause serious formatting issues with your customer’s web page.

In basic terms, code is a set of instructions that directs a computer to perform specific operations. For example, code defines the font, color and size of text on a web page, where line breaks go and what happens when you click a hyperlink.

You don’t need coding skills to translate with Gengo, but it’s important to understand the following basic principles:

  • Most code elements are written with a <start tag> and an </end tag> , which are enclosed within brackets. End tags are distinguished from start tags by a slash after the opening bracket. For example, to bold “cheese” in the following sentence, surround it with strong emphasis tags, e.g., I like <strong>cheese</strong>.
  • Changing one letter of bracketed text, omitting a single tag or forgetting a slash can cause code to break, which can lead to serious website readability or functionality problems. Use copy and paste to ensure exact replication and check your work carefully.
  • Sometimes you need to move the position of the code in a sentence to ensure that it stays with the relevant text in the translation. Let’s look at a couple of examples with incorrect and correct translations.
Example 1 Source text: I like <a href=”http://en.wikipedia.org/wiki/Cheese”>cheese</a>. Incorrect Japanese translation: 私はチーズが <a href=”http://en.wikipedia.org/wiki/Cheese”>好きです</a>。 Correct Japanese translation: 私は <a href=”http://en.wikipedia.org/wiki/Cheese”>チーズが好きです</a>。 

The HTML tag here is linking to a page about cheese. Since the term for cheese (チーズ) moves to the middle of the sentence in Japanese, so should the HTML tag.

Example 2 Source text: <ul><li>Delicious, refreshing <a href=”http://www.marthastewart.com/339243/marthas-pineapple-papaya-juice”>papaya juice</a></li></ul> Incorrect Spanish translation: <a href=”http://www.marthastewart.com/339243/marthas-pineapple-papaya-juice”>Zumo de papaya<ul><li>delicioso y refrescante</a></li></ul> Correct Spanish translation: <ul><li><a href=”http://www.marthastewart.com/339243/marthas-pineapple-papaya-juice”>Zumo de papaya</a> delicioso y refrescante</li></ul>
Here, the <ul><li> and </li></ul> tags (code for bullet points) are associated with the the whole text whereas the <a href=”http://weluvpapayajuice.com> and </a> are strictly associated with “papaya juice” (“Zumo de papaya” in Spanish).

Triple brackets

This feature is for customers who would like to exclude certain words, names, timestamps, etc. from getting translated. Please do not translate anything in the triple brackets; copy the text (as is, including the brackets) into your translation. To reduce the risk of error, please use the copy and paste function and carefully check your work. Example

Hey we’re looking for a DJ to spin on Monday night at [[[#SXSW]]]. Tweet recommendations to [[[@deyto]]] and [[[@sarah_ross]]]
should be translated into Japanese as:
月曜の夜、[[[#SXSW]]]に出演してくれるDJを探しています。推薦したい人がいたら [[[@deyto]]]と [[[@sarah_ross]]] にツイートしてください。

Deflated HTML tags

To avoid confusion, we usually “deflate” HTML tags into shorter, more manageable numbered tags. For example, <strong>Hello</strong> becomes {1}Hello{/1}. So, using the examples listed above, the code will appear as follows:

Example 1 Source text: I like {1}cheese{/1}. Incorrect Japanese translation: 私はチーズが{1}好きです{/1}。 Correct Japanese translation: 私は{1}チーズ{/1}が好きです。
Example 2 Source text: {1}{2}Delicious, refreshing {3}papaya juice{/3}{/2}{/1} Incorrect Spanish translation: {3}Zumo de papaya{1}{2} delicioso y refrescante{/3}{/2}{/1} Correct Spanish translation: {1}{2}{3}Zumo de papaya{/3} delicioso y refrescante{/2}{/1}
Note: Opening tags do not always have matching closing tags (i.e. there is not always a {/1} to match a {1}).

Common errors

When translating these elements, please keep a watchful eye and be careful not to fall for the following common errors.

  • Please ensure you do not put a space between the code and the word the code is being applied to. If you are unsure, please follow the spacing of the source text.
Source: I like {1}cheese{/1}. Incorrect French translation: J’aime le {1} fromage {/1}. Correct French translation: J’aime le {1}fromage{/1}.
  • Although it is our policy to place all code within triple brackets, some jobs will have non-standard pieces of code that may look like regular text. It may be difficult to figure out which elements are code and which are not, so here are some examples of non-standard code that you may come across. Please note that you would not need to translate any elements that are shown in red and you should simply copy and paste them into your translation.

  • Account: %1$snProtocol: %2$s
  • from {{ departure }} to {{ arrival }}
  • The -contestTitle- Challenge starts soon, and you’re not on a team yet. There’s still time — join or create a team now.
  • Sorry, but our system has a %{minimum_amount} minimum gift amount.
  • Can’t connect to the licensing server.nPlease check your internet connection and try again.
  • __nights__ nights in __place__
  • Minimal length of opinion is {min_length} chars.

  • Please copy the capitalisation and punctuation of small pieces of text you may see. These may be menu buttons or other elements of a website that should appear in the same format as the source text.
Source: optional

Incorrect Portuguese translation: Opcional.

Correct Portuguese translation: opcional