![]() ![]() In some very rare cases a three-character code might be used for a very uncommon primary language, but only if a two-character code does not exist. In short, the language for the vast majority of web page content can be properly identified with the appropriate two-character primary language code. Despite this, specifying the primary language in a web page is typically sufficient. Chinese has Mandarin and Cantonese and numerous other dialects, some of which are not mutually intelligible. English has different variants for Great Britain, Australia, and India, for example. Many primary languages have different sub-languages or dialects. If the two-character primary language code is sufficient to identify the content language, use it. Keep the lang attribute value as short as is appropriate. lang="en" is English, lang="de" is German, lang="zh" is Chinese, and lang="ar" is Arabic, for example. ![]() Two-character codes are available for nearly all primary languages. The primary language is the major language of the web content. Proper-language spellchecking for inputs.Numbers with appropriate comma or period thousands separators.Localized date and time inputs (such as using MM/DD/YYYY vs.The appropriate characters for non-Latin text.The browser has generated the localized quotation marks appropriate to the language.Īdditionally, if the language is specified the browser can present: The following examples are defined as German and French. Properly defining the content language also allows the browser to properly display quotation marks for various languages when using the element. "Los Angeles" and "piñata", for example, are Spanish words that are understood by English readers, so it would not be necessary to identify these as being Spanish on an English web page. Specifying the "language of parts" of the page is only necessary for other-language content that is not generally understood in the document's primary language. This tells the screen reader to switch to that language (if it is able). For Level AA WCAG conformance the language of parts of a page in a language different than the rest of the page must also be identified. If the screen reader does not support or cannot speak the defined language, the user might be informed of the content language, even if that content cannot be properly read.ĭefining the document language also supports automated translation of content using tools like Google Translate.įor Level A conformance with the Web Content Accessibility Guidelines (WCAG) the document language must be programmatically defined. Screen readers can "speak" various languages-as long the content language is identified. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |