![]() Unfortunately, this attribute is not currently supported by any browser. no: The element’s contents should not be translated.yes: The element’s contents should be translated.The translate attribute can accept one of two values: This is the idea behind the new HTML5.1 translate attribute. In some cases, we may want a section of the web page to always be displayed in a certain language, never translated. As it’s name implies, it sets the language of a resource linked to via the href attribute, and can thus only be applied to elements that have this attribute, i.e. We can specify the language of an externally linked resource using the hreflang attribute. When using the lang attribute, we can tell user agents what language the content on the current webpage is, but what about if we need to link to an external page/resource? Specifying Language for External Pages # This can be really useful, for example, if you are writing an article that references a text in a different language, comme ça, par exemple This can be really useful, for example, if you are writing an article that references a text in a different language, comme ça, par exemple. This means that we can specify different sections of our web page as being written in different languages. The lang attribute is one of the global HTML attributes which allows it to be applied to any HTML element. Here’s an example of a screen reader reading an English web page in a French accent due to a missing lang attribute. In the absence of the lang attribute, the browser will assume the web page is written in the user’s default language, which can lead to some strange results. ![]() For example, a French-speaking user who visits this blog. Īdding this attribute to the root element is really important, particularly for users who’s main language used with their machine is not the same as the web page’s language. Typically, we would add this attribute to the root element of the document, which is in most cases the HTML element. Using the lang attribute, we can let browsers know what language the web page is written in. One of the first things we need to think about is what language the HTML document (or elements within) are written in. Once you decide to translate a web page, there are many things to take into account, and a lot of them I've found are useful even if your website is written in only one language. Since starting work at eyeo, I’ve had to think a lot more about localisation and translations because most of our websites are translated into several languages, something I previously didn’t have to really consider before. But in fact, more than half of web pages are written in languages other than English. Coming from the English-speaking world, it can be easy to maintain the bubble that is the English-speaking World Wide Web.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |