language settings vs. spell checker

2000-10-28 Thread R. Lahaye


Hi,

I ran into trouble when having several documents
loaded each in a different language (which is set
per document in Layout->Document->Language).

The spellingchecker will use that language setting
to find the correct database. However, names
are not the same. For example with dutch:

 In LyX this is "dutch"
 In ispell this is "nederlands" ("dutch" in dutch).

I can manually enter "nederlands" in the language
settings in Preferences, but then my other english
document is wrongly spellchecked :).

I have several remarks & questions to this problem:

1) Assuming that each document is entirely in one
   single language, but simultaneously loaded documents
   can each be in a different language: it then would
   not be convenient to set the ispell language in
   the general Preferences dialog.
   An additional ispell-language setting should be
   added to the Layout->Document->Language dialog.
   Does that make sense?

2) Another solution for 1) could be changing the
   language file, that comes with LyX. The first
   and second column in this file are ALWAYS the
   same. Why is that? We could use the second column
   for an equivalent language name, for example:

  dutch  nederlands
  french francais
  spanishespanol
  german deutsch
  swedishsvenska

   If ispell reports to LyX that it can't find the "dutch"
   database, then LyX should tell ispell to try again for
   the "nederlands" database.

3) If I remember well, one can change the language
   settings (temporarily) anywhere inside a LaTeX
   document. You can mix lanaguages and tell LaTeX
   to do the appropriate hyphenation correctly per
   language-section.
   If that could be done in LyX too, LyX could use
   that information with the ispell call (change the
   ispell-database when a language change appears). 
   Would that be suitable for a future extension?


Just some thoughts.

Regards,
Rob.



Re: language settings vs. spell checker

2000-10-29 Thread Lars Gullik Bjønnes

"R. Lahaye" <[EMAIL PROTECTED]> writes:

| 1) Assuming that each document is entirely in one
|single language, but simultaneously loaded documents
|can each be in a different language: it then would
|not be convenient to set the ispell language in
|the general Preferences dialog.
|An additional ispell-language setting should be
|added to the Layout->Document->Language dialog.
|Does that make sense?

No... we don't want to add a item for all the differenct spell
checkers, the documents language should be translatet to the
spellcheckers notion of the language in the spellchecker module.


| 2) Another solution for 1) could be changing the
|language file, that comes with LyX. The first
|and second column in this file are ALWAYS the
|same. Why is that? We could use the second column
|for an equivalent language name, for example:

Did you check the meanings of the fields?

I'd rather remove one of the fields instead of adding more.
(but then we would need a "babel" module.

| 3) If I remember well, one can change the language
|settings (temporarily) anywhere inside a LaTeX
|document. You can mix lanaguages and tell LaTeX
|to do the appropriate hyphenation correctly per
|language-section.
|If that could be done in LyX too, LyX could use
|that information with the ispell call (change the
|ispell-database when a language change appears). 
|Would that be suitable for a future extension?

Sure... we would probably like to have several ispells running at the
same time. Some rewrite is needed to accomplish that.

Lgb



Re: language settings vs. spell checker

2000-10-29 Thread R. Lahaye

"Lars Gullik Bjřnnes" wrote:
> 
> "R. Lahaye" <[EMAIL PROTECTED]> writes:
> 
> | 1) Assuming that each document is entirely in one
> |single language, but simultaneously loaded documents
> |can each be in a different language: it then would
> |not be convenient to set the ispell language in
> |the general Preferences dialog.
> |An additional ispell-language setting should be
> |added to the Layout->Document->Language dialog.
> |Does that make sense?
> 
> No... we don't want to add a item for all the differenct spell
> checkers, the documents language should be translatet to the
> spellcheckers notion of the language in the spellchecker module.

Well, I see the "Use alternative language" field in Preferences->Languages
as a help-item to any spell checker, when the default language names
don't work.

I suggested to move that field into the Document Layout->Languages,
so one can adjust this per document. Of course, no need to set this
for an english document, because the spell checker knows "english",
but I'll have to set it to "nederlands" (or what ever) for my dutch
documents.

