lang

Is lang=unknown attribute valid?

落花浮王杯 提交于 2019-12-23 11:45:42
问题 Given an HTML document in a specific language (english). I have defined a lang attribute on the tag : <html lang="en"> Some texts in the page are written in another language (for example french) : <span lang="fr"> blabla... </span> But, if I can not identify the language, but I know it is NOT english, can I set "unknown" as a valid value for lang attribute? <span lang="unknown"> blabla... </span> I read this in w3c documentation, but I am not sure if "the default value is [...] unknown" means

What's the difference between the lang attribute and the <meta http-equiv=“Content-Language” content=“en-US”> tag?

若如初见. 提交于 2019-12-19 05:07:21
问题 I was wondering what's the significance of using the "lang" attribute and how that differs from using the meta "Content-Language" tag? Consider the following code: <html lang="en"> <head> <meta http-equiv="Content-Language" content="en-US"> </head>... My assumption is that the browser is reading the meta tag's value, but the DOM is concerned with the "lang" attribute. Is this correct? Are there any nuances I'm unaware of? 回答1: The lang attribute (on the HTML element) specifies the language

how to show different language characters in git log?

巧了我就是萌 提交于 2019-12-19 04:01:19
问题 Here is what I am seeing now in my git log: commit d0ed97d243eaf905b03244a4d1ba6af26213e4ad Author: some guy <someone@somesite.com> Date: Mon Jun 3 11:22:06 2013 +0900 <E3><83><98><E3><83><83><E3><83><80><E3><81><AE><E3><83><A6><E3><83><BC><E3><82><B6><E3><82><A2><E3><82><A4><E3><82><B3><E3><83><B3><E8><A1><A8><E7><A4><BA> the commit is made by some Japanese characters. I've already changed my LANG env to ja_JP.UTF-8, en_US.UTF-8, ja_JP.eucJP: $ export LANG=ja_JP.UTF-8 but nothing worked.

Is 'en-EU' a valid value for HTML 'lang' attribute?

十年热恋 提交于 2019-12-18 13:15:54
问题 Markup for different editions of my news site... US Edition: <html lang="en-US" xml:lang="en-US"> ... </html> India Edition: <html lang="en-IN" xml:lang="en-IN"> ... </html> Europe Edition (in this case not a specific country, i.e. news covers a broader region): <html lang="en-EU" xml:lang="en-EU"> ... </html> I am depending on the markup of the page to make the target language/region of pages clear to the search engines because the different editions of the news site use a directory-based

Get language of a website using simple html dom

邮差的信 提交于 2019-12-13 09:23:45
问题 I am building a search engine and webcrawler using PHP, and i would like to detect the language of a website, how would i detect the language of a page by: Checking the URL for https://twitter.com/?lang=jap if that is not set then i would like to: Check the URL https://www.google.co.jp/ if i still can't find anything then i would to set default to English the code i have so far for scraping pages is: function crawl($url){ $html = file_get_html($url); if($html && is_object($html) && isset(

Is it possible for Math.random() to return a value greater than 1? [duplicate]

允我心安 提交于 2019-12-13 07:58:51
问题 This question already has answers here : Math.random() explanation (5 answers) Closed 2 years ago . Is it possible to return a value like 1.125155, which is a double value greater than 1? My code: Math.random() 回答1: This is not possible if you are using java.lang.Math. (Read Doc) 回答2: You can do something like this : Random ran = new Random(); double x = ran.nextDouble() + 1 The x is now the random number that has double value greater than 1. 回答3: You can move the decimal place using

elt.lang = 'fr' not working

这一生的挚爱 提交于 2019-12-13 03:03:37
问题 I work in the context of a Firefox extension . Issue I'm trying to create a new element with a specific lang attribute. I tried the method elt.lang = 'zh' given in How to create HTML element with lang attribute in JavaSript? doens't work. The element is created but without the lang attribute. Not working as expected code var wrapper = document.createElement("span"); var zh = document.createElement("i"); zh.textContent = symbol; zh.lang= "zh-cmn"; // <-- -- -- -- -- -- -- var srcText =

Language not declared Ideally

半腔热情 提交于 2019-12-12 18:19:12
问题 I've been running some tests on my website in regards to the Google webmaster guidelines. To my surprise it states that I'm not declaring my language ideally. Upon checking my HTML, I have the following within it: <html lang="en"> <head> Am I stating the language incorrectly? As I thought this was correct... 回答1: I managed to find a fix to this problem, as I mentioned when I was trying to declare the language via HTML it just would not work. So I used .htaccess to fix the problem by sending

Semantically marking up translations

好久不见. 提交于 2019-12-12 16:04:17
问题 I'm in the process of marking up an historical manuscript which has been translated from German into English. On the web page I will be providing both languages side by side. Is there an accepted way to markup such a scenario? I was thinking of splitting the translation blocks using the section tag and providing each with a lang attribute. However semantically this fails at communicating that one section roughly equates to the other. Any thoughts on this would be greatly appreciated. 回答1:

How do I make text-transform:uppercase work properly with Greek?

徘徊边缘 提交于 2019-12-12 09:33:44
问题 The issue I came across has to do with the capitalization of Greek characters by the text-transform: uppercase property. In Greek, vowels can have acute accents, both small and caps, for instance one in Greek is ένα . In the beginning of a sentence would be Ένα . But when a word or a phrase is written in all caps then Greek grammar says that it should have no accented letters . As it is now, CSS's text-transform: uppercase capitalizes Greek letters preserving accents which is grammatically