Re: ASP.NET Internationalization bug?



Thanks, Juan.

I already added similar code to a page event in my masterpage code-beside.

elHtml.Attributes.Add("xml:lang",
Resources.GlobalLang.ContentAudienceLanguage)

To me, that is a temporary workaround. I still want to understand whether
the "eating" of the attribute I originally posted about is a bug, or if this
is actually happening for a reason.

Cordially,
Lee


"Juan T. Llibre" <nomailreplies@xxxxxxxxxxx> wrote in message
news:%23gBUqSC2IHA.4772@xxxxxxxxxxxxxxxxxxxxxxx
Hi, Lee.

re:
!> <html runat="server" xmlns="http://www.w3.org/1999/xhtml";
xml:lang="en-US" lang="en-US" dir="ltr">
!> no xml:lang attribute is rendered to the browser!
!> Remove the runat="server", and, voila, the xml:lang attribute is
rendered.

Try this :

<html xmlns="http://www.w3.org/1999/xhtml"; runat="server" id="someID">

<script runat="server">
someID.Attributes("xml:lang") = "en-US"
</script>



Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================

"Lee C." <nomail@xxxxxxxx> wrote in message
news:O%23KsAQA2IHA.4572@xxxxxxxxxxxxxxxxxxxxxxx
I think I have discovered a bug in ASP.NET, related to I18N.

In ASP.NET 3.5 I have to set runat="server" on the html element to use
explicit expressions. It appears that ASP.NET
eats the xml:lang attribute on the html element when it is set to
runat="server".

Of course I want to replace the hardcoded "en-US" values with (resource)
explicit expressions; but, for simplicity,
try this:

<html runat="server" xmlns="http://www.w3.org/1999/xhtml";
xml:lang="en-US" lang="en-US" dir="ltr">

...And you will find that no xml:lang attribute is rendered to the
browser! Remove the runat="server", and, voila, the
xml:lang attribute is rendered. :[

...Any ideas?

Cordially,
Lee







.



Relevant Pages

  • Re: Notepad and UTF-8
    ... the html element to tell the browser the language so it can use that as ... Each browser I try seems to have its own variation of what a page ... For example, in Safari, in the title element of a commercial site ... curl -I http://mecu.com.au ...
    (comp.infosystems.www.authoring.html)
  • Re: suggestions on how to markup quotes in article?
    ... > The browser defaults are not just a "nice fallback". ... To say that a paragraph element has a meaning is to say that it is a ... There are those who talk as if an HTML element has a meaning and this ...
    (comp.infosystems.www.authoring.html)
  • Re: Rationale question
    ... HTML element for that matter, ... heard about the offsetWidth/offsetHeight properties that IE introduced in IE 4 and that by now are part of the object model of element objects in browsers like Mozilla, Netscape 6 and later, Opera 7 and later and others? ... And there is more support in the DOM than for inline CSS, the W3C DOM Level 2 defines stuff to get the computed style and Mozilla and Opera support that e.g. ... JavaScript language some creators defined and implemented and the object model an application like a browser exposes to script. ...
    (comp.lang.javascript)
  • Re: Valid and center
    ... the body element is always a child of the html element. ... It can be just anything, by browser defaults, browser settings, or by browser style sheet. ...
    (comp.infosystems.www.authoring.stylesheets)
  • Re: Notepad and UTF-8
    ... the html element to tell the browser the language so it can use that as ... a hint to pick a font. ...
    (comp.infosystems.www.authoring.html)