HighDots Forums  

specify language as in <span lang="en">?

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss specify language as in <span lang="en">? in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jan Wagner
 
Posts: n/a

Default specify language as in <span lang="en">? - 05-17-2006 , 04:01 PM






Hi,

can't figure this one out, what's the CSS way to specify the language?

In HTML it would be simply an lang="xx" attribute, or XHTML
xml:lang="xx", but, how about in CSS? This would be required for a
screen reader (text to speech) for accessibility, to help the reader
software use the correct presentation method (e.g. correct language
module).

As a pseudo example of what I'm looking for: set Finnish 'fi' for
certain td's

td.fi {
lang: fi;
font-family: Arial,Helvetica;
}

I can find only info about "aural style sheets" but these don't
contain any way to specify the language. It's got to be somewhere,
though... (?)

thanks,
- Jan

Reply With Quote
  #2  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: specify language as in <span lang="en">? - 05-17-2006 , 04:42 PM






"Jan Wagner" <no_spam (AT) thanks (DOT) net> wrote:

Quote:
can't figure this one out, what's the CSS way to specify the language?
None. Language specification is a matter of metadata, to be made in markup,
not a presentation issue. It is declarative, instead of recommending any
particular rendering. Such language information might be _utilized_ in CSS
rules, in suitable selectors, e.g. when saying that texts in some language
be rendered in some particular font. But even this is mostly just theory.

Quote:
In HTML it would be simply an lang="xx" attribute, or XHTML xml:lang="xx",
Right.

Quote:
This would be required for a screen reader (text to speech) for
accessibility, to help the reader software use the correct presentation
method (e.g. correct language module).
In theory, yes. In practice, few programs make any sensible use of language
information. In any case, it's a markup issue, not a style sheet issue.

Quote:
As a pseudo example of what I'm looking for: set Finnish 'fi' for certain
td's

td.fi {
lang: fi;
font-family: Arial,Helvetica;
}
This postulates that you have <td class="fi"> in your markup. Why not use
<td lang="fi"> instead? Well, you might have a reason to use _both_ a lang
attribute _and_ a class attribute, since td.fi is well supported,
td[lang="fi"] is very poorly supported at present.

Quote:
I can find only info about "aural style sheets"
which hardly have any implementation worth mentioning.

Quote:
but these don't contain any way to specify the language.
They are not supposed to. Language is an inherent property of text, not a
casual suggestion on rendering.



Reply With Quote
  #3  
Old   
Spartanicus
 
Posts: n/a

Default Re: specify language as in <span lang="en">? - 05-17-2006 , 05:35 PM



"Jukka K. Korpela" <jkorpela (AT) cs (DOT) tut.fi> wrote:

Quote:
I can find only info about "aural style sheets"

which hardly have any implementation worth mentioning.
Opera on WinNT (W2K & XP) supports a good portion and useful set of
aural CSS properties and values.

--
Spartanicus


Reply With Quote
  #4  
Old   
Oliver Block
 
Posts: n/a

Default Re: specify language as in <span lang="en">? - 05-17-2006 , 07:11 PM



Jan Wagner wrote:

Quote:
Hi,

can't figure this one out, what's the CSS way to specify the language?

Following the link might be what you need:

<http://www.w3.org/International/tutorials/tutorial-lang/>

Best Regards,

Oliver



Reply With Quote
  #5  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: specify language as in <span lang="en">? - 05-18-2006 , 12:56 AM



"Johannes Koch" <koch (AT) w3development (DOT) de> wrote:

Quote:
Jukka K. Korpela wrote:
In theory, yes. In practice, few programs make any sensible use of
language information.

Screen readers do.
A few of them do, most in new versions only, and for a very limited set of
languages.



Reply With Quote
  #6  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: specify language as in <span lang="en">? - 05-18-2006 , 01:08 AM



"Spartanicus" <invalid (AT) invalid (DOT) invalid> wrote:

Quote:
I can find only info about "aural style sheets"

which hardly have any implementation worth mentioning.

Opera on WinNT (W2K & XP) supports a good portion and useful set of
aural CSS properties and values.
You mean the CSS 2.0 aural style sheet properties, which are being phased
out in the CSS 2.1 draft? While I can see some potential use for them in
limited applications, like intranets where Opera is used for this very
purpose, this does not seem useful in authoring for the WWW. There would be
far too much work as compared with the small number of users who use Opera
in a mode where aural style sheets might matter. In effect, I would regard
the issue quite comparable to using purely browser-specific extension, for a
minority browser.



Reply With Quote
  #7  
Old   
Spartanicus
 
Posts: n/a

Default Re: specify language as in <span lang="en">? - 05-18-2006 , 02:23 AM



