Markup for link to foreign languages ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Andy Dingley

    Markup for link to foreign languages ?

    Assume an English language page, linking to a foreign history resource
    that's only available in a foreign language. Any suggestions on
    appropriate "best practice" markup, particularly regarding the scope
    of a lang attribute applied to a <a> element ?

    <p>Francisco de Miranda's <a
    href="http://www.simon-bolivar.org/bolivar/miranda_oci.htm l"
    title="Biograph y of Francisco de Miranda (in Spanish)"
    lang="es" >biography</a></p>

    --
    Smert' spamionam
  • Martin Honnen

    #2
    Re: Markup for link to foreign languages ?



    Andy Dingley wrote:
    [color=blue]
    > Assume an English language page, linking to a foreign history resource
    > that's only available in a foreign language. Any suggestions on
    > appropriate "best practice" markup, particularly regarding the scope
    > of a lang attribute applied to a <a> element ?
    >
    > <p>Francisco de Miranda's <a
    > href="http://www.simon-bolivar.org/bolivar/miranda_oci.htm l"
    > title="Biograph y of Francisco de Miranda (in Spanish)"
    > lang="es" >biography</a></p>[/color]

    What about hreflang e.g.
    <a hrefleng="es"
    see

    that seems to be the proper attribute.

    --

    Martin Honnen

    Comment

    • Andreas Prilop

      #3
      Re: Markup for link to foreign languages ?

      On Tue, 23 Nov 2004, Andy Dingley wrote:
      [color=blue]
      > <p>Francisco de Miranda's <a
      > href="http://www.simon-bolivar.org/bolivar/miranda_oci.htm l"
      > title="Biograph y of Francisco de Miranda (in Spanish)"
      > lang="es" >biography</a></p>[/color]

      <a href=... lang="es" title=Biography of Francisco de Miranda">
      Francisco de Miranda, biograf&iacute; a</a>

      --
      Top-posting.
      What's the most irritating thing on Usenet?

      Comment

      • Chris Simon

        #4
        Re: Markup for link to foreign languages ?

        Andy Dingley wrote:[color=blue]
        > Assume an English language page, linking to a foreign history resource
        > that's only available in a foreign language. Any suggestions on
        > appropriate "best practice" markup, particularly regarding the scope
        > of a lang attribute applied to a <a> element ?
        >
        > <p>Francisco de Miranda's <a
        > href="http://www.simon-bolivar.org/bolivar/miranda_oci.htm l"
        > title="Biograph y of Francisco de Miranda (in Spanish)"
        > lang="es" >biography</a></p>[/color]

        From the HTML spec:

        hreflang = langcode [CI]
        This attribute specifies the base language of the resource
        designated by href and may only be used when href is specified.

        In other words, lang is used to denote the language of the content of
        the element, and hreflang is used to denote the language of the linked
        resource. so in your example, you should use:

        ....lang="en" hreflang="es".. . - the lang being superfluous really if
        the base language is already English.

        In the LINK element, lang is used to denote the language of the title
        attribuet and hreflang, as above, denotes the language of the linked
        resource.

        --
        Chris Simon
        osianall@slcsze tnet.co.uk


        ** Get rid of all SLCs to reply directly **

        Comment

        • Andreas Prilop

          #5
          Re: Markup for link to foreign languages ?

          On Tue, 23 Nov 2004, Chris Simon wrote:
          [color=blue]
          > In the LINK element, lang is used to denote the language of the title
          > attribuet [...][/color]

          How do you come to this conclusion?

          Comment

          • Chris Simon

            #6
            Re: Markup for link to foreign languages ?

            Andreas Prilop wrote:[color=blue]
            > On Tue, 23 Nov 2004, Chris Simon wrote:
            >[color=green]
            >>In the LINK element, lang is used to denote the language of the title
            >>attribuet [...][/color]
            >
            > How do you come to this conclusion?[/color]

            From HTML spec section 12.3.3...

            In the following example, we use the hreflang attribute to tell search
            engines where to find Dutch, Portuguese, and Arabic versions of a
            document. Note the use of the charset attribute for the Arabic manual.
            Note also the use of the lang attribute to indicate that the value of
            the title attribute for the LINK element designating the French manual
            is in French.

            <HEAD>
            <TITLE>The manual in English</TITLE>
            <LINK title="The manual in Dutch"
            type="text/html"
            rel="alternate"
            hreflang="nl"
            href="http://someplace.com/manual/dutch.html">
            <LINK title="The manual in Portuguese"
            type="text/html"
            rel="alternate"
            hreflang="pt"
            href="http://someplace.com/manual/portuguese.html ">
            <LINK title="The manual in Arabic"
            type="text/html"
            rel="alternate"
            charset="ISO-8859-6"
            hreflang="ar"
            href="http://someplace.com/manual/arabic.html">
            <LINK lang="fr" title="La documentation en Fran&ccedil;ais "
            type="text/html"
            rel="alternate"
            hreflang="fr"
            href="http://someplace.com/manual/french.html">
            </HEAD>



            --
            Chris Simon
            osianall@slcsze tnet.co.uk


            ** Get rid of all SLCs to reply directly **

            Comment

            • Andy Dingley

              #7
              Re: Markup for link to foreign languages ?

              On Tue, 23 Nov 2004 18:48:44 +0100, Martin Honnen <mahotrash@yaho o.de>
              wrote:
              [color=blue]
              >What about hreflang[/color]

              Perfect ! I'd never noticed that before.

              Now, I wonder what I should do about xml:lang ? I guess that stays
              as English, along with lang.

              Comment

              • Jukka K. Korpela

                #8
                Re: Markup for link to foreign languages ?

                Andy Dingley <dingbat@codesm iths.com> wrote:
                [color=blue]
                > Assume an English language page, linking to a foreign history resource
                > that's only available in a foreign language. Any suggestions on
                > appropriate "best practice" markup, particularly regarding the scope
                > of a lang attribute applied to a <a> element ?[/color]

                In practice, it doesn't matter much. As discussed previously in this
                group, language markup is of rather limited usefuless and might even
                cause problems. It might be best to use language markup only for longish
                fragments of text in a language other than its environment.

                But in principle...
                [color=blue]
                > <p>Francisco de Miranda's <a
                > href="http://www.simon-bolivar.org/bolivar/miranda_oci.htm l"
                > title="Biograph y of Francisco de Miranda (in Spanish)"
                > lang="es" >biography</a></p>[/color]

                .... the WAI rules require that all changes in language be indicated, so
                the name Francisco de Miranda should have lang="en", or perhaps
                preferably lang="en-VE". You can do that for the occurrence in the text,
                using <span>, and somewhat problematically separating the name from the
                genitive suffix (which is English, not Spanish). But for the title
                attribute, that's impossible if the rest of the text there is English;
                you cannot indicate language changes inside attribute values (assuming
                you don't want to use Unicode language tag characters, and you really
                don't).

                Assuming you are prepared to change the title attribute into Spanish, the
                full language markup would be

                <span lang="es-VE" xml:lang="es-VE">Francisco de Miranda</span>’s
                <a
                href="http://www.simon-bolivar.org/bolivar/miranda_oci.htm l"
                title="Biograf& iacute;a de Francisco de Miranda"
                hreflang="es"
                lang="es-VE" xml:lang="es-VE">
                <span lang="en" xml:lang="en">b iography</span></a>

                Replace "en" by "en-US", "en-GB", or something else, to match the version
                of English used in the document in general. Replace "es" by the version
                of Spanish used in the biography, if known.

                Note that by definition, lang and xml:lang specify the language of the
                element's content _and all attributes_. If you need to indicate the
                language of an attribute as different from that of the content, the only
                way is to introduce auxiliary markup, as <span> above.

                (I omitted the <p> markup, which is irrelevant to the question, and isn't
                semantically correct here - the text does not constitute a paragraph.)

                This was mainly intended to demonstrate that full language markup doesn't
                pay off (yet).

                --
                Yucca, http://www.cs.tut.fi/~jkorpela/
                Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

                Comment

                • Andreas Prilop

                  #9
                  Re: Markup for link to foreign languages ?

                  On Tue, 23 Nov 2004, Chris Simon wrote:
                  [color=blue][color=green][color=darkred]
                  >>> In the LINK element, lang is used to denote the language of the title
                  >>> attribuet [...][/color]
                  >>
                  >> How do you come to this conclusion?[/color]
                  >
                  > From HTML spec section 12.3.3...[/color]

                  Oops, I'm sorry! I did not read your posting carefully enough.
                  I was thinking of the A element because the OP asked about anchor
                  and not about LINK.

                  Returning to the A element, I do think the following is right:

                  <a href=... lang="es" title="Biograph y">BiografĂ­a </a>

                  Comment

                  • Philipp Lenssen

                    #10
                    Re: Markup for link to foreign languages ?

                    Chris Simon wrote:
                    [color=blue]
                    > Andy Dingley wrote:[color=green]
                    > > Assume an English language page, linking to a foreign history
                    > > resource that's only available in a foreign language. Any
                    > > suggestions on appropriate "best practice" markup, particularly
                    > > regarding the scope of a lang attribute applied to a <a> element ?
                    > >
                    > > <p>Francisco de Miranda's <a
                    > > href="http://www.simon-bolivar.org/bolivar/miranda_oci.htm l"
                    > > title="Biograph y of Francisco de Miranda (in Spanish)"
                    > > lang="es" >biography</a></p>[/color]
                    >
                    > From the HTML spec:
                    >
                    > hreflang = langcode [CI]
                    > This attribute specifies the base language of the resource
                    > designated by href and may only be used when href is specified.
                    >[/color]

                    I wonder if this is actually useful HTML (i.e. understood in meaningful
                    ways which improved rendering) in at least one of today's popular
                    browsers or search engines.

                    --
                    Google Blogoscoped
                    A daily news blog and community covering Google, search, and technology.

                    Comment

                    • Jukka K. Korpela

                      #11
                      Re: Markup for link to foreign languages ?

                      Andreas Prilop <nhtcapri@rrz n-user.uni-hannover.de> wrote:
                      [color=blue]
                      > Returning to the A element, I do think the following is right:
                      >
                      > <a href=... lang="es" title="Biograph y">BiografĂ­a </a>[/color]

                      That would claim that "Biography" is a Spanish word. I don't think this
                      matters much in practice, but then again, this whole language markup
                      issue is not very practical at present.

                      --
                      Yucca, http://www.cs.tut.fi/~jkorpela/
                      Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

                      Comment

                      • Alan J. Flavell

                        #12
                        Re: Markup for link to foreign languages ?

                        On Wed, 24 Nov 2004, Philipp Lenssen wrote:
                        [color=blue]
                        > I wonder if this is actually useful HTML (i.e. understood in meaningful
                        > ways which improved rendering) in at least one of today's popular
                        > browsers or search engines.[/color]

                        Meantime, I guess the browser developers are asking themselves "I
                        wonder whether any popular web sites actually use this in their
                        pages". So, nothing happens.

                        For instance, my <link rel="whatever" ...> references did nothing in
                        the "popular" browsers for many years, although they didn't cause any
                        obvious harm (and they were useful in Lynx, and a couple of minority
                        graphical browsers). Somebody has to make a start, no? And now
                        Mozilla has caught up (although, for some reason, they still seem to
                        hide them by default).

                        Comment

                        • Philipp Lenssen

                          #13
                          Re: Markup for link to foreign languages ?

                          Alan J. Flavell wrote:
                          [color=blue]
                          > On Wed, 24 Nov 2004, Philipp Lenssen wrote:
                          >[color=green]
                          > > I wonder if this is actually useful HTML (i.e. understood in
                          > > meaningful ways which improved rendering) in at least one of
                          > > today's popular browsers or search engines.[/color]
                          >
                          > Meantime, I guess the browser developers are asking themselves "I
                          > wonder whether any popular web sites actually use this in their
                          > pages". So, nothing happens.
                          >[/color]

                          Interesting thought.

                          For myself, I gave up on implementing things which are of purely
                          theoretical and no pragmatic effort whatsoever, at least if they mean
                          additional work (however small this may be).

                          By the way, I could imagine one pragmatic use already: display a flag
                          next to "foreign-language links" using Firefox's CSS capabilities (IE,
                          for all I know, totally ignores attribute-selectors such as "a[@href]".)
                          [color=blue]
                          > For instance, my <link rel="whatever" ...> references did nothing in
                          > the "popular" browsers for many years, although they didn't cause any
                          > obvious harm (and they were useful in Lynx, and a couple of minority
                          > graphical browsers).[/color]

                          I include this "link" in some of my sites, but only because I knew at
                          least Opera would render it in a useful way!
                          [color=blue]
                          > Somebody has to make a start, no?[/color]

                          I think it's totally up to the browser vendors. Imagine, what is
                          easier: one browser vendor saying "Oh, let's include [fancy feature]
                          even only a handful people use it, it will take us 10 programmers two
                          weeks, plus we can advertise the W3C feature" or one web site creator
                          saying "Oh, I will start a movement that will convince 100,000
                          webmasters to finally start using [fancy feature] so the browsers will
                          start implementing it".

                          As soon as a browser implements a feature thousands (millions?) of
                          people start to use it! (Even when it's proprietary stuff.)
                          [color=blue]
                          > And now
                          > Mozilla has caught up (although, for some reason, they still seem to
                          > hide them by default).[/color]

                          OK.... Mozilla/ Firefox seems to be a step backwards in some
                          directions, especially user-stylesheets.

                          --
                          Google Blogoscoped
                          A daily news blog and community covering Google, search, and technology.

                          Comment

                          • Philipp Lenssen

                            #14
                            Re: Markup for link to foreign languages ?

                            Philipp Lenssen wrote:
                            [color=blue]
                            > By the way, I could imagine one pragmatic use already: display a flag
                            > next to "foreign-language links" using Firefox's CSS capabilities (IE,
                            > for all I know, totally ignores attribute-selectors such as
                            > "a[@href]".)[/color]

                            Oh yeah, let's not get into the discussion if flags are useful for
                            designating a language, I think Jukka has some good articles on that.

                            --
                            Google Blogoscoped
                            A daily news blog and community covering Google, search, and technology.

                            Comment

                            • Andy Dingley

                              #15
                              Re: Markup for link to foreign languages ?

                              On Wed, 24 Nov 2004 14:22:31 +0100, Andreas Prilop
                              <nhtcapri@rrz n-user.uni-hannover.de> wrote:
                              [color=blue]
                              >Returning to the A element, I do think the following is right:
                              >
                              > <a href=... lang="es" title="Biograph y">BiografĂ­a </a>[/color]

                              That might be right, but it's the inverse of what I'm after. I'm
                              thinking of a page in English, targeted at English readers, where the
                              linked resource is in Spanish because that's all there is available.

                              I'm pretty certain (thanks to Martin) that the best markup would be
                              this:

                              Francisco de Miranda's <a
                              href="http://www.simon-bolivar.org/bolivar/miranda_oci.htm l"
                              title="Biograph y of Francisco de Miranda (in Spanish)"
                              lang="en"
                              hreflang="es"[color=blue]
                              >biography (in Spanish)</a>[/color]

                              Comment

                              Working...