This would solve the problem of continuously having to change
the preferences ispell language setting when using several
documents in different languages.
Once stored in the Document Layout, I don't need to worry about
the language settings for the spelling checker.
This has certainly advantages!

If this "Use alternative language" is moved into the Document Layout,
it also needs to be saved in the document, not in the lyxrc file.

Rob.



Re: language settings vs. spell checker

2000-10-29 Thread Dekel Tsur

On Sun, Oct 29, 2000 at 08:28:22AM +0100, Lars Gullik Bj&resh;nnes wrote:
> 
> | 2) Another solution for 1) could be changing the
> |language file, that comes with LyX. The first
> |and second column in this file are ALWAYS the
> |same. Why is that? We could use the second column
> |for an equivalent language name, for example:
> 
> Did you check the meanings of the fields?

The second field is the babel name of the language, and it is not always
equal to the first field (the LyX name).

> I'd rather remove one of the fields instead of adding more.
> (but then we would need a "babel" module.

Why not add new fields to the languages file (ispell name, keymap name) ?
The only drawback is decreasing the readability of this file.
A solution for that is to use the following idea: for most languages (e.g.
english) the babel/ispell name is equal to the LyX name, so in this case, we
do not need to repeat it:

#LyX name  Screen nameRTL   encoding   code  babelispell
canadien   "French Canadian" false  iso8859-1  fr_CA frenchb  french
english"English" false  iso8859-1  en *

(the * marks the end of the enlish fields).



Re: language settings vs. spell checker

2000-10-30 Thread Juergen Vigna


On 29-Oct-2000 Dekel Tsur wrote:
> 
> Why not add new fields to the languages file (ispell name, keymap name) ?
> The only drawback is decreasing the readability of this file.

No we don't want this! It is much easier to just do a symlink from your
dictionary in "native language" to the one in english (and we don't know
how someone calls the dictionary on his filesystem!).

ln -s deutsch german
ln -s italiano italian
ln -s nederland dutch

...

And you'll see you'll find all you want!

 Jürgen

--
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._

Dr. Jürgen VignaE-Mail:  [EMAIL PROTECTED]
Italienallee 13/N   Tel/Fax: +39-0471-450260 / +39-0471-450253
I-39100 Bozen   Web: http://www.sad.it/~jug

-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._

Where am I?  Who am I?  Am I?  I




Re: language settings vs. spell checker

2000-10-30 Thread Jean-Marc Lasgouttes

> "Dekel" == Dekel Tsur <[EMAIL PROTECTED]> writes:

Dekel> Why not add new fields to the languages file (ispell name,
Dekel> keymap name) ? The only drawback is decreasing the readability
Dekel> of this file. 

If readability is a problem, it should be turned into

Language "canadien"
  Description "French Canadian"
  RTL false
  Encoding iso8859-1
  Code fr_CA
  BabelName frenchb
  IspellDict french
End

Much more readable, IMO.

JMarc



Re: language settings vs. spell checker

2000-10-30 Thread Jean-Marc Lasgouttes

> "Juergen" == Juergen Vigna <[EMAIL PROTECTED]> writes:

Juergen> No we don't want this! It is much easier to just do a symlink
Juergen> from your dictionary in "native language" to the one in
Juergen> english (and we don't know how someone calls the dictionary
Juergen> on his filesystem!).

We certainly do not want to force users to do symlinks just for LyX...
We can at least have defaults which are the names of the distributed
ispell dictionaries.

JMarc



Re: language settings vs. spell checker

2000-10-30 Thread Lars Gullik Bjønnes

Dekel Tsur <[EMAIL PROTECTED]> writes:

| On Sun, Oct 29, 2000 at 08:28:22AM +0100, Lars Gullik Bjønnes wrote:
| > 
| > | 2) Another solution for 1) could be changing the
| > |language file, that comes with LyX. The first
| > |and second column in this file are ALWAYS the
| > |same. Why is that? We could use the second column
| > |for an equivalent language name, for example:
| > 
| > Did you check the meanings of the fields?
| 
| The second field is the babel name of the language, and it is not always
| equal to the first field (the LyX name).
| 
| > I'd rather remove one of the fields instead of adding more.
| > (but then we would need a "babel" module.
| 
| Why not add new fields to the languages file (ispell name, keymap name) ?
| The only drawback is decreasing the readability of this file.

And imposing addtional dependencies... it is ok for the ispell/babel
modules to depend on the language struct in LyX, but not ok for the
language struct to depend upon the ispell/babel module.

Lgb




Re: language settings vs. spell checker

2000-10-31 Thread Jean-Marc Lasgouttes

> "Lars" == Lars Gullik Bjønnes <[EMAIL PROTECTED]> writes:

Lars> And imposing addtional dependencies... it is ok for the
Lars> ispell/babel modules to depend on the language struct in LyX,
Lars> but not ok for the language struct to depend upon the
Lars> ispell/babel module.

What do you mean? That ispell module should have a list of
dictionaries according to the language? It is simpler to keep all data
in one place IMO. Anyway the language struct is nothing more than a
placeholder for all information concerning a language.

JMarc



Re: language settings vs. spell checker

2000-10-31 Thread Lars Gullik Bjønnes

Jean-Marc Lasgouttes <[EMAIL PROTECTED]> writes:

| > "Lars" == Lars Gullik Bjønnes <[EMAIL PROTECTED]> writes:
| 
| Lars> And imposing addtional dependencies... it is ok for the
| Lars> ispell/babel modules to depend on the language struct in LyX,
| Lars> but not ok for the language struct to depend upon the
| Lars> ispell/babel module.
| 
| What do you mean? That ispell module should have a list of
| dictionaries according to the language? It is simpler to keep all data
| in one place IMO. Anyway the language struct is nothing more than a
| placeholder for all information concerning a language.

I don't agree. Imagine we support dozens of differenct spellcheckers
corba/web webster/ispell/aspell/xspell whatever... and all om the uses
different names for the same language It is then a lot better to
just have the language code in the language struct and let the spell
mode in question translate this into the correct naming for the
language.

This also reduces dependencies in the LyX code.

Lgb







Re: language settings vs. spell checker

2000-10-31 Thread R. Lahaye

"Lars Gullik Bjřnnes" wrote:
> I don't agree. Imagine we support dozens of differenct spellcheckers
> corba/web webster/ispell/aspell/xspell whatever... and all om the uses

IF
LyX lets you choose from a *fixed* list of Document languages:
   Document Layout->Language->Language

AND
LyX also decides to let you choose from a *fixed* list of spell checkers:
   Preferences->Spell checker->Spell command

THEN
 this should match, flawlessly!


Your point (we cannot support all spell checkers in the world) holds if
one could enter in Preferences any spell checker command in Preferences
manually. Then LyX can't know what spell checker may be used. But that's
not the case, the spell checker list is a *predefined* list (ispell, aspell);
by doing so, LyX should then also make these spell checkers work, for all
the languages that are in the language list.

As soon as you add "xspell" to the spell checker list, you should somewhere
in a LyX system-file match the language-names for xspell.
If every spell checker in the list has its own language-name-rules, its just 
a little effort for LyX to know about that, isn't it?

Regards,
Rob.

PS: keep in mind that a regular user is not a system administrator or
package manager. A regular users may simply give up, if something's
not working. Don't ask him/her to make symlinks or something like that!



Re: language settings vs. spell checker

2000-10-31 Thread Lars Gullik Bjønnes

"R. Lahaye" <[EMAIL PROTECTED]> writes:

| As soon as you add "xspell" to the spell checker list, you should
|  somewhere

This list does not need to be "fixed", it can be expanded dynamically
as new spellchecker modules are inserted.

| in a LyX system-file match the language-names for xspell.
| If every spell checker in the list has its own language-name-rules, its just 
| a little effort for LyX to know about that, isn't it?

You just don't seem to get it. Why should the Language module in LyX
know about the language-strings the spellcheckers use?

>From a dependency viewpoint it is a lot better if the _spellchecker_
knows how to handle the different languages the LyX support.

By doing this we can even provide dynamic loadable spellecker modules
(corba or whatever), this is not possible it done the other way.

Lgb