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.
| Attachment | Size |
|---|---|
| stringoverrides.module.patch | 497 bytes |

#1
http://drupal.org/cvs?commit=112245
#2
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
I can confirm that this has broen string replacement.
#4
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
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
We'll have to think of another solution to change "xx" reported in lang to "en".
#7
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
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
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
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
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.
#12
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.
#13
And another all-in-one reroll.