a.c. Posted June 13, 2012 Share Posted June 13, 2012 I'm having a problem with the lang attribute in html. I can't seem to change the language to anything other than English. I've tried the following <html lang="fr"> <meta http-equiv="content-type" content="text/html;charset=UTF-8"/> <meta http-equiv="content-type" content="text/html;charset=ISO-8859-1"/> <meta http-equiv="content-language" content="fr"/> but none of them seem to work. Does anyone have a solution to this? Kind regards,a.c. Link to comment Share on other sites More sharing options...
eTianbun Posted June 13, 2012 Share Posted June 13, 2012 What did you expect? The browser should change those words to french? Link to comment Share on other sites More sharing options...
Ingolme Posted June 13, 2012 Share Posted June 13, 2012 The lang attribute tells the browser what language your are using in the element. Link to comment Share on other sites More sharing options...
a.c. Posted June 14, 2012 Author Share Posted June 14, 2012 French was the language that I was expecting but the browser decided to display the text in English instead of French. a.c. Link to comment Share on other sites More sharing options...
eTianbun Posted June 14, 2012 Share Posted June 14, 2012 Thats not how the lang attribute works. The lang attribute, tells web browsers, search engines, and other marchine, the language of element's content (including attribute's value for web browsers.) If you are exspecting the browser to (for example) translate the english phrase "The Clone" to french "El clone", then you are missing the point. The browser do not translate, it only try its best, to make it look like french (by manipulating it a little). For example, when you use double quotes around a word ("MAN"), the browser will try to make it look like french, by converting double quotes to e.g: guillemets («MAN»). It also helps screen readers, when pronouncing words. Link to comment Share on other sites More sharing options...
Ingolme Posted June 14, 2012 Share Posted June 14, 2012 Like I said earlier, the "lang" attribute is purely to tell people and machines what language you have used in the element. If you want your site in french then hire a french translator. Thats not how the lang attribute works. The lang attribute, tells web browsers, search engines, and other marchine, the language of element's content (including attribute's value for web browsers.) If you are exspecting the browser to (for example) translate the english phrase "The Clone" to french "El clone", then you are missing the point. The browser do not translate, it only try its best, to make it look like french (by manipulating it a little). For example, when you use double quotes around a word ("MAN"), the browser will try to make it look like french, by converting double quotes to e.g: guillemets («MAN»). It also helps screen readers, when pronouncing words.I don't believe the browser should do anything at all with the content. I wouldn't want my quotation marks modified by the browser. Link to comment Share on other sites More sharing options...
eTianbun Posted June 14, 2012 Share Posted June 14, 2012 (edited) Well, i have tried it so many times though, but i hardly see any change(s), except for IE8, when you do something like this: <q lang="fr">FRENCH</q> Output: «FRENCH» <q lang="en">ENGLISH</q> Output: "ENGLISH" Edited June 14, 2012 by CodeName Link to comment Share on other sites More sharing options...
Ingolme Posted June 14, 2012 Share Posted June 14, 2012 Well, i have tried it so many times though, but i hardly see any change(s), except for IE8, when you do something like this:<q lang="fr">FRENCH</q> Output: «FRENCH» <q lang="en">ENGLISH</q> Output: "ENGLISH" There aren't any quotation marks in the code, though. I thought you were referring to something like this:<p lang="fr">Some "quoted" text.</p> Remember old versions Internet Explorer don't actually put any quotation marks on the <q> element. I know all other browsers have supported it forever. Link to comment Share on other sites More sharing options...
a.c. Posted June 16, 2012 Author Share Posted June 16, 2012 Okay now that makes sense. Thanks for the help. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now