473,406 Members | 2,293 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

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 2859
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Andrew E | last post by:
Hi all I've written a python program that adds orders into our order routing simulation system. It works well, and has a syntax along these lines: ./neworder --instrument NOKIA --size 23...
4
by: Christiaan | last post by:
I am trying to create a small javascript to change the button text and then submit it and do all kinds of form validations. So I have a button with the value "Save", when the button is clicked it...
4
by: Richard Cornford | last post by:
For the last couple of months I have been trying to get the next round of updates to the FAQ underway and been being thwarted by a heavy workload (the project I am working on has to be finished an...
8
by: Roman | last post by:
Hello i got this simple problem using nhibernate. I want to chang the id( primary key of the) object and update it, to change this key. i me getting nhibernate exception like this: identifier...
7
by: David | last post by:
Hi, I'd really appreciate any help. Im trying to change a label over and over again. I can change it the first time, by using the following code, however it never works again, how can i do this...
1
by: Hendri Adriaens | last post by:
Hi, I have an onmouseover script that displays a div with some comment. There are several links getting this onmouseover functionality, all with their own comment text. Now I want the div to...
4
by: snipes2002 | last post by:
hi all i have a homework but am not so good in java so i need some help !! i have to do a text box and put in it a pattern and there is a big text box under it so when i put a pattern in the first...
1
by: Steven Bird | last post by:
NLTK — the Natural Language Toolkit — is a suite of open source Python modules, data sets and tutorials supporting research and development in natural language processing. It comes with 50k lines...
0
by: sivamedia | last post by:
hai to all I want to Translate the given English Text into some other language for Example English - French, English - Hindi etc. i found that 1)we have to enter the database of each and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.