Bug 500559

Summary: [Indic] Indic hunspell dictionary not default for Indic locale with kwrite, kate
Product: [Fedora] Fedora Reporter: Parag Nemade <pnemade>
Component: kdelibsAssignee: Than Ngo <than>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: aalam, arbiter, caolanm, i18n-bugs, jreznik, kevin, ltinkl, petersen, rdieter, smparrish, than, uwog
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-05-30 11:33:17 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
suggested patch none

Description Parag Nemade 2009-05-13 09:57:17 UTC
Description of problem:
When tried to use Marathi hunspell in kwrite, default spell checker failed to appear with error like no language dictionaries.

Version-Release number of selected component (if applicable):
kdesdk-4.2.2-2.fc11.x86_64
kdebase-4.2.2-2.fc11.x86_64
enchant-1.4.2-5.fc11.x86_64
hunspell-mr-20060920-2.fc11.noarch
enchant-1.4.2-5.fc11.i586


How reproducible:
always

Steps to Reproduce:
1.Start KDE in Marathi
2.For easy testing copy text from http://mr.wikipedia.org to kwrite
3. Apply spell checker
  
Actual results:
kwrite used English locale hunspell dictionary when asked to spell check for some Indic language and for other Indic languages its dialog window not appeared at all.


Expected results:
Kwrite should use default locale hunspell dictionary when asked to spell check.

Additional info:
So In summary,
Common error I got for all Indic languages is
WARNING **: Error loading plugin: /usr/lib/enchant/libenchant_myspell.so: wrong ELF class: ELFCLASS32

Languages for which spell checker didn't started are
kwrite(5263): No language dictionaries for the language :  "mr" 
kwrite(5300): No language dictionaries for the language :  "gu" 
kwrite(5429): No language dictionaries for the language :  "ml" 
kwrite(5441): No language dictionaries for the language :  "hi" 
kwrite(5457): No language dictionaries for the language :  "pa" 

Languages for which spell checker started but in English dictionary are
te_IN, ta_IN, bn_IN, as_IN, or_IN

Comment 1 Kevin Kofler 2009-05-13 14:37:52 UTC
> WARNING **: Error loading plugin: /usr/lib/enchant/libenchant_myspell.so: wrong
> ELF class: ELFCLASS32

This looks like Enchant is trying to use the 32-bit multilib instead of the 64-bit one. Can you please try to "yum remove enchant.i586" and see if this helps any? (It's not a real fix, just a workaround.)

Comment 2 Kevin Kofler 2009-05-13 14:41:39 UTC
*** Bug 500553 has been marked as a duplicate of this bug. ***

Comment 3 Caolan McNamara 2009-05-13 15:01:34 UTC
Created attachment 343781 [details]
suggested patch

The code has a g_build_filename(prefix,"lib","enchant",NULL); in it and always adds /usr/lib/enchant/modules" to the search path. A quick look suggests that ENCHANT_GLOBAL_MODULE_DIR is always defined and pointing to the right place, so the above should make it do the right thing (probabl)

Comment 4 Parag Nemade 2009-05-14 03:48:45 UTC
(In reply to comment #1)
> > WARNING **: Error loading plugin: /usr/lib/enchant/libenchant_myspell.so: wrong
> > ELF class: ELFCLASS32
> 
> This looks like Enchant is trying to use the 32-bit multilib instead of the
> 64-bit one. Can you please try to "yum remove enchant.i586" and see if this
> helps any? (It's not a real fix, just a workaround.)  

Thanks this worked and now no Warning. I am not sure how it gets installed.

Comment 5 Parag Nemade 2009-05-14 04:17:21 UTC
(In reply to comment #3)
> Created an attachment (id=343781) [details]
> suggested patch
> 
> The code has a g_build_filename(prefix,"lib","enchant",NULL); in it and always
> adds /usr/lib/enchant/modules" to the search path. A quick look suggests that
> ENCHANT_GLOBAL_MODULE_DIR is always defined and pointing to the right place, so
> the above should make it do the right thing (probabl)  

I did scratch build http://koji.fedoraproject.org/koji/taskinfo?taskID=1354061
updated enchant and reboot machine.
But, Still for Marathi locale(mr_IN),
with kwrite,
kwrite(4066): No language dictionaries for the language :  "mr" 
and spell checker did not even started.
with kate,
spellchecker started in English locale.

I am using Marathi KDE Desktop for above testing.

Comment 6 Kevin Kofler 2009-05-14 04:19:20 UTC
So the warning went away, but it's still not working?

Comment 7 Parag Nemade 2009-05-14 04:21:04 UTC
(In reply to comment #6)
> So the warning went away, but it's still not working?  

yes not working.

Comment 8 Caolan McNamara 2009-05-14 09:16:00 UTC
a) the warning about ELFCLASS is from enchant, i.e. #3
b) hunspell-mr has a bad non-utf8 line in it, so lets exclude that language from discussion for the moment, as that specific dictionary is a little broken

c) I don't use KDE much, but I logged in as Oriya and I see that the English spellchecker is the default, looking at the kde system settings->regional and language I see a spell checker option, where the default language was set as English, if I change that to a different language e.g. Oriya then the spell checking dialogs in kwrite and kate start with that language instead of english. 

It looks to me that in KDE changing the language you login with has no effect on the language used for spell-checking. e.g. If I log in as German, I also get English as the default spell checking language in KDE unless I manually toggle that spell-checking language option.

d) I also think enchant is working fine except for the small issue of #3
e.g. if we have a locale of or_IN, and we test the simple command line tool, then

strace enchant -a 2>&1 < /dev/null | grep myspell | grep dic

should say...
open("/usr/share/myspell/or_IN.dic", O_RDONLY) = 3
and so on for the other languages, i.e. find the hunspell ones correctly

e) but FWIW I don't get any errors like 
kwrite(4066): No language dictionaries for the language :  "mr" 
for me kate and kwrite act exactly the same

