Special GlobalLink Web Proxy Classes

For most GlobalLink Web Proxy implementations, source sites are localized "as is"; in other words, you don’t make changes to your origin site in order to translate it. However, it is possible to have more control over the translation of specific country content. Homepages can vary by language, or region-specific content can differ from the origin content. The advanced integration features of the GlobalLink Web Proxy Platform let you do just that.

These features are implemented using classes as directives. You can use these classes on one or more languages or locales.

To use the GlobalLink Web Proxy classes, insert these stubbed definitions in one of your CSS include files:

.OneLinkNoTx         { /*no-op*/ } 
.OneLinkHide         { /*no-op*/ } 
.OneLinkKeepLinks    { /*no-op*/ } 
.OneLinkReplace      { /*no-op*/ } 
.OneLinkReplaceNoTx  { /*no-op*/ }
.OneLinkTxShow       { display:none; } 
.OneLinkShow         { display:none; }

The CSS classes can control both what is translated as well as what appears on the target site. The following sections provide detailed explanations and examples of how to use these classes.

OneLinkNoTx: Exclude Content from Translation

Use this class to pass untranslated text from the source site to translated sites. Text marked with this class will appear on the translated website, but will not be translated.

This is the most commonly used class. For example, on websites containing user-created content, you may wish to exclude that section of the site from translation. Content created by users often becomes outdated quickly, and it would be costly to translate. By using this class you can exclude it. Other examples are names, addresses, phone numbers, or email addresses, or in-language local market content that does not require translation.

Include a OneLinkNoTx class anywhere in the HTML DOM to prevent text from being translated. GlobalLink Web Proxy will apply the "no translate" status to the HTML element that uses the class and to all child elements.

An example:<div> This text will be translated. <div class="OneLinkNoTx"> This text will NOT be translated. <div> This text will also NOT be translated. </div> </div> This text will be translated. </div>

How can you exclude an entire page from translation except for a few HTML blocks that should be translated? Here are two ways to implement this:

1. Place the class “OneLinkNoTx” around the full page (usually on the body tag or a container div tag element), then add class="OneLinkTx" to sibling elements that should be translated.

2. Use the X-OneLinkNoTx response header with a blank UTIC value, then add the class="OneLinkTx" on any element that should be translated.

OneLinkHide: Remove Content from the Translated Site

Use this class to prevent source-site content from displaying on any translated website.

If there is content on the source website that should not appear on the translated website, use the class OneLinkHide. You can include the OneLinkHide class anywhere in the HTML DOM to hide text from the web user when they are looking at a translated site. GlobalLink Web Proxy will hide this element and all of its child elements. Often this class is used in conjunction with the OneLinkTxShow or OneLinkShow directives.

An example:

<div>
    This text will be translated.
<div class='OneLinkHide'>
      This text will NOT be translated and NOT be visible on the translated site.
<div> This text will also NOT be translated and NOT be visible. </div>
</div>
    This text will still be translated.
</div>

OneLinkTxShow: Translate Local Market Specific Content

Use this class to mark market-specific content, written in the source language, that differs from source market content.

OneLinkTxShow is one way of handling local market content that differs from the source market. You can essentially replace source content or graphics with content targeted to a specific market. You can include the OneLinkTxShow class anywhere in the HTML DOM to translate and reveal text or graphics to the web user. Often this class is used in conjunction with the OneLinkHide directive.

An example:

<div>
    This text will be translated.
<div class="OneLinkHide">
      This is the English text that is not translated and hidden on the translated 
      website.
</div>
<div class="OneLinkTxShow">
      This is a region specific text written in English for the market that you want 
      translated and shown on the translated version of the site.
</div>
      This text will still be translated.
</div>

Alternatively, you can use GlobalLink Web Proxy HTML comment syntax that follows to achieve the same result.

The HTML comment is case sensitive, and must not contain any whitespace between “<!--” and the GlobalLink Web Proxy class name.

An example using HTML comments:

<div>
     This text will be translated.
<div class='OneLinkHide'>
       This text will NOT be translated and NOT be visible on the translated site.
<div>
         This text will also NOT be translated and NOT be visible. 
</div>
</div>
<!--OneLinkTxShow
     This is a region specific text written in English for the market that 
     you want translated and shown on the translated version of the site. 
OneLinkTxShow-->
     This text will still be translated.
</div>

The advantage to the HTML comment approach is that search engines will not index hidden text on your source site. When your translated site is rendered, the commented section will be changed to a div.

OneLinkShow: Show Local Market Authored Content

Use this class to mark market-specific content, written in the target market language that differs from source market content.

OneLinkShow lets you insert in-language market content. You can use this class to add content or graphics targeted for the local market already authored in the target language. You can include the OneLinkShow class anywhere in the HTML DOM to reveal text or graphics to the user when he/she is looking at the translated site. Often this class is used in conjunction with the OneLinkHide directive, and for sites with more than one language, a language specific class would be used.

An example:

<div>
     This text will be translated.
<div class='OneLinkHide'>
     This is the English text that is not translated and hidden on the translated
     website.
</div>
<div class='OneLinkShow'>
     This is region specific text authored in the target language that you want shown 
