Replace lang="xx" with lang="en"

psynaptic - April 18, 2008 - 13:26
Project:String Overrides
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review
Description

This is a very simple patch to fix the issue of xx replacing the language string:

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="xx" lang="xx">
<meta http-equiv="content-language" content="xx" />

becomes:

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<meta http-equiv="content-language" content="en" />

Not sure this is the right way since hard-coding en is quite ignorant.

AttachmentSize
stringoverrides.module.patch497 bytes

#1

Rob Loach - April 22, 2008 - 17:12
Status:needs review» fixed

http://drupal.org/cvs?commit=112245

#2

noahb - May 1, 2008 - 13:47
Status:fixed» needs work

After applying this patch to v1.4, stings are no longer overridden.
The patch does fix the lang=xx issue, but seems to break the modules...

#3

moshe weitzman - May 2, 2008 - 03:42
Priority:normal» critical

I can confirm that this has broen string replacement.

#4

Rob Loach - May 5, 2008 - 04:09
Title:Fix for lang="xx" issue» Breaking patch: lang="en"
Version:5.x-1.4» 5.x-1.5
Assigned to:Anonymous» Rob Loach

I've moved it back to xx in HEAD. Would you mind testing 5.x-1.x-dev? I'd like to get a "fixed" release out as soon as possible.

I'm not experiencing this issue, strangely. With or without the patch.

#5

noahb - May 6, 2008 - 15:56

I tested the latest dev version and it indeed fixes the problem.

Strange that you can't recreate this though. Drupal is on box with apache2, php5, mysql, with a pretty typical setup (ie no core patches). I guess the next thing to try would be a core install with no contrib modules, to see if there is a conflict happening somewhere.

#6

Rob Loach - May 6, 2008 - 20:12
Title:Breaking patch: lang="en"» Replace lang="xx" with lang="en"
Version:5.x-1.5» 5.x-1.x-dev
Priority:critical» normal
Assigned to:Rob Loach» Anonymous
Status:needs work» active

We'll have to think of another solution to change "xx" reported in lang to "en".

#7

geodaniel - October 7, 2008 - 15:07

I presume this isn't working because it is being overridden by the core locale 'en'. Would it work if a regional language code (e.g. en-US) was supplied instead of just 'en'?

#8

tkamen - December 11, 2008 - 15:33

Using "en-US" worked for me. Just using en fixed the xx problem, but caused the module to stop functioning even on the latest dev version. But en-US worked great.

#9

plan9 - March 7, 2009 - 20:35

I have the same results. Changing "en" to "en-US" in the patch made it work. I would prefer to have "en" though as my site is in the UK - but keeping String Overrides happy is the priority here.

#10

sun - March 11, 2009 - 19:07

Confirming the bug.

Traceback for validating that "en-US" is a valid code that can be used for xml:lang and lang document attributes:

XHTML 1.0: The lang and xml:lang Attributes
http://www.w3.org/TR/xhtml1/#C_7
XHTML 1.0: "lang" attributes are based on HTML 4
http://www.w3.org/TR/xhtml1/#ref-html4
Language information and text direction: Specifying the language of content: the lang attribute
http://www.w3.org/TR/1999/REC-html401-19991224/struct/dirlang.html#h-8.1
Basic HTML data types: Language codes
http://www.w3.org/TR/1999/REC-html401-19991224/types.html#type-langcode

...and finally:
Basic HTML data types: Language codes
http://www.w3.org/TR/1999/REC-html401-19991224/struct/dirlang.html#langc...

#11

Rob Loach - March 12, 2009 - 00:31
Status:active» needs review

Awesome, got two patches for you guys to try out............. enus.patch just uses en-US, languagecode.patch allows you to choose what language to put in there.

AttachmentSize
enus.patch 745 bytes
languagecode.patch 2.22 KB

#12

jaydub - April 30, 2009 - 22:35

Both patches applied cleanly and worked as advertised.

The patch to stringoverrides.admin.inc in languagecode.patch is missing an '@' in the t() call in the description though. Re-rolled to fix that.

AttachmentSize
stringoverrides.admin_.inc_.248284.patch 1.5 KB

#13

smk-ka - July 2, 2009 - 13:41

And another all-in-one reroll.

AttachmentSize
248284-languagecode.patch 1.91 KB
 
 

Drupal is a registered trademark of Dries Buytaert.