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
  #11  
Old   
Jan Wagner
 
Posts: n/a

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






VK wrote:
Quote:
It seems overlooked in Aural CSS specs. Use behavior twinpair (IE 5.5+,
FF1.0+, Moz Suite 1.0+, Camino 1.0+, NN8+)
snip nice code

Thanks for the interesting solution! Looks pretty good, though
complex (or rather, just about complex enough to suit me very well
;-)). I'll give that one a go, thx for sharing.

- Jan


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

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






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

Quote:
Main reason for <td class="fi"> in markup:
I guess you mean a reason for _not_ having such markup, since your question
seems to revolve around avoiding the use of markup for indicating language.

Quote:
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).
Huh? A table column may have a lang attribute when declared using <col
lang="...">. Whether programs support this is a different issue. But
indicating language is surely a job for HTML, not for CSS, still less some
kludge that is not based on published specifications and requires _both_ CSS
_and_ scripting to be "on" - there's no reason to assume they are,
especially in situations where language information could be beneficial
(e.g., speech browsers, search engines).

You can write lang attributes for cell elements (<th>, <td>) if needed. If
your authoring tool does not let you do that conveniently, do it in a simple
though inconvenient way, or get a better authoring tool.

Quote:
Anyway. VK's code suggestion looks like a pretty good
almost-CSS way to achieve this.
The kludge tries to modify the document tree via client-side scripting. Why
don't you just use adequate markup in the first place? This is comparable to
using <foo> markup and then some kludge to change <foo> to <bar> in the
browser.

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...
It's the whole point here.

Quote:
But IMHO the lang attribute can also be
"casual suggestion on rendering", mainly for TTS.
No it isn't, any more than <h1> is a suggestion on rendering, even though it
may be rendered in large font size, or in read, or in slow and emphatic
voice.

Quote:
For example,
present the speech according to British or US English without
changing the content, or present in some dialect, again without
changing content.
It would be simply incorrect to label a document or part of document as,
say, British English when it isn't. Even in the (rather rare) special case
where the same document could be labeled as lang="en-GB" or as lang="en-US",
because the document contains no expressions where the two language forms
differ, it would still be a matter of _content_. The element <span
lang="en">elf</span> has a _meaning_ different from <span
lang="de">elf</span>.

Quote:
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.
It's not even indirectly part of CSS.



Reply With Quote
  #13  
Old   
Alan J. Flavell
 
Posts: n/a

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



On Thu, 18 May 2006, Jan Wagner wrote:

Quote:
Jukka K. Korpela wrote:

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.
Keep in mind that lang="fi" is a property of the content itself, not
merely a presentational proposal. The fact that some lesser browsers
fail to honour the proposal isn't exactly a tragedy: CSS is optional
by design, after all.

Quote:
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).
The WWW cares not in the least what tool you used to create your
content: it only cares about the result which gets extruded out of
your web server. If your tool seems inadequate to the purpose - put
it aside. Blaming shortcomings of the tool for inadequacies in what
you publish is no kind of excuse.

Quote:
Anyway. VK's code suggestion
looks like a pretty good almost-CSS way to achieve this.
Does it? In the time available to me, I've been unable to distinguish
VK from a common troll. It may be that it occasionally gets something
right, but I'd prefer to get my advice from folks with a much better
track record (and I'd obviously put Jukka into that class, with
stars).

Quote:
They are not supposed to. Language is an inherent property of
text, not a casual suggestion on rendering.

Sort of good point there...
It's more than "sort of".

Quote:
But IMHO the lang attribute can also be "casual suggestion on
rendering",
I can't make any sense of that remark. Are you proposing that some
language-free text in HTML could be proposed in alternative languages
via CSS? I've little idea how that would look!

Quote:
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.
You seem to be doing nothing more than proposing different (regional)
voices for rendering the same original text. The text itself in in a
given language, and you can mark-up that language for what it is (in
HTML). That does NOT change under your proposal.

Quote:
Like one would change the layout presentation of a page, one could
also change the speech presentation.
Sure. But that would not change the language of the original text!

You really seem to have lost your grasp of the distinction between the
original content, and a rendering suggestion.


Reply With Quote
  #14  
Old   
VK
 
Posts: n/a

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