So...
if you select the Indic languages manually from settings->regional and language in KDE (and either skip testing Marathi or use the fixed dictionary) do those Indic dictionaries work in kate and kwrite ?, i.e. to test if dictionaries + enchant + sonnet are working correctly and ignoring the "want spellchecking to automatically use locale" wishlist item.

Comment 9 Parag Nemade 2009-05-15 07:54:37 UTC
(In reply to comment #8)
> a) the warning about ELFCLASS is from enchant, i.e. #3
> b) hunspell-mr has a bad non-utf8 line in it, so lets exclude that language
> from discussion for the moment, as that specific dictionary is a little broken
> 

Thanks built new hunspell-mr.

> c) I don't use KDE much, but I logged in as Oriya and I see that the English
> spellchecker is the default, looking at the kde system settings->regional and
> language I see a spell checker option, where the default language was set as
> English, if I change that to a different language e.g. Oriya then the spell
> checking dialogs in kwrite and kate start with that language instead of
> english. 
> 
> It looks to me that in KDE changing the language you login with has no effect
> on the language used for spell-checking. e.g. If I log in as German, I also get
> English as the default spell checking language in KDE unless I manually toggle
> that spell-checking language option.

 But does that mean setting default spell checker for current locale is manual step?

> 
> d) I also think enchant is working fine except for the small issue of #3
> e.g. if we have a locale of or_IN, and we test the simple command line tool,
> then
> 
> strace enchant -a 2>&1 < /dev/null | grep myspell | grep dic
> 
> should say...
> open("/usr/share/myspell/or_IN.dic", O_RDONLY) = 3
> and so on for the other languages, i.e. find the hunspell ones correctly

Yes that works fine with mr_IN also now
[parag@rawhideTM /]$ LANG=mr_IN.UTF-8
[parag@rawhideTM /]$ strace enchant -a 2>&1 < /dev/null | grep myspell | grep dic
access("/home/parag/.config/enchant/myspell/mr_IN.dic", F_OK) = -1 ENOENT (No such file or directory)
access("/home/parag/.enchant/myspell/mr_IN.dic", F_OK) = -1 ENOENT (No such file or directory)
access("/usr/share/enchant/myspell/mr_IN.dic", F_OK) = -1 ENOENT (No such file or directory)
access("/usr/share/myspell/mr_IN.dic", F_OK) = 0
open("/usr/share/myspell/mr_IN.dic", O_RDONLY) = 3

> 
> e) but FWIW I don't get any errors like 
> kwrite(4066): No language dictionaries for the language :  "mr" 
> for me kate and kwrite act exactly the same
> 
> So...
> if you select the Indic languages manually from settings->regional and language
> in KDE (and either skip testing Marathi or use the fixed dictionary) do those
> Indic dictionaries work in kate and kwrite ?, i.e. to test if dictionaries +
> enchant + sonnet are working correctly and ignoring the "want spellchecking to
> automatically use locale" wishlist item.  

Yes successfully tested Marathi as well as Oriya and Punjabi dictionary with above steps and now no warnings/errors on konsole.

So is there any way to auto set dictionary to locale in which desktop started?

Comment 10 Caolan McNamara 2009-05-15 08:18:42 UTC
Nifty, so I think then that everything on the hunspell and enchant side is working fine now. So this bug can stay here to fix #3.

"But does that mean setting default spell checker for current locale is manual
step?"

In KDE it seems that way, but I'm not much of a KDE user to know if that's *meant* to be the case or not, GNOME apps take it from the locale while KDE ones take it from their "spell-checking language" setting. I'd guess that the nicest thing for KDE would be to have a new extra language option for the spell-checking languages drop-down of "default" which takes the current locale settings to use, i.e. the classic precedence order of "LANGUAGE, LC_ALL, LC_MESSAGES, and LANG", and make it the default option for a new install. Perhaps log a feature request against sonnet (?) for that feature and see if it makes sense in the KDE world.

Comment 11 Kevin Kofler 2009-05-15 09:31:23 UTC
Looks like a bug in Sonnet (which is part of kdelibs).

Comment 12 Steven M. Parrish 2009-05-30 00:45:15 UTC
Please report this issue upstream at http://bugs.kde.org  Once you have reported the issue upstream please add the upstream report info to this report so we can monitor it for a resolution.

Thanks

Comment 13 A S Alam 2009-05-30 02:01:45 UTC
it is upstreamed with bug: https://bugs.kde.org/show_bug.cgi?id=194609

Comment 14 Steven M. Parrish 2009-05-30 11:33:17 UTC
Thanks for reporting this upstream.  We will monitor the upstream report for a resolution.