Bug 5749

Summary: hunspell doesn't have locale fallback mechanism to find dictionnaries
Product: Mageia Reporter: Chris Denice <eatdirt>
Component: RPM PackagesAssignee: Kamil Rytarowski <n54>
Status: RESOLVED OLD QA Contact:
Severity: minor    
Priority: Normal CC: mageia, marja11, pablo
Version: CauldronKeywords: PATCH
Target Milestone: ---   
Hardware: All   
OS: Linux   
Whiteboard: MGA2TOO, MGA3TOO
Source RPM: hunspell-1.3.2-8.mga4.src.rpm CVE:
Status comment:
Attachments: adds fallback mechanisms to find default dictionnary

Description Chris Denice 2012-05-04 14:05:01 CEST
Description of problem:

Just installed hunspell and try to spell check any text file:

hunspell myfile.txt
Can't open affix or dictionary files for dictionary named "en_BE"

Looks like Belgium + english keyboard does not exist ;)

Would be nice to have a default dictionary here too !

Cheers,
Chris.
Manuel Hiebel 2012-05-04 17:23:10 CEST

Assignee: bugsquad => n54

Comment 1 Kamil Rytarowski 2012-05-05 09:13:36 CEST
I have added a suggestion hunspell-dictionary.
Comment 2 Chris Denice 2012-05-05 11:41:35 CEST
Hi Kamil,

installing any dictionary does not solve the pb. I think the pb is in "en_BE" that does not match any dictionary. This setting was set up at installation time when you select a QUERTY keyboard + random country.

So a fix maybe to force english dictionary in that situation ?


Cheers,
Chris.
Comment 3 Marja Van Waes 2012-05-26 13:09:38 CEST
Hi,

This bug was filed against cauldron, but we do not have cauldron at the moment.

Please report whether this bug is still valid for Mageia 2.

Thanks :)

Cheers,
marja

Keywords: (none) => NEEDINFO

Comment 4 Chris Denice 2012-05-26 15:22:32 CEST
Yes it is !

chris.
Sander Lepik 2012-05-26 16:25:30 CEST

Keywords: NEEDINFO => (none)
CC: (none) => sander.lepik

Comment 5 Marja Van Waes 2012-07-06 15:05:51 CEST
Please look at the bottom of this mail to see whether you're the assignee of this  bug, if you don't already know whether you are.


If you're the assignee:

We'd like to know for sure whether this bug was assigned correctly. Please change status to ASSIGNED if it is, or put OK on the whiteboard instead.

If you don't have a clue and don't see a way to find out, then please put NEEDHELP on the whiteboard.

Please assign back to Bug Squad or to the correct person to solve this bug if we were wrong to assign it to you, and explain why.

Thanks :)

**************************** 

@ the reporter and persons in the cc of this bug:

If you have any new information that wasn't given before (like this bug being valid for another version of Mageia, too, or it being solved) please tell us.

@ the reporter of this bug

If you didn't reply yet to a request for more information, please do so within two weeks from now.

Thanks all :-D
Marja Van Waes 2012-08-19 16:37:53 CEST

CC: (none) => marja11
Whiteboard: (none) => MGA2TOO

Comment 6 Pablo Saratxaga 2013-06-29 10:03:02 CEST
actuallu locale "en_BE" does exist.

the script calling hunspell should change that to "en" or something if the specific dictionnary isn't there.
I'll look at the code

CC: (none) => pablo

Comment 7 Pablo Saratxaga 2013-06-30 00:40:12 CEST
Created attachment 4176 [details]
adds fallback mechanisms to find default dictionnary

This patch improves default dictionnary detection.

It implements a behaviour that follows gettext one; that is:

1. find, in that order, one defined variable among LANGUAGE, LC_ALL, LC_MESSAGES, LANG
2. once found, if a colon (:) is present, treat it as a list of colon separated locales; the following steps are repeated for each member of the list, until a dictionnary is found
3. for each locale, try the full lang+country (xx_YY) form
4. if not found, fallback to language only (xx)

what I added is reading of LANGUAGE, the loop in a list of locales, and the fallback xx_YY -> xx

For it to work, all hunspell-* packages have to be rebuilt to offer a symlink to language (eg fr.{aff,dic} -> fr_FR.{aff,dic})

This patch will then select the best available dictionnary matching user locale preferences, in a way consistent on how interface translations are selected.

Of course, selection of a specific dictionnary is still possible by telling it as a parameter.
Pablo Saratxaga 2013-06-30 00:42:36 CEST

Keywords: (none) => PATCH
Hardware: x86_64 => All
Source RPM: hunspell-1.3.2-2.mga2.src.rpm => hunspell-1.3.2-8.mga4.src.rpm
Whiteboard: MGA2TOO => MGA2TOO, MGA3TOO
Severity: normal => minor

Pablo Saratxaga 2013-06-30 00:52:56 CEST

Summary: hunspell does not start due to missing default dictionaries => hunspell doesn't have locale fallback mechanism to find dictionnaries

Comment 8 Marja Van Waes 2015-04-08 18:20:49 CEST
Maintainer is absent for a long time, and it is not sure when he'll return.

However, this bug is from far before Mageia 4 release, so choosing to close it as OLD

Please do reopen if it is still valid in fully updated Mageia 4 or 5 beta 3 or later

Status: NEW => RESOLVED
Resolution: (none) => OLD