"Jukka K. Korpela" <jkorpela (AT) cs (DOT) tut.fi> wrote:

Quote:
I can find only info about "aural style sheets"

which hardly have any implementation worth mentioning.

Opera on WinNT (W2K & XP) supports a good portion and useful set of
aural CSS properties and values.

You mean the CSS 2.0 aural style sheet properties, which are being phased
out in the CSS 2.1 draft?
A key aim of CSS 2.1 is to remove those parts that had (not yet) been
implemented. Removal from CSS 2.1 does not mean that it has been
abandoned. The aural CSS from 2.0 reappears in CSS3 virtually unchanged.

Quote:
While I can see some potential use for them in
limited applications, like intranets where Opera is used for this very
purpose, this does not seem useful in authoring for the WWW. There would be
far too much work as compared with the small number of users who use Opera
in a mode where aural style sheets might matter. In effect, I would regard
the issue quite comparable to using purely browser-specific extension, for a
minority browser.
Opera tends to lead the pack in implementing stuff only if there is a
reasonable use case. That was the case with Opera's implementation of
CSS properties & values not supported by other main browsers. Although
of little use on the web they are used to good effect in Opera's user
stylesheets.

Their implementation of aural CSS seems to have been motivated by the
hope that developers would start to experiment with creating XHTML +
Voice applications, e.g. to create a UI for non desktop use. This is an
area where Opera has market opportunities and ambitions more so than
other manufacturers.

I've found it enlightening to be able to shape the presentation in the
aural domain. It allowed me to get a proper feel for what is possible
with aural user interfaces. Before Opera's implementation the only
option was some obscure piece of nix software called EmacSpeak that
no-one that I know managed to get working.

--
Spartanicus


Reply With Quote
  #8  
Old   
Johannes Koch
 
Posts: n/a

Default Re: specify language as in <span lang="en">? - 05-18-2006 , 03:30 AM



Jukka K. Korpela wrote:

Quote:
"Johannes Koch" <koch (AT) w3development (DOT) de> wrote:

Jukka K. Korpela wrote:

In theory, yes. In practice, few programs make any sensible use of
language information.

Screen readers do.

A few of them do,
The most widely used do.

Quote:
most in new versions only,
What is new? Three years old?

Quote:
and for a very limited set
of languages.
That's true, of course.

--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)


Reply With Quote
  #9  
Old   
Jan Wagner
 
Posts: n/a

Default Re: specify language as in <span lang="en">? - 05-18-2006 , 12:40 PM



Hi,

thanks for your infos!

Jukka K. Korpela wrote:
Quote:
"Jan Wagner" <no_spam (AT) thanks (DOT) net> wrote:
As a pseudo example of what I'm looking for: set Finnish 'fi' for
certain td's

td.fi {
lang: fi;
font-family: Arial,Helvetica;
}

This postulates that you have <td class="fi"> in your markup. Why not
use <td lang="fi"> instead? Well, you might have a reason to use _both_
a lang attribute _and_ a class attribute, since td.fi is well supported,
td[lang="fi"] is very poorly supported at present.
Main reason for <td class="fi"> in markup: Dreamweaver MX allows
very easy setting of table column class, but lang attribute just
isn't there by default (would need to write a script, too much
bother). Anyway. VK's code suggestion looks like a pretty good
almost-CSS way to achieve this.

Quote:
but these don't contain any way to specify the language.

They are not supposed to. Language is an inherent property of text, not
a casual suggestion on rendering.
Sort of good point there... But IMHO the lang attribute can also be
"casual suggestion on rendering", mainly for TTS. For example,
present the speech according to British or US English without
changing the content, or present in some dialect, again without
changing content. Like one would change the layout presentation of a
page, one could also change the speech presentation. Pity this isn't
directly part of CSS, just indirectly and "almost" through aural.

(thanks others too for your input!)

- Jan


Reply With Quote
  #10  
Old   
Jan Wagner
 
Posts: n/a

Default Re: specify language as in <span lang="en">? - 05-18-2006 , 12:41 PM



Jukka K. Korpela wrote:
Quote:
"Johannes Koch" <koch (AT) w3development (DOT) de> wrote:

Jukka K. Korpela wrote:
In theory, yes. In practice, few programs make any sensible use of
language information.

Screen readers do.

A few of them do, most in new versions only, and for a very limited set
of languages.
JAWS supports quite a few.

The MS Speech API with 3rd party extensions does, also.
http://www.microsoft.com/speech/eval...y/engines.mspx

Considering that even something as exotic as Finnish is included in
JAWS, I would not talk about a very limited set of languages! ;-))

regards,
- Jan


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.