Capturing Content

Change Content Segmentation

The Global Delivery network (GDN) captures content and splits it into separate translatable strings based on block-level HTML tags within the HTML being processed. While this behavior suits most situations, it is sometimes necessary to modify it for specific use cases. For example, many web pages feature a 'breadcrumb' navigational element such as

Home / Products / Product A

In many cases, the entire sequence of breadcrumbs would be contained within a single block-level tag, and thus would result in the sequence being ingested as a single string for translation. In this example, this could result in the words 'Home' and 'Products' being retranslated as many times as there are products, which is typically undesirable. 

Forcing Block-Level Parsing

You can force the GDN to treat inline tags as if they were block-level, and thus create separate strings from them through the use of the Smartling Split class (sl_split). Using the above example, the sl_split class might be used as follows:

 
   <div>
      <span class="sl_split">Home</span> / 
      <span class="sl_split">Products</span> / 
      <span class="sl_split">Product A</span>
   </div>

This will force each element of the breadcrumb list to be captured by Smartling as a separate string, even though they are contained within 'span' tags, which are normally considered as inline.

Forcing Inline Parsing

It is also possible to force a block-level tag to be processed as inline. This is done through the use of the classname 'sl_nosplit' on the block level tag. For example:

 
   <div class="sl_nosplit">

In this case, the content within the 'div' will be parsed as if it were contained within an inline tag such as 'span'. 

Block-level HTML Tags

The full list of HTML tags that the GDN considers 'block-level' are listed below. All tags not listed here are treated as 'inline' and do not result in separate strings being created but are instead included in the strings in which they are found when these strings are sent for translation. 

  • address
  • area
  • article
  • aside
  • audio
  • base
  • blockquote
  • body
  • button
  • canvas
  • caption
  • center
  • col
  • colgroup
  • command
  • datalist
  • dd
  • details
  • dir
  • div
  • dl
  • dt
  • embed
  • fieldset
  • figcaption
  • figure
  • footer
  • form
  • frame
  • frameset
  • h1
  • h2
  • h3
  • h4
  • h5
  • h6
  • head
  • header
  • hgroup
  • hr
  • html
  • input
  • isindex
  • keygen
  • label
  • legend
  • li
  • link
  • menu
  • meta
  • meter
  • nav
  • noframes
  • noscript
  • ol
  • optgroup
  • option
  • output
  • p
  • param
  • pre
  • progress
  • ruby
  • section
  • select
  • source
  • style
  • summary
  • table
  • tbody
  • td
  • textarea
  • tfoot
  • th
  • thead
  • title
  • tr
  • track
  • ul
  • video

 

Was this article helpful?