How do I configure the "Language Preference" in my browser?
It is very simple. However, though this will enable you to tell
the server what language you prefer,
most web sites only provide
content in one language.
- Mozilla: Edit => Preferences => Navigator => Languages
- Firefox: Tools => General Options => Languages
- Internet Explorer: Tools => Internet Options => General => Languages
- Opera: File => Preferences => Languages
How does Accept-Language work between a browser and a server?
The browser simply sends a preferred language list to the server as
part of the HTTP request.
If the server is properly configured, then it parses the
"Accept-Language" header [which can be a list of languages in
decreasing preference]. It then looks for the resource in the first
preferred language. If the resource is not available in the preferred
language, then the server looks at the next second preferred language
in the list, and so on. This process is called content negotiation. If the
resource is unavailable in any of the
preferred languages, then the configured default fallback language is
served.

The Accept-Language field in the HTTP request header
indicates that the client would like Japanese, but will accept English.If no
Accept-Language header is present in the request,
the
server should assume that all languages are equally acceptable, and
will typically fallback to a preconfigured default language.The article Creating A
Multilingual Web Site With Apache describes how to do it with
Apache 1.3.
Documentation is also available on versions 2.0
and 2.2.
Note that content negotiation can take more than simply language
preference into account. Other negotiable factors include encoding,
charcter set and media type. However I have only ever seen content
negotiation based on language preference. Also, in many cases, content
negotiation is handled at the application level rather than the server
level.
The article Hosting
Multilingual Websites with Sun ONE 6 Web Server deals with
Web Server v6.0, while the documentation on docs.sun.com
handles v6.1
| Tag |
Type | Format | Applicable to PDF Files | Localizable |
| Title | HTML | <title>Place your title text here</title> |
YES | YES |
| Description | Meta | <meta name="Description" content="Page summary goes
here." > |
YES | YES |
| Date | Meta | <meta name="date" content="YYYY-MM-DD" > |
YES | NO |
| Keyword | Meta | <meta name="keywords" content="word 1, word 2, word
n"> |
YES | YES |
| Doc Type | HTML | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
NO | |
| HTML Lang | HTML | <html lang="ll-CC">or <html lang="ll"> |
YES | |
| Content-Type | HTML | <meta http-equiv="Content-Type" content="text/html;
charset=xxx-x"> |
YES | |
| Content-Language | HTML | <meta http-equiv="content-language"
content="ll-CC"> |
YES | |
| Anchor Text (for HREF links) | HTML | "<a class="linkgrey"
href="http://www.mozilla.org/js/">What is JavaScript?</a>" |
YES | |
| Alt Tag for Images | HTML | <img src="/en/img/nav/xxxx.gif" alt="Add image
description text here." border="0"> |
YES |
DATE TagThe DATE tag can reflect either the creation date or revision date. The DATE tag should not usually be
localized. Enterprise search engines that may use this field will
expect a definite format. HTML LANG (Language) TagThe language attribute is used by the browser to choose the correct font for a document. Format The where "ll" is the language code, and "CC" is the country code. For example: or The shorter "ll" option uses the language code only: For a list a language options, see: http://www.i18nguy.com/unicode/language-identifiers.html.
CONTENT-TYPE TagThe CONTENT-TYPE declaration tells the client application what
type of
content is being served. In addition, it specifies the character
encoding of the content. It should be the first thing declared in the If the Content-Type tag is not placed before the Title tag, there is the possibility that titles that contain non-ASCII characters will not be interpreted correctly. The <head> tag using
this format:
Set the charset attribute to the correct encoding of the document. This could be UTF-8, ISO-8859-1 or many others. For example,
Note 1: Changing the charset attribute on its own
does
not change the character encoding of the document.
CONTENT-LANGUAGE TagThe content language of the document can be declared a
second
time. Sometimes enterprise search engines may not read [though they
should] the first declaration in the Where "ll" is the language code and "CC" is the country code. For example, the correct content language options for French Canadian is: content="fr-CA"> For a list a language options, see: http://www.i18nguy.com/unicode/language-identifiers.html.
ALT Tag for ImagesALT tags allow text to be associated with images. ALT tags are used by screen readers and other tools that enable accessibility for disabled users. In addition, they display in most browsers during mouseover. ALT tags provide compliance of Section 508 Federal guidelines for accessibility. The ALT tag must be written in the same language as the document, that is, it must be localized.
Example Of Fully Compliant HTML Page
|
Oracle is reviewing the Sun product roadmap and will provide guidance to customers in accordance with Oracle's standard product communication policies. Any resulting features and timing of release of such features as determined by Oracle's review of roadmaps, are at the sole discretion of Oracle. All product roadmap information, whether communicated by Sun Microsystems or by Oracle, does not represent a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. It is intended for information purposes only, and may not be incorporated into any contract.
The above deals with some of the more obvious parts of HTML
localization. More subtle considerations can include:
- using images appropriate to a particular locale
- using the right colors; different colors have different meanings in different cultures.
Can I specify the character encoding of a document?
Yes you can. In the <HEAD> tag insert the
following:
<META http-equiv="Content-Type"
content="test/html;charset=UTF-8">
The Content-Type header should always be provided in
either the HTTP or, as above, the HTML header. Preferably both. It can
be the
difference between a properly displayed page and garbled
nonsense. However, if the character encoding declared in the HTTP
and HTML headers differs, then the HTTP header will win.
The HTML Content-Type header is
especially useful if the file is saved to a user's local disk and later
re-viewed. At that point there obviously won't be any HTTP header to
tell the Content-Type to the browser.
More.
How can I display Japanese, Chinese and Korean characters on a web page
There are two ways you can do this.
- Use Numeric Character References [NCRs]. NCRs allow the
representation of any Unicode character using only ASCII characters.
For example:
タイ발자사类别
contains some random Japanese, Korean and Chinese characters which actually represents the string:
タイ발자사类别
A further discussion is available here.
- The other, and indeed more appropriate way, is to use UTF-8 as
your document's character encoding [as used for this page].
UTF-8 can comfortably handle all languages in use today and modern browsers have good support for it.
See How to Create UTF-8 Encoded HTML Pages .
CGI
- How do I manage charset
conversions from the browser to a database and back?
See this technical tip.
Java
Where do I go for Java Internationalization Information?
Standard Activities
Which organizations are working on WWW internationalization standards?
