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.

Comments

robloach’s picture

Status: Needs review » Fixed
bcn’s picture

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...

moshe weitzman’s picture

Priority: Normal » Critical

I can confirm that this has broen string replacement.

robloach’s picture

Title: Fix for lang="xx" issue » Breaking patch: lang="en"
Version: 5.x-1.4 » 5.x-1.5
Assigned: Unassigned » robloach

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.

bcn’s picture

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.

robloach’s picture

Title: Breaking patch: lang="en" » Replace lang="xx" with lang="en"
Version: 5.x-1.5 » 5.x-1.x-dev
Assigned: robloach » Unassigned
Priority: Critical » Normal
Status: Needs work » Active

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

geodaniel’s picture

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'?

arvinsingla’s picture

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.

plan9’s picture

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.

sun’s picture

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...

robloach’s picture

Status: Active » Needs review
StatusFileSize
new2.22 KB
new745 bytes

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.

jaydub’s picture

StatusFileSize
new1.5 KB

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.

smk-ka’s picture

StatusFileSize
new1.91 KB

And another all-in-one reroll.

robloach’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.