Make WordPress Core

Opened 13 years ago

Closed 13 years ago

#20291 closed defect (bug) (invalid)

html element "lang" bug

Reported by: ricardojvcruz's profile ricardojvcruz Owned by: ricardojvcruz's profile ricardojvcruz
Milestone: Priority: normal
Severity: normal Version: 3.3.1
Component: I18N Keywords: has-patch
Focuses: Cc:

Description

Wordpress core function "language_attributes()" is returning by example 'en_US' and should return 'en-US'.
This could be important when crawlers are parsing and indexing pages saving the parsed language found in that element.

Following w3c specification of html language attribute we can confirm that.

HTML 4.0 lang spec:
http://www.w3.org/TR/html4/struct/dirlang.html

HTML 4.1 lang spec:
http://www.w3.org/TR/html401/struct/dirlang.html#adef-lang

HTML 5 lang spec:
http://dev.w3.org/html5/html-author/#the-html-element

Change History (2)

#1 @toscho
13 years ago

  • Cc info@… added

I cannot reproduce this. In all installations I run and in some quick checks like http://wordpress.org/news/ I see en-US, not en_US.

#2 @nacin
13 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed
			$output = get_locale();
			$output = str_replace('_', '-', $output);

That is what controls language_attributes().

Note: See TracTickets for help on using tickets.