469,360 Members | 1,774 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,360 developers. It's quick & easy.

Change of natural language inside alt text?

On some of my English language webpages, I have images of Dutch books.
In the alt text for this image, I give the title of the book, for
example:

<img src="maan.jpg" alt="Cover of De reis naar de maan" />

Now I would like to indicate that the phrase 'De reis naar de maan' is
Dutch, for the profit of users with a screen reader and others who may
benefit from it. Unfortunately I can't use a <span lang="nl"> inside
the alt attribute. I could perhaps do something like

<img src="maan.jpg" lang="nl" alt="De reis naar de maan" />

but I guess that would mean that the natural language of the image is
Dutch, which is nonsense.

Is there any other way to indicate the language of an alt text, and
even a language change inside an alt text?

Thanks,
Garmt de Vries.
Jul 23 '05 #1
6 2625
On 8/9/04 10:37 am, Garmt de Vries wrote:
... I could perhaps do something like

<img src="maan.jpg" lang="nl" alt="De reis naar de maan" />

but I guess that would mean that the natural language of the image is
Dutch, which is nonsense.


That looks fine to me.

(From <http://www.w3.org/TR/WD-html40-970917/struct/objects.html#adef-alt>):
alt = cdata
For user agents that cannot display images, forms, or applets, this attribute
specifies alternate text. The language of the alternate
text is specified by the lang attribute.


--
Philip Ronan
ph***********@virgin.net
(Please remove the "z"s if replying by email)
Jul 23 '05 #2
gd*****@hotmail.com (Garmt de Vries) wrote:
<img src="maan.jpg" alt="Cover of De reis naar de maan" />

Now I would like to indicate that the phrase 'De reis naar de maan' is
Dutch, for the profit of users with a screen reader and others who may
benefit from it. Unfortunately I can't use a <span lang="nl"> inside
the alt attribute.


<span lang="nl"><img src="maan.jpg" alt="Cover of De reis naar de maan"
/></span>

I'd suggest that "Cover of" isn't Dutch. Use "Omslag van" instead.

--
Spartanicus
Jul 23 '05 #3
Garmt de Vries wrote:
<img src="maan.jpg" alt="Cover of De reis naar de maan" />


<object data="maan.jpg" type="image/jpeg">
Cover of <cite xml:lang="nl">De reis naar de maan</cite>.
</object>

Support for <object> isn't as wide as for <img>, and IE does weird things
with scroll bars, but this should properly convey the information.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

Jul 23 '05 #4
gd*****@hotmail.com (Garmt de Vries) wrote:
<img src="maan.jpg" alt="Cover of De reis naar de maan" />

Now I would like to indicate that the phrase 'De reis naar de maan' is
Dutch, for the profit of users with a screen reader and others who may
benefit from it.
A noble goal, but HTML is too limited for that in practice (since
<object> is an impractical solution to embedding images in WWW
authoring). Besides, I'm afraid most speech-based user agents don't
support language switching very well, though the situation is improving.
I wonder if they support Dutch - they probably have a fairly limited
language repertoire.
<img src="maan.jpg" lang="nl" alt="De reis naar de maan" />

but I guess that would mean that the natural language of the image is
Dutch, which is nonsense.


By definition, the lang attribute specifies the language of the element's
content _and attributes_, so it would be OK. After all, an image _may_
have a language property; for example, a book cover probably contains the
name of the book, in a particular language. I doubt whether we'll ever
see user agents that are able to scan an image, recognize text in it, and
speak it, using the language information in the lang attribute. But
there's nothing illogical in the idea of using language information when
processing an image.

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

Jul 23 '05 #5
In message <Xn*****************************@193.229.0.31>, Jukka K.
Korpela <jk******@cs.tut.fi> writes
gd*****@hotmail.com (Garmt de Vries) wrote:
<img src="maan.jpg" alt="Cover of De reis naar de maan" />

Now I would like to indicate that the phrase 'De reis naar de maan' is
Dutch, for the profit of users with a screen reader and others who may
benefit from it.


A noble goal, but HTML is too limited for that in practice (since
<object> is an impractical solution to embedding images in WWW
authoring). Besides, I'm afraid most speech-based user agents don't
support language switching very well, though the situation is improving.
I wonder if they support Dutch - they probably have a fairly limited
language repertoire.
<img src="maan.jpg" lang="nl" alt="De reis naar de maan" />

but I guess that would mean that the natural language of the image is
Dutch, which is nonsense.


By definition, the lang attribute specifies the language of the element's
content _and attributes_, so it would be OK. After all, an image _may_
have a language property; for example, a book cover probably contains the
name of the book, in a particular language. I doubt whether we'll ever
see user agents that are able to scan an image, recognize text in it, and
speak it, using the language information in the lang attribute. But
there's nothing illogical in the idea of using language information when
processing an image.

Couldn't try it in Dutch ..... but the same concept (lang="xx" in the
<IMG> tag) works OK in French.

regards.

--
Jake
Jul 23 '05 #6
gd*****@hotmail.com (Garmt de Vries) wrote in message news:<52**************************@posting.google. com>...

Is there any other way to indicate the language of an alt text, and
even a language change inside an alt text?


Thanks, all, for your comments. I think I'll stick with what I had.
I'm not too keen on using <object> instead of <img>. Also, I'd like to
let viitors of these English pages know that the image is a cover of a
book, so I should write "Cover of" rather than "Omslag van". This way,
the title itself won't be pronounced properly, but it wasn't really
going to be anyway, since Dutch is probably not widely supported by
speech browsers...

Garmt de Vries.
Jul 23 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Andrew E | last post: by
4 posts views Thread by Christiaan | last post: by
4 posts views Thread by Richard Cornford | last post: by
8 posts views Thread by Roman | last post: by
7 posts views Thread by David | last post: by
1 post views Thread by Hendri Adriaens | last post: by
4 posts views Thread by snipes2002 | last post: by
1 post views Thread by Steven Bird | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.