Alan J. Flavell wrote:
Quote:
In the time available to me, I've been unable to distinguish
VK from a common troll.
That was obviously pointless trolling in my most in this thread: in
each line of the working code I presented.

Do not mix "trolling" with "the last century dust and rust cleaning".
The first I never do - thus I never start a discussion just to have a
discussion. The latter I do rather regularly - but not as the only
purpose of my life.



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

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



Jukka K. Korpela wrote:
Quote:
Jan Wagner <no_spam (AT) thanks (DOT) net> scripsit:

Main reason for <td class="fi"> in markup:

I guess you mean a reason for _not_ having such markup, since your
question seems to revolve around avoiding the use of markup for
indicating language.
No - for _not_ having lang="fi" in table cells. Also since I have a
large set of mixed language pages in html, and indicating the
languages was a later requirement for the site, I'd obviously try to
do this addition in some fastest possible way.

Quote:
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).

Huh? A table column may have a lang attribute when declared using <col
lang="...">.
Thanks for the info, wasn't aware of the HTML col+colgroup tags.

This is definitely the simplest way to add language indication to
these existing pages. :-)

Quote:
You can write lang attributes for cell elements (<th>, <td>) if needed.
If your authoring tool does not let you do that conveniently, do it in a
simple though inconvenient way, or get a better authoring tool.
What a stupid and unnecessary comment. If you make these, at least
try to suggest a "better" authoring tool!

Quote:
Anyway. VK's code suggestion looks like a pretty good
almost-CSS way to achieve this.

The kludge tries to modify the document tree via client-side scripting.
Why don't you just use adequate markup in the first place? This is
comparable to using <foo> markup and then some kludge to change <foo> to
bar> in the browser.
Whatever is simpler (as in, faster to implement for existing pages).
Col+colgroup looks now much better than VK's hack, though.

Quote:
It would be simply incorrect to label a document or part of document as,
say, British English when it isn't.
Nah, I meant label it to be read out (presented) in e.g. British
English or other even if it the actual content might not be. But
likely that would be better done with some attribute other than 'lang'.

- Jan


Reply With Quote
  #16  
Old   
Alan J. Flavell
 
Posts: n/a

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



On Fri, 19 May 2006, Jan Wagner wrote:

Quote:
Jukka K. Korpela wrote:

Huh? A table column may have a lang attribute when declared using
col lang="...">.

Thanks for the info, wasn't aware of the HTML col+colgroup tags.
I'm a bit uneasy that Jukka proposed that without further comment.
http://www.w3.org/TR/CSS21/tables.html#q4

However, in the source document cells are descendants of rows, never
of columns. Nevertheless, some aspects of cells can be influenced by
setting properties on columns.

[... followed by a very short list of properties]

Quote:
This is definitely the simplest way to add language indication to
these existing pages. :-)
Oh, agreed, and the meaning (of the HTML) is clear, no argument with
that. Just that if one intends to use the language attribute to apply
some presentational effects via CSS, I think there are going to be
quite severe limits on what can be achieved with it.

[...]

Quote:
Nah, I meant label it to be read out (presented) in e.g. British
English or other even if it the actual content might not be. But
likely that would be better done with some attribute other than
'lang'.
It wouldn't just be "better" - mis-labelling the language (in HTML)
for presentational effect would be plain wrong.


Reply With Quote
  #17  
Old   
VK
 
Posts: n/a

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




Jukka K. Korpela wrote:
Quote:
Huh? A table column may have a lang attribute when declared using <col
lang="...">. Whether programs support this is a different issue.
And a very interesting one: because neither IE nor FF nor other browser
I'm aware of do not support this coding. Overall colgroup/col support
on browsers except IE is very poor, especially on FF. The only
attribute really recognized universally in col is width. This way <col
lang="fi"> would have an academical value only: profoundly correct and
utterly useless.

OP is welcome to try it though as I may be trolling again.



Reply With Quote
  #18  
Old   
VK
 
Posts: n/a

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




VK wrote:
Quote:
The only
attribute really recognized universally in col is width.
And SPAN - in application to WIDTH



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

Default Re: specify language as in <span lang="en">? - 05-19-2006 , 04:52 AM



Alan J. Flavell <flavell (AT) physics (DOT) gla.ac.uk> scripsit:

Quote:
On Fri, 19 May 2006, Jan Wagner wrote:

Jukka K. Korpela wrote:

