[Kbabel] some progress with the spell checker

Stanislav Visnovsky visnovsky at kde.org
Tue Jul 5 10:15:15 CEST 2005


Hi Heiko!

Don't give up. The branch suggestion is the best, put you could also post here 
the patch you've created so far.

Dňa Ne 3. Júl 2005 23:22 Heiko Evermann napísal:
> Hi Nicolas,
>
> after spending several evenings on kbabel I do not really know how to go
> on. The code of KBabel is very complex and in many parts uncommented. So it
> took me quite a lot of time to go forward.
>
> My status is almost the same as last week:
> * KSpell2 for the highlighter, for a fixed language though (nds)

It depends on the place where you create the spellchecker object. The KSpell 
was created in KBabelView, and there you can find out the langauge
by calling _project->settings ()-> language (). This is the language set by 
the user for KBabel, not the one set by the file(which is rather a big flaw 
of KBabel right now).

> * KSpell2 for the spell checker dialog. (This is a progress). But I do not
> know how to feed the results into the edit fields.

I would need to see the patch to help with this.

>
> My problems:
> * ampersand handling in the spell dialog

KSpell2 has a feature to use a "filter". Maybe that could be used to do that?

> * feeding the results back into the edit field. I can get a complete string
> without ampersand handling, but I do not have a clue how to put together
> the neccessary edit command objects

This is tricky handling of undo/redo. I can help you here. I would need to see 
the current code though.

> * I do not know how to use the different form variants that can be used.
> From what I understand, It is possible to have several plural form entries
> for one msgstr. But KDE does not seem to use that, so I do not have an
> example to check on.

Try some GNU files, like gettext.po itself. The GNU plural forms are available 
as KBabel::Catalog::msgstr(), which returns a QStringList. For KDE, we use 
only the first entry (index 0). For GNU, others might be available. (I'm 
looking forward to drop KDE plural forms in KDE4 ;-)).

>
> One interesting feature:
> The checker from KSpell2 that is used for the spell dialog can be extended
> by a regexp handler. That means the whole string can be given over to the
> spell dialog. At the moment with KSpell(1) the part of the po-file that is
> to be spell checked is broken into words and then these words are fed into
> the spell check dialog. This means that you always get the dialog without
> any context. I find this highly annoying, because you alway have to double
> check with the msgstr edit field about the context. This would not be
> neccessary with KSpell2. I think that the whole spell checking subsystem
> would become a lot easier. For example: KSpell2 is synchrounous. That means
> that the highlighting can be done directly.
>
> In summary: I think I have some good ideas, but I cannot do that alone.
> And now I do not know how to go on from here. Is there anyone willing to
> help on this? Or is it better to wait until KDE4 comes closer? Probably svn
> support is more of a problem at the moment?
>
> Any suggestions?
>
> Kind regards,
>
> Heiko Evermann

Thanks for your hard work

Stano



More information about the kbabel mailing list