The following examples have been originally marked up in HTML in English. To see how Sprawk handles the translation of these examples, choose from the different language versions of this site.

Text formatting

Sprawk maintains basic formatting options during the translation process.

This contains bold text.

This one has italic text.

$12.34 is an amount of money.

The day after Monday is Tuesday.

Capitalization

Sprawk will match the capitalization of the original source text.

Sentence case

An example sentence showing capitalization

Title case

An Example sentence Showing Capitalization

Uppercase

AN EXAMPLE SENTENCE SHOWING CAPITALIZATION

Numbers

Sprawk handles numbers automatically, detecting and formatting decimal values and prices.

Simple numbers

Digits can be rewritten for Arabic, Chinese, Hebrew, Thai etc. (See Omniglot)

123

Formatted numbers

In large numbers the thousands separator will be either space, dot or comma depending on language:

1,234

Unformatted large numbers

An unformatted number is kept unformatted:

1234

Decimal numbers

A decimal will be formatted with a comma or a period as appropriate in the language:

1.23

Patterns

1 to 10 of 345 matches.

Words

Three for the price of one!

Phone numbers

Sprawk uses microdata markup as a hint when detecting phone numbers:

Phone: +1 23 456 789

Note: Sprawk automatically detects the <a href="tel:+46812345"> as a phone number.

Currency

Sprawk detects and formats currencies inside text blocks, but does not automatically convert them to another currency. It is possible to override a page-level handler with data-sprawk-currency-handler

Sale price: $9.95.

Sale price: $ 9.95.

Sale price: US$9.95.

Sale price: USD9.95.

Sale price: US$9.95.

Sale price: 99 kr.

Sale price: SEK 99.

Specify source currency

You can configure Sprawk to enable currency conversion with data-sprawk-currency-handler="convert". Normally Sprawk will deduce the source currency. For example, if the source is in en-US and the $ symbol is use, Sprawk will assume US dollars. You can even specify ambiguous source currency with data-sprawk-currency="CAD":

Sale price: $9.95

Some formatting, such as spaces after currency symbol, will be preserved during currency conversion:

Sale price: $ 9.95

Alternatively, ask Sprawk to show an approximate price with data-sprawk-currency-handler="append". The following example hard-coded the source currency as AUD:

Sale price: $9.95

Sale price: $99

Exchange rate

Sprawk updates foreign exchange rates every day to keep the currency conversion as accurate as possible. If you want to fix the rates on your online shop, you can annotate your BODY tag (or any container) with the data-sprawk-forex- attribute like data-sprawk-forex-USD-EUR="0.88":

Sale price: $9.95

Sale price: $99

Units

Sprawk can convert units of measurement including volume, weight, distance and temperature.

Temperature

Water boils at 100C

Sprawk recognizes the HTML &deg; entity:

Summer temperatures reach 38 °C

Sprawk recognizes the Unicode U+2103 temperature characters:

Pre-heat the oven to 180℃

Distance

Sprawk will translate source in miles, like 1,500 miles into kilometers or other units where appropriate.

1,500 miles

Sizes

Dimensions: 120cm × 180cm

Area

Living room: 12m2
200sqm of office space for rent

Weight

Sprawk preserves the number of significant figures. In this example the three digits from the original 1.23kg is preserved in US English.

1.23kg

Volumes

120ml of low-fat milk
Maximum capacity: 35m3

Proper nouns

Proper nouns (including people's names) are left unchanged except for titles like "Dr." which need to be translated:

Authors: Peterson, J. and Yap, Y.

Authors: Peterson, John. and Yap, Yee-Yin

Authors: Dr. Peterson and Ms. Yap

Places and addresses

Place names are usually left untranslated, unless a standard translation exists

Conference location: France

Conference location: Paris, France

Conference location:

Place de l'Hôtel de Ville,
75004 Paris,
France

Search engine optimization (SEO)

Meta description and keywords

Sprawk automatically translates a page's keywords and descriptions which will help native speakers find your site in their own language. Choose View source on this page to see an example.

Meta noindex

The <meta name="robots" content="noindex"> declaration in the HEAD of the page tells crawlers like Googlebot that a certain page should not be indexed. If you choose to have certain type of content (e.g. company blog) not translated and display only in the original language, Sprawk can insert this header on translated versions of the page, since only the navigation will be different. Skipping this declaration may harm your site's ranking.

Link alternate

Search engines penalise sites with many similar pages. It is therefore important to link together the different versions of the same page so that Google (and others) can treat them as a set. Sprawk automatically inserts

<link rel="alternate" href="http://www.example.com/fr/news/great-news" hreflang="fr" /> for each site language. This also exposes alternate language versions to crawlers so that they can find new pages even without a comprehensive sitemap.

HTML

HTML5 translate attribute

Sprawk supports the W3C translate attribute specification. Notice that CONTINUE is not translated in the example below:

Click the Resume button on the Status Display or the CONTINUE button on the printer panel.

Attributes

The title attribute value which appears as a mouseover tooltip will be automatically translated by Sprawk too.

Hello!

Internal links

Links to pages within your translated site are adjusted to match your configuration. If you have Sprawk triggering on a language prefix like /fr/, all other links will be also prefixed with /fr/ so that visitors stay within the translated site.

External links

External links are not adjusted with a language prefix unless they are to your own domain and have the full http://www.example.com/somepage.html URL format for the href attribute.

Sprawk demo site with full URL

Lists

Single line

Lists of items will be extracted and translated separately.

China, France, Germany and the United States

Lists of items in alphabetical order are automatically re-ordered after translation into the target language when the sprawk-sort class is added.

Definition lists

Pairs marked up with DT and DD tags will be sorted together

France
France, officially the French Republic, is a country in Western Europe.
Germany
The Federal Republic of Germany is a country in Central Europe.

Single-level lists

  • China
  • France
  • Germany
  • United Kingdom
  • United States

Nested lists

Sprawk first sorts top-level items, then sorts each level down.

  • Americas
    • Brazil
    • Mexico
    • United States
  • Asia
    • China
    • India
    • Indonesia
  • Europe
    • France
    • Germany
    • United Kingdom

Form selects

Sprawk can detect nested values in a select when they are indented with spaces and/or dashes. The nesting of sub-items will be preserved during translation and re-ordering.

Forms

Buttons

Diagrams

Vector graphics

Sprawk can translate text inside SVG files.

This preserves text transforms.

It also supports text paths in SVG 1.1

Social media

Facebook

Sprawk recognizes the standard Facebook Javascript for include like buttons. The translation engine will switch out the js.src value with the target language prefix to match the rest of the page.

Twitter

Sprawk injects the appropriate lang attribute in the HTML tag so that Twitter will localize widgets to match the translated language.

Google Plus

Sprawk recognises a call to the Google platform.js and will override the configuration with the appropriate target language code.

Maps

Javascript

Language detection

Simple text translation

Press the button to translate text to the current interface language:


Translation output will go here.

Pattern translation

Press the button to translate text with Javascript:


Translation output will go here.

Location / Country

Sprawk can detect the visitor's country and gives you access to many details:

Mixed-language content

Sprawk can identify text that it is in a different language to the rest of the page, and will automatic avoid attempting translation.

This is a sentence in the page's language. Bu boshqa bir tilda bir gap bo'ladi.