[PATCH] KSpell2 improvement

Thiago Macieira thiago at kde.org
Mon Mar 13 09:06:12 GMT 2006


Mashrab Kuvatov wrote:
>Hi all,
>
>at the moment in kspell2 dialog (kword, kpresenter, ...) in a language
> combo there are cryptic dictionary names such as en_CA-wo_accents,
> en_GB-ise, en_GB-ise-w_accents, fr_FR-80 etc. I think you agree it is
> not very user friendly.
>
>Attached is a patch for kspell2 in kdelibs to show fully localized
> language and country names in a combo above. I tested it with 126
> Aspell dictionaries, worked pretty well.

Thank you for that. Sounds like a very good idea.

> Exceptions are no, srd, tet 
> and tl languages - KGlobal::locale()->twoAlphaToLanguageName does not
> know them.

"no" is supposed to be Norwegian. The two alternatives are "nb" for 
Norwegian Bokmål and "nn" for Norwegian Nynorsk.

ISO 639-1 accepts all 3 forms. It looks like we missed something.

"tl" is Tagalog and is not the same as "tlh" (which is Klingon... man, 
they have it encoded in ISO 639-1...)

"srd" is the same as "sc" for Sardinian. Sounds like Aspell needs to 
update their sources to "sc".

Finally, "tet" is Tetum. But I'm not sure we have the 3-alpha translations 
mapped.

>One todo is left. One has to translate dictionary cryptic extension
> names into English and i18n'ify it. I have no idea how to do it.

I'd recommend we use the form "Language (Region) Variant" for English and 
construct it as 
	i18n("%1 (%2) %3").arg(i18n(language), i18n(region), i18n(variant)) 
so that translators get the chance to translate everything tokens.

Do not construct the strings like you did:
+              localizedDictionary += " (" + cISOName + ")";

That means: extract all the extensions known to aspell into a file, map 
them to an English name and mark them for translation.

>Would be nice to get it into stable (as it is there are no new
> messages). KWord and KPresenter users would appreciate it. By the way,
> one can do the same for dictionary selection combo in KWord's
> preferences for example.

We're in feature-freeze. This is KDE 4 code...

>The patch is against stable. One can try it with test_dialog in
> kspell2/test directory.

One other thing: you construct this map every time, including when the 
language is changed. Please cache it somewhere in a variable to avoid 
doing the expensive work whenever the user clicks the drop-down list.

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

3. Ac seo woruld wearð geborod, swá se Scieppend cwæð "Gewurde Unix" and 
wundor fremede and him "Unix" genemned, þæt is se rihtendgesamnung.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20060313/2ee2c339/attachment.sig>


More information about the kde-core-devel mailing list