QuickSmart Web DesignerLanguage metadata tags for telling a search engine your preferred language

Search Engine Optimisation Design Overview

 

51Adding a specific language to your websites

 

 

You can get a lot more global readership of your websites and pages by adding a page in a different language. To learn more, read below.

 

Adding a Language Tag 

 

If you dont have the language tag associated to each page on your site, then the page is lingering in web space bewilderment. This will mean a miss-spelling somewhere around the world. You should then add the name of the country clearly inside your pages, such as: Web hosting and domain registration in Australia, top web hosting australia.

Adding the language tag is easy if you can access the code view of your page and/or by inserting into the properties fields of your website command panel.

Tip

Using <html lang=''en''> in your <head> identifies the page as being written in the English language. You can also specify languages for xml documents by inserting   xml: lang="en" lang="en

Note: Read the article named double Quotes

You can also specify different languages inside other coding.

Example. lang= on the <div>, <span> and <p> tags (to name a few), meaning that a paragraph of German language text can be identified to a viewer by using: <p lang="de"> or <div lang=''de''> etc.
If you use a specific language directive inside a page element such as <p>.... remember to close the tag correctly and continue the next element with another language. E.g. close de, start en to return to English.

Replace the inside of the tag from lang=''de'' to ''en'' etc.

Arabic lang="ar"
Bulgarian lang="cu"
Catalan lang=
Chinese lang="zh-cn"
  (Simplified)
Chinese lang="zh-tw"
  (Traditional)
Croatian lang="sh"
Czech lang="cs"
Danish lang="da"
Dutch lang="nl"
English lang="en"
Estonian lang="ee"
Finnish lang="fi"
French lang="fr"
German lang="de"
Greek lang="el"
Hebrew lang="he"
Hindi lang="hi"
Hungarian lang="hu"
Icelandic lang="is"
Indonesian lang="in"
Italian lang="it"
Japanese lang="ja"
Korean lang="ko"
Latin lang="la"
Lithuanian lang="lt"
Norwegian lang="no"
Polish lang="pl"

Portuguese lang="pt"
Romanian lang="ro"
Russian lang="ru"
Serbian lang="sr"
Slovak lang="sk"
Slovenian lang="sl"
Spanish lang="es"
Swedish lang="sv'"

Tamil lang="ta"
Thai lang="th"
Turkish lang="tr"
Vietnam lang="vi"

Extensions of English USA lang="en-us" Australia ="en-au"
  Great Britain "en-gb"  

See all 180 different language tags used for browser rendering- txt file

 

 

If you switch languages within one page, you can embed the <lang=> attribute in other tags such as a <p>, <h1>, <div> and other tags. For example

Foreign Language Test Text

This sentence is in English.

This sentence will be read with a British accent

Esta frase es en español. (Spanish)

Cette phrase est en français. (French)

Code

<p>This sentence is in English.</p>

<p lang="en-GB">This sentence will be read with a British accent</p>

<p lang="es">Esta frase es en espa&ntilde;ol.</p> (Spanish)</p>

<p lang="fr">Cette phrase est en fran&ccedil;ais</p> (French)

 

 

With a Javascript function, you can detect the clients browser settings for instant display.

Learn More creating an include script file

If you have access to a statistics package that shows the global page view originating destinations, you can add the language settings to those pages.

 


function startup(){

if (navigator.userLanguage) var language = navigator.userLanguage // use the user's preferred language (non-Gecko)
else if (navigator.appName == 'Netscape') var language = navigator.language // use the only language information available to Gecko
else var language = navigator.browserLanguage // get the browser language information in non-Gecko browsers (IE, Opera, Konqueror)

// Try to automatically detect the navigator's language, or else default to English
if (language.indexOf('en') > -1) displaySubs('en');
else if (language.indexOf('fr') > -1) displaySubs('fr');
else if (language.indexOf('de') > -1) displaySubs('de');
else if (language.indexOf('ja') > -1) displaySubs('ja');
else if (language.indexOf('zh') > -1) displaySubs('zh');
else if (language.indexOf('es') > -1) displaySubs('es');
else if (language.indexOf('pl') > -1) displaySubs('pl');
else if (language.indexOf('it') > -1) displaySubs('it');
else if (language.indexOf('sv') > -1) displaySubs('sv');
else if (language.indexOf('nl') > -1) displaySubs('nl');
else if (language.indexOf('pt') > -1) displaySubs('pt');
else displaySubs('en');

}

 

 

 

Declaring the Encoding for the page

 

Unicode (Any Language)

The encoding meta tag is placed in the header. The encoding tage (e.g. utf-8 for Unicode) is declared after charset= specification at the end of the tag.

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
...
</head>

 

XHTML

There are two tags - the encoding attribute in the initial XML tag and the char set meta tag (with a final slash). Both tags should be included for cross-browser compatibility.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8" />
...
</head>

Note: These tags should be included even though XML is theoretically Unicode by default. Not all browsers will parse a page as Unicode unless the meta tag is present.

Latin 1 (English, Spanish, French, German, etc.)

<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
...
<head>

NOTE: It IS good practice to declare the encoding even for an English Web site. One function of this is to tag is to "reset" the user's browser back to Latin-1 and ensure proper font settings. The Unicode "utf-8" encoding also ensures that any special characters inserted such as "Smart quotes", currency symbols, em-dashes and so forth will be properly displayed in most browsers.

Other Scripts (e.g. Windows-1251 for Cyrillic)

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
...
<head>

 

 

Next > Website Statistics How to Use Them

Choose your language tag wisely

Due to the global nature of languages and different screen readers, use the lang tag wisely. If you are not writing an article in a particular language, choose lang="en" for English.

 

If you are starting to enjoy our pages related to getting a site to top 10, we would love you to bookmark us or add a link on your site to here. There are even tips to help you get better outside links.

 

Copyright 2006 All rights Reserved. www.quicksmart-design.com