Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug: Built-in spell checker ignores lang attribute

15 views
Skip to first unread message

Boris Schaeling

unread,
Mar 23, 2009, 12:13:42 PM3/23/09
to
While I appreciate the built-in spell checker in Opera 10a I really hope
that Opera 10 will look for any lang attributes and then choose the
appropriate language for the spell checker. The spell checker is an
annoyance if the webpage is not written in English as everything is
underlined.

If you want to test yourself: Open
http://www.highscore.de/grundlagen/programmiersprachen.html, click on
"Fehler entdeckt? Korrigieren Sie ihn in Ihrem Browser!", then click on
the button "Editieren" followed by a mouse click on a blue paragraph -
nearly all words are underlined. However the webpage contains this right
after the opening body tag:

<div class="chapter" lang="de">

If a language isn't supported by the spell checker it would also be fine
if the spell checker is temporarily (and automatically!) deactived.

Boris

Naruki Bigglesworth

unread,
Mar 30, 2009, 2:04:54 AM3/30/09
to
Oddly enough, I had never considered that issue before, but it definitely
makes sense. Also, I don't think this is just Opera.

Firefox did the same thing, although it gives up after about a 100 words.

Chrome has a weird idea for spell-checking: it waits for me to put the
mouse cursor on a word before it says it is misspelled.

I have IE 6, so no spell-checker available for testing there.

This seems to be an area that all browsers may need tweaking in.

Rijk van Geijtenbeek

unread,
Apr 2, 2009, 6:07:49 AM4/2/09
to
On Mon, 30 Mar 2009 08:04:54 +0200, Naruki Bigglesworth <Nar...@nothankyou.com> wrote:

> Oddly enough, I had never considered that issue before, but it definitely
> makes sense. Also, I don't think this is just Opera.
>
> Firefox did the same thing, although it gives up after about a 100 words.
>
> Chrome has a weird idea for spell-checking: it waits for me to put the
> mouse cursor on a word before it says it is misspelled.
>
> I have IE 6, so no spell-checker available for testing there.
>
> This seems to be an area that all browsers may need tweaking in.

You can of course manually disable the spelling checker, or switch to another language (before 10 final there will be an easy method of installing more dictionaries).

Automatic switching would indeed be an interesting feature, but might not so easy to get right. We'd have to find out if the lang attribute actually gets used correctly for this to be useful, I wouldn't be amazed if lots of international sites reuse templates that simple set lang=en (or xml:lang="en") on the HTML element.

But even then, for multi-lingual web users this will always be a hassle. On twitter.com, I sometimes write in English and sometimes in Dutch. Only automatic content analyzing for language detection would help here, not sure if that would be worth the trouble before the 140 character are filled there :)


> On Mon, 23 Mar 2009 17:13:42 +0100, Boris Schaeling wrote:
>
>> While I appreciate the built-in spell checker in Opera 10a I really hope
>> that Opera 10 will look for any lang attributes and then choose the
>> appropriate language for the spell checker. The spell checker is an
>> annoyance if the webpage is not written in English as everything is
>> underlined.
>>
>> If you want to test yourself: Open
>> http://www.highscore.de/grundlagen/programmiersprachen.html, click on
>> "Fehler entdeckt? Korrigieren Sie ihn in Ihrem Browser!", then click on
>> the button "Editieren" followed by a mouse click on a blue paragraph -
>> nearly all words are underlined. However the webpage contains this right
>> after the opening body tag:
>>
>> <div class="chapter" lang="de">
>>
>> If a language isn't supported by the spell checker it would also be fine
>> if the spell checker is temporarily (and automatically!) deactived.

--
Rijk van Geijtenbeek
Opera Software ASA, Documentation & QA
Tweak: http://my.opera.com/Rijk/blog/

"The most common way to get usability wrong is to listen to what users
say rather than actually watching what they do." - J.Nielsen

Boris Schaeling

unread,
Apr 2, 2009, 8:29:20 AM4/2/09
to
On Thu, 02 Apr 2009 12:07:49 +0200, Rijk van Geijtenbeek
<ri...@opera.removethiz.com> wrote:

> [...]Automatic switching would indeed be an interesting feature, but

> might not so easy to get right. We'd have to find out if the lang
> attribute actually gets used correctly for this to be useful, I wouldn't
> be amazed if lots of international sites reuse templates that simple set
> lang=en (or xml:lang="en") on the HTML element.

There are always web authors who don't write HTML code according to the
standard. But then it's them who deserve to be punished and not all the
other web authors who set lang correctly. If browsers start to question
the reliability of attribute values then everything is open to
interpretation.

> But even then, for multi-lingual web users this will always be a hassle.

Fortunately the lang attribute can be set within any HTML tag.

> On twitter.com, I sometimes write in English and sometimes in Dutch.
> Only automatic content analyzing for language detection would help here,
> not sure if that would be worth the trouble before the 140 character are
> filled there :)