On the translated version of the site (no translation occurs, this text is
already in local language).
</div>
     This text will still be translated.
</div>

Alternatively, you can use a GlobalLink Web Proxy HTML comment syntax that follows to achieve the same result. >The HTML comment is case sensitive, and must not contain any whitespace between “<!--” and the GlobalLink Web Proxy class name.

Same example using HTML comments:

<div>
     This text will be translated.
<div class='OneLinkHide'>
     This text will NOT be translated and NOT be visible on the translated site.
<div>
     This text will also NOT be translated and NOT be visible. </div>
</div>
<!--OneLinkShow
     This is region specific text authored in the target language that you want 
     shown on the translated version of the site (no translation occurs, this text is 
     already in local language).
OneLinkShow-->
     This text will still be translated.
</div>

The advantage to the HTML comment approach is that search engines will not index hidden text on your source site. When your translated site is rendered, the commented section will be changed to a div.

OneLinkKeepLinks: Prevent Links from Being Rewritten

Use this class to stop GlobalLink Web Proxy from rewriting webpage links.

GlobalLink Web Proxy automatically rewrites all links found on your source site to point back to the translated site. If GlobalLink Web Proxy did not rewrite these fully qualified URLs, the English site would display when a user clicked on a link.

<ul>
<li><a href=http://www.example.com/contactus.html>Contact Us</a>
</ul>

Ordinarily the GlobalLink Web Proxy Platform rewrites this link so that it becomes a relative path like this:

<ul>
<li><a href=/contactus.html>Nous contacter</a>
</ul>

By doing so, the link stays on the same site, and takes the user to the French "Contact us" page.

If you wish to prevent GlobalLink Web Proxy from rewriting a specific link (for example, if you want to take the user back to a certain page on the English site), then use the OneLinkNoTX class to block translation in combination with the OneLinkKeepLinks class to ensure that the links are not rewritten by GlobalLink Web Proxy:

<div class="OneLinkNoTx OneLinkKeepLinks">
<a href="http://www.example.com/contactus.html">Contact us (English)</a>
<a href="http://www.example.fr/custserv.html">Nous contacter</a>
</ul>

Multi-Language CSS Classes

For multilingual sites, the CSS class concepts are the same as for a single language site. The only difference is that you can define and use a separate OneLinkTxShow and OneLinkShow class for each target language. To use these directives you simply define the classes in one of your CSS include files:

.OneLinkTxShow_es    { display:none; } 
.OneLinkTxShow_fr    { display:none; } 
.OneLinkShow_es      { display:none; } 
.OneLinkShow_fr      { display:none; }

If you have multiple locales for the same language, and want to show different content in different locales for that same language (e.g., French for Canada versus French for France), you should specify a full locale in your class names using the standard ISO four letter codes. For more information, see ISO Language Codes on Language Names and Codes

.OneLinkTxShow_fr_CA  { display:none; } 
.OneLinkTxShow_fr_FR  { display:none; } 
.OneLinkShow_fr_CA    { display:none; } 
.OneLinkShow_fr_FR    { display:none; }

Any of the show classes can also be used in HTML comment form, for example:

<div>
     This text will be translated.
   <div class="OneLinkHide">
       This text will NOT be translated and NOT be visible on the translated site.
       <div> This text will also NOT be translated and NOT be visible. </div>
   </div>
<!--OneLinkTxShow_fr_CA
       This is a region specific text written in English for the market that you want translated and shown on the translated version of the site.
OneLinkTxShow_fr_CA-->

This text will still be translated.
</div>

Translations.com uses the ISO (639-1) two-letter language codes (JA, ZH, etc.). For best results, do not use ISO country codes (JP, CN, etc.). See ISO Language Codes on Language Names and Codes.

Dynamic Content Replacement

The special CSS classes OneLinkReplace and OneLinkReplaceNoTx allow you to replace elements on your translated pages with content from other pages (or even other websites). Think of these classes as language-specific server-side includes performed by the GlobalLink Web Proxy Platform.

These classes instruct the GlobalLink Web Proxy Platform to replace the innerHTML portion of an element with the full content of the given URL:

<div class= "OneLinkReplace_es" olsrc="/content/to/be/translated.html">
   This innerHTML on your source site will be replaced on the Spanish site, and 
   translated for Spanish. 
</div>
<div class= "OneLinkReplaceNoTx_es" olsrc="/content/already/translated.html" >
   This innerHTML on your source site will be replaced on the Spanish site, but not 
   translated. 
</div>
<div class= "OneLinkReplaceNoTx_pt_BR" olsrc="https://ptbr.another.com/site.html ">
   This innerHTML on some other website will be replaced on the Brazilian Portuguese site. 
</div>

• These classes are only used as a flag for the GlobalLink Web Proxy Platform (there should be no actual definition for the classes in your CSS files).

• The containing element must be a block-level element: DIV, TABLE, P, UL, OL, LI, etc., not an inline element: SPAN, FONT, etc.

• If you replace the innerHTML of a TABLE element, the page with the replacement should begin with a TBODY or TR (do not repeat the TABLE element).

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.