Huh? A table column may have a lang attribute when declared using
col lang="...">.

Thanks for the info, wasn't aware of the HTML col+colgroup tags.

I'm a bit uneasy that Jukka proposed that without further comment.
I had a comment: "Whether programs support this is a different issue." The
point is that if you declare language as a matter of principle, as good
practice, with virtue as its own reward, you can do things in a simple way
as defined in the specifications - but if you expect some practical gain,
you need to check things out and do some testing.

I'd regard that as irrelevant when considering the meaning and effect of
lang attributes in HTML. They are not supposed to have, and they don't have,
any direct effect on styling, any more than a class attribute has. If we
discussed the meaning of selectors like lang(...), it would be a different
(and tough) question.

The HTML 4.01 specification describes, in an odd place and under a strange
heading, the lang attribute as being "inherited" from columns to cells:
http://www.w3.org/TR/REC-html40/stru...tml#h-11.3.2.1

Quote:
This is definitely the simplest way to add language indication to
these existing pages. :-)

Oh, agreed, and the meaning (of the HTML) is clear, no argument with
that. Just that if one intends to use the language attribute to apply
some presentational effects via CSS, I think there are going to be
quite severe limits on what can be achieved with it.
The lang attribute, unlike some presentational attributes like align and
width, has no CSS counterpart - it is not implicitly mapped to anything in
CSS. _Using_ the attribute in _selectors_ is a different matter, and here we
have the restrictive principle that the pseudo-element [lang |= "..."]
refers only to those elements that have the lang attribute set in markup,
with no inheritance considerations. Using :lang(...) would be a different
matter, but I'm afraid it has even less support.



Reply With Quote
  #20  
Old   
Alan J. Flavell
 
Posts: n/a

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



On Fri, 19 May 2006, Jukka K. Korpela wrote:

Quote:
Alan J. Flavell <flavell (AT) physics (DOT) gla.ac.uk> scripsit:

I'm a bit uneasy that Jukka proposed that without further comment.

I had a comment: "Whether programs support this is a different issue."
Apologies. I was thinking more in terms of what could be achieved
according to the CSS specification - rather than actual implementation
details. AIUI, /some/ browsers already do things (in terms of
carrying-over CSS properties from cols to cells) which the
specification implies that they should NOT be doing...

Quote:
http://www.w3.org/TR/CSS21/tables.html#q4

I'd regard that as irrelevant when considering the meaning and
effect of lang attributes in HTML.
Agreed.

Quote:
They are not supposed to have, and they don't have, any
direct effect on styling, any more than a class attribute has.
Hmmm... actually, some browsers will use lang attributes to influence
their default choice of font, for example. I don't think such
behaviour is actually wrong.

Quote:
If we discussed the meaning of selectors like lang(...), it would be
a different (and tough) question.
Agreed.

Quote:
The HTML 4.01 specification describes, in an odd place and under a
strange heading, the lang attribute as being "inherited" from
columns to cells:
http://www.w3.org/TR/REC-html40/stru...tml#h-11.3.2.1
Titled "Inheritance of alignment specifications", I see ...

Now this is remarkable. I wonder how many other readers have managed
to find that yet? I have to say frankly that it had completely passed
me by.

So, in a section which purports to explain the inheritance of cell
alignment, it actually states, almost as a throwaway aside, that HTML
lang, dir, and style attributes are supposed to inherit from cols to
cells in the same way as valign. (I guess this calls for some tests
on actual browsers, but that will have to wait for another day, unless
you know some existing test suites which explore it already).

This seems to mean that an explicit <style...> attribute on a col
could be used to influence the presentation of the whole column,
provided some other style attribute did not supervene. In ways that a
class or id applied to the col and called-out from a stylesheet could
*not* (other than the limited shortlist of properties which I cited
before). *Is* that what it means?

Quote:
The lang attribute, unlike some presentational attributes like align
and width, has no CSS counterpart - it is not implicitly mapped to
anything in CSS. _Using_ the attribute in _selectors_ is a different
matter, and here we have the restrictive principle that the
pseudo-element [lang |= "..."] refers only to those elements that
have the lang attribute set in markup, with no inheritance
considerations. Using :lang(...) would be a different matter, but
I'm afraid it has even less support.
Agreed with those points.

Thanks for this instructive exchange!


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.