I agree. This is a good example where it should be possible to switch off
the spell checker if it's not clear what language a visitor will use. The
lang attribute won't help here. But adding a spell checker just because
everyone thinks spell checkers are the next big thing in browsers doesn't
make any sense if it's not implemented in a way which helps users. And the
minimum requirement in my opinion for a spell checker to be useful is to
pick the right language (and if it's unknown not to pick any language).

Boris

Peter Krefting

unread,
Apr 2, 2009, 8:55:43 AM4/2/09
to
Den 2009-04-02 13:29:20 skrev Boris Schaeling <bo...@highscore.de>:

> And the minimum requirement in my opinion for a spell checker to be
> useful is to pick the right language (and if it's unknown not to pick
> any language).

This goes for e-mail as well. I regularly write e-mail in three different
languages (Swedish, English and Norwegian), and would appreciate being
able to spell check all languages.

--
\\// Peter - http://www.softwolves.pp.se/

The opinions expressed are my own. Deal with it.

Rijk van Geijtenbeek

unread,
Apr 2, 2009, 10:36:46 AM4/2/09
to
On Thu, 02 Apr 2009 14:55:43 +0200, Peter Krefting <pe...@softwolves.pp.se> wrote:

> Den 2009-04-02 13:29:20 skrev Boris Schaeling <bo...@highscore.de>:
>
>> And the minimum requirement in my opinion for a spell checker to be
>> useful is to pick the right language (and if it's unknown not to pick
>> any language).
>
> This goes for e-mail as well. I regularly write e-mail in three
> different languages (Swedish, English and Norwegian), and would
> appreciate being able to spell check all languages.

That shouldn't be a problem, but you'll have to change the language yourself for now. Maybe it makes sense to remember the preferred language for separate accounts, but I think that wouldn't help in your case either.

Rijk van Geijtenbeek

unread,
Apr 2, 2009, 10:34:38 AM4/2/09
to
On Thu, 02 Apr 2009 14:29:20 +0200, Boris Schaeling <bo...@highscore.de> wrote:

> On Thu, 02 Apr 2009 12:07:49 +0200, Rijk van Geijtenbeek
> <ri...@opera.removethiz.com> wrote:
>
>> [...]Automatic switching would indeed be an interesting feature, but
>> might not so easy to get right. We'd have to find out if the lang
>> attribute actually gets used correctly for this to be useful, I
>> wouldn't be amazed if lots of international sites reuse templates that
>> simple set lang=en (or xml:lang="en") on the HTML element.
>
> There are always web authors who don't write HTML code according to the
> standard. But then it's them who deserve to be punished and not all the
> other web authors who set lang correctly.

I was more thinking about not punishing our users. If (note that I haven't actually studied this!) for example all web forums in France use some template that says <html xml:lang="en">, having to manually switch to French all the time even though they already have set 'French' as their default spelling check language, wouldn't be nice for our users.

For example, take a look at the forums at http://my.opera.com. The lang attribute on HTML properly reflects the attribute of the chosen site language, but is not further specified for the various languages the various forums cater for. If I choose to see the site in Danish, should all text fields default to Danish spell checking? That would be inappropriate for the forums.
The designers of the website should set an appropriate lang attribute on the input fields, but my point is that they haven't yet done so, so an auto-switch dictionary feature would get in the way until they do.

> If browsers start to question
> the reliability of attribute values then everything is open to
> interpretation.

But such issues can come up with some attributes that don't have a direct rendering effect. Given the copy and paste culture of web development etc.

>> But even then, for multi-lingual web users this will always be a hassle.
>
> Fortunately the lang attribute can be set within any HTML tag.
>
>> On twitter.com, I sometimes write in English and sometimes in Dutch.
>> Only automatic content analyzing for language detection would help
>> here, not sure if that would be worth the trouble before the 140
>> character are filled there :)
>
> I agree. This is a good example where it should be possible to switch
> off the spell checker if it's not clear what language a visitor will
> use. The lang attribute won't help here.

Note that twitter.com also sets 'lang=en' on its HTML element... I'd think that for many users, they'll interact with a given website always in the same language, so maybe it should be something to remember in Site Preferences? Maybe we should only take the lang attribute into account when it is set on some lower level?

> But adding a spell checker just
> because everyone thinks spell checkers are the next big thing in
> browsers doesn't make any sense if it's not implemented in a way which
> helps users. And the minimum requirement in my opinion for a spell
> checker to be useful is to pick the right language (and if it's unknown
> not to pick any language).

I dare guess that most people will limit their online writing to a single language. That will not be true at all for the kind of people coming to these newsgroups of course (unless they come from the US or UK), but that doesn't mean it is a bad idea to default to the 'last used' language whenever you enter an editable field.

Jernej Simončič

unread,
Apr 2, 2009, 11:38:33 AM4/2/09
to
on Thu, 02 Apr 2009 16:36:46 +0200, Rijk van Geijtenbeek wrote:

> That shouldn't be a problem, but you'll have to change the language yourself for now. Maybe it makes sense to remember the preferred language for separate accounts, but I think that wouldn't help in your case either.

My mailer has a nice solution for this: spellcheck with multiple selected
languages at once. Works great for me.

--
begin .sig
< Jernej Simončič ><>◊<>< jernej simoncic at isg si >
end

Naruki Bigglesworth

unread,
Apr 2, 2009, 9:55:42 PM4/2/09
to

I am reminded of Opera's style sheet function where you can choose Author
or User style sheets. Author is default, but User can be toggled at will or
set as default.

Same thing here, if not better. How about let me set one (or more)
dictionaries, with an optional "Author" flag as well. And if nothing is set
or the page/element doesn't match those dictionaries, no spell check.

Most web forums target a single language, so they should set the default
for that page.

Some have special forums for other languages, and they could set defaults
to match.

Multilingual forums, where many languages are expected in a single thread,
are necessarily rare, and they could choose to set no default at all.

Unlike style sheets, spell checking is expected to be the user's preference
first, author's a distant second. But I don't see why a logical approach
like this would be difficult to implement or intrusive to the user. Seems
like a win win situation.

Boris Schaeling

unread,
Apr 3, 2009, 5:03:53 PM4/3/09
to
On Thu, 02 Apr 2009 16:34:38 +0200, Rijk van Geijtenbeek
<ri...@opera.removethiz.com> wrote:

> [...]I was more thinking about not punishing our users. If (note that I

> haven't actually studied this!) for example all web forums in France use
> some template that says <html xml:lang="en">, having to manually switch
> to French all the time even though they already have set 'French' as
> their default spelling check language, wouldn't be nice for our users.

This sounds like as if Opera's spell checker will support more languages
than English? I ask as the alpha version of Opera 10 only supports
English. In fact I haven't found any options in other browsers like
Firefox to change the language of the spell checker.

> [...]


>> I agree. This is a good example where it should be possible to switch
>> off the spell checker if it's not clear what language a visitor will
>> use. The lang attribute won't help here.
>
> Note that twitter.com also sets 'lang=en' on its HTML element... I'd
> think that for many users, they'll interact with a given website always
> in the same language, so maybe it should be something to remember in
> Site Preferences? Maybe we should only take the lang attribute into
> account when it is set on some lower level?

The problem I had with the spell checker is that my webpages contain
already a lot of text which can be edited by a user. With empty form
fields it might be indeed more difficult to find out what language a user
will type in. With hundreds of pages in German becoming editable I can
expect though that users type in German. That said it would help already
if the spell checker looks at the lang attribute if elements are editable
(with contentEditable="true") or if they are editable and contain text
nodes. Then it can be expected that the lang attribute has been set for
existing content in a webpage and thus should be used by the spell checker?

> [...]I dare guess that most people will limit their online writing to a

> single language. That will not be true at all for the kind of people
> coming to these newsgroups of course (unless they come from the US or
> UK), but that doesn't mean it is a bad idea to default to the 'last
> used' language whenever you enter an editable field.

I agree. Looking at the other browsers my expectations was though that
Opera 10 will be another browser with a spell checker only supporting
English.

Boris

Naruki Bigglesworth

unread,
Apr 5, 2009, 9:45:58 PM4/5/09
to
On Fri, 03 Apr 2009 23:03:53 +0200, Boris Schaeling wrote:
> This sounds like as if Opera's spell checker will support more languages
> than English? I ask as the alpha version of Opera 10 only supports
> English. In fact I haven't found any options in other browsers like
> Firefox to change the language of the spell checker.

Actually, it's there in Firefox already. When you have a textarea on a
form, right click on some text. The context menu has an option for "Check
Spelling" followed immediately by the option "Languages". You will probably
have to download dictionaries for more languages.

In Opera... Well, I'm not sure. They seem to have the same options, but I
don't see where you can install more dictionaries.

This UserJS may be your best bet for now, though:
http://digg.com/d16Xhn

I haven't tried it, so beware.

Rijk van Geijtenbeek

unread,
Apr 7, 2009, 6:14:59 PM4/7/09
to
Op Mon, 06 Apr 2009 03:45:58 +0200 schreef Naruki Bigglesworth
<Nar...@nothankyou.com>:

> On Fri, 03 Apr 2009 23:03:53 +0200, Boris Schaeling wrote:
>> This sounds like as if Opera's spell checker will support more languages
>> than English?

Well, of course! It will support all languages for which dictionaries are
available for the open source Hunspell project, which Opera 10 is now
using internally. Opera 10 will come with a method for easily installing
multiple dictionairies right from the edit field context menu.

>> I ask as the alpha version of Opera 10 only supports
>> English. In fact I haven't found any options in other browsers like
>> Firefox to change the language of the spell checker.

It is already possible to have more languages, but for now it involved
putting the necessary .dic and .aff files manually into the \dictionaries\
profile folder.

> Actually, it's there in Firefox already. When you have a textarea on a
> form, right click on some text. The context menu has an option for "Check
> Spelling" followed immediately by the option "Languages". You will
> probably have to download dictionaries for more languages.
>
> In Opera... Well, I'm not sure. They seem to have the same options, but I
> don't see where you can install more dictionaries.
>
> This UserJS may be your best bet for now, though:
> http://digg.com/d16Xhn
>
> I haven't tried it, so beware.

--

0 new messages