Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

language spell check #188

Open
jhuss opened this issue Feb 13, 2017 · 50 comments
Open

language spell check #188

jhuss opened this issue Feb 13, 2017 · 50 comments

Comments

@jhuss
Copy link

jhuss commented Feb 13, 2017

I installed ungoogle from pre-built, and enabled spell-check (not the web service option), but it's not working.
this is linked by default to a google service or download? or is there a library dependency that is missing?

@Eloston
Copy link
Member

Eloston commented Feb 14, 2017

Yes, spell checking in Chrome and Chromium uses binaries from Google to work. I don't know if there's a way to get it to work without the binaries, such as by using a system library.

@jhuss
Copy link
Author

jhuss commented Feb 20, 2017

this is old an related to another chromium-based project, but it's about spell checking https://bitbucket.org/chromiumembedded/cef/issues/137

@Eloston
Copy link
Member

Eloston commented Feb 20, 2017

@Eloston
Copy link
Member

Eloston commented Mar 9, 2017

I should note that language spell check may work if one were to download the dictionaries manually and insert them into the profile directory.

@avently
Copy link

avently commented Mar 9, 2017

@Eloston how to do that?

@Eloston
Copy link
Member

Eloston commented Mar 11, 2017

@avently I'm not sure. I haven't dug deep into how it works since I'm using a patch from Inox that disables dictionary fetching from Google.

@Eloston
Copy link
Member

Eloston commented Jun 12, 2017

Some discussion about spell checking over here: gcarq/inox-patchset#83

@Atavic
Copy link

Atavic commented Jun 13, 2017

@Eloston Eloston added this to the 60.x.x.x milestone Aug 17, 2017
@Eloston Eloston removed this from the 60.x.x.x milestone Aug 18, 2017
@Eloston
Copy link
Member

Eloston commented Aug 18, 2017

New status update: gcarq/inox-patchset#83 (comment)

@qvint
Copy link
Contributor

qvint commented Dec 6, 2018

Here is an easy-to-maintain and Google-independent solution:

  1. Patch convert_dict utility so that it can print all possible bdic file names.
  2. Using this utility, make a script that converts all system hunspell dictionaries to ~/.config/chromium/Dictionaries. The script is intended to be run manually by the user.

I have implemented it in qvint/ungoogled-chromium-fedora@a68fdd679566da5134d916776f14e00c8e6a8042.
The only language that convert_dict fails to process is uk_UA 😕

@TCB13
Copy link
Contributor

TCB13 commented Mar 15, 2019

@Eloston how to do that?

+1 here, I would like have a working spell check!

@Innomen
Copy link

Innomen commented Jul 16, 2019

Can someone summerize the current state of things for me? Like, is this something likely to be fixed any time soon? It reads like qvint offers a solution several months ago but, nothing happened?

@jstkdng
Copy link
Member

jstkdng commented Jul 17, 2019

you could change to linux m8 ;) , there are more people there that want to fix stuff than in windows.
And even if eloston added that patch, it would be specific to linux, in this case, fedora.

@PF4Public
Copy link
Contributor

A step by step walkthrough for anyone wanting to do this manually, following @qvint 's idea.

  • First you need to unpack and configure the source.
  • Then you need to patch the source with the patch above.
  • After that you need to build just the convert_dict utility and copy it from out/Release/convert_dict to ./dict-utility.
  • Then download the script and chmod +x it.
  • Last step is to simply run this script without arguments: ./chromium-update-dicts.sh. Don't forget to run it with the user, willing to have dictionaries.
  • Afterlast step: save both files for a future use ;)

Some useful commands for Gentoo-users:

  • Unpack and configure the source: ebuild $(equery w ungoogled-chromium) configure
  • Patch the source: wget -O - https://raw.githubusercontent.com/qvint/ungoogled-chromium-fedora/a68fdd679566da5134d916776f14e00c8e6a8042/ucf-dict-utility.patch | patch -p1 -u
  • Edit the environment file to build only: eninja -C out/Release convert_dict;
  • Compile it: ebuild $(equery w ungoogled-chromium) compile

PS: now that I have compiled it, I have dict-utility: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, and could probably share it with someone brave enough to run executables from unknown sources ;)

@Innomen
Copy link

Innomen commented Jul 25, 2019

I kinda feel like you should fork the whole thing XD

Windows users badly need a fully functional ungoogled chromium, and currently we only lack 3 things to make that happen. Installer, widevine, and spell check. You just brought that number to two :) We appreciate you.

@jstkdng
Copy link
Member

jstkdng commented Jul 25, 2019

still, that fix is exclusive for gentoo (linux), dunno if you could port that to windows.

@TCB13
Copy link
Contributor

TCB13 commented Jul 25, 2019

@Innomen aren’t you forgetting the essential thing? Like a tag that can actually be built? All the patches are broken at this point, installer / spell check isn’t probably relevant when you can’t build anything...

@Innomen
Copy link

Innomen commented Jul 25, 2019

still, that fix is exclusive for gentoo (linux), dunno if you could port that to windows.

Oh I didnt understand what I was reading I guess. Well, wouldn't apply to me immediately anyway, I was mostly just trying to be encouraging /sigh X)

@PF4Public
Copy link
Contributor

@Innomen

I kinda feel like you should fork the whole thing XD
Windows users badly need a fully functional ungoogled chromium

I do share this feeling, as I also have to use Windows every now and then and miss ungoogled-chromium there. I even thought to try and build ungoogled-chromium on Windows someday, but it might take a lot of time, which I currently do not have to spare. Thus I would like to not give any promises ahead of time.

@jstkdng

Why so pessimistic? The tool is so simple, that it could be readily built on Windows. Have you tried? And the script is basically calling this tool with convert option and passing filenames as arguments. One could do this easily without this script on Windows. There's even no need for a shell! Windows' cmd will do.

But I must admit that, like @TCB13 points out, without compilable sources and patches all this has little to no use on Windows.

@Innomen
Copy link

Innomen commented Jul 25, 2019

@PF4Public

Thank you for not being yet another linux dude that basically wants me gassed for having the audacity to use windows. It's refreshing frankly. Though I fear your peers might now burn you at the stake for heresy.

Would it be easier to start from a different place? Like, ungoogling the more popular version of chromium that has an installer? And yeah I 100% get the time constraints, very few of us have anything even approximating real freedom. Just saying there's a niche it appears you could fill.

@TCB13
Copy link
Contributor

TCB13 commented Jul 25, 2019

@Innomen last time I was able to build this under Windows I managed to create and installer using winrar to unpack the files. Also used to add some stuff to the Windows registry. It is a solution, however my current problem is that like @PF4Public I ocasional use Windows but that doesn’t mean I’m able to fix it.

@jstkdng
Copy link
Member

jstkdng commented Jul 26, 2019

Thank you for not being yet another linux dude that basically wants me gassed for having the audacity to use windows.

I use windows too mate. It's just that I feel more comfortable using linux, I feel it is easier than windows and there is a large community of developers that are willing to help, including me ofc.

In my honest opinion, I see no point in trying to have privacy while using windows, like, you are already sacrificing your privacy to microsoft. The only way to combat that is to give less information to the corporations than trying to completely cut them out of it, they will always find a way around your settings.
If someone truly cares about their privacy, they should use linux. Then, you can get help from other privacy enthusiasts.

Take the linux pill @Innomen , you'll thank me later. Of course, you can still use windows for things like word, photoshop or gaming, but for everything else, use Linux.

@Innomen
Copy link

Innomen commented Jul 26, 2019

@jhuss
Privacy isn't all or nothing like that:
https://www.ted.com/talks/bruce_schneier

It's not like just running linux is the same as living like an active intelligence agent on the dark net behind 4 vpns and changing locations and my appearance every 7 days etc etc.

There are levels. I am looking for a good ratio of protection to effort. I'm already approaching a diminishing returns threshold.

I wouldn't mind going linux if it would stop being so arrogant. There isn't a linux on earth that actually wants to be a threat to microsoft or else one of them would have a shell that looks exactly like windows and make a real solid built in effort at compatibility.

Linux currently doesn't just say come to our side, enjoy privacy etc, it also says do everything our way or write your own from scratch while we all mock you for not being born knowing how to do it OR obsequiously acknowledging our superiority as human beings and thanking us for breathing every 4 words.

The biggest asset with windows is at least the community/company in theory serves me as a paying customer. Where as with linux it's very much a take it or leave it we owe you nothing our way or the highway feel.

I like how the windows gui works, and I like autohotkey. I can't get either one under linux.

I'm not looking to start a religious war, but you kinda directly asked XD Apologies if my reply causes drama, but I have opinions on this I feel I can fairly defend. And they aren't flattering.

I ran linux years ago briefly, back around when Ubuntu flirted with trying to be just a smidge beholden/supportive to its customer equivalents. Their forum banned me for criticizing their officially declared development priorities. Just for typing like I am now. It's not like I am or was spamming nazi images and lolicon or something.

So yeah I tried the linux pill, it made me froof it back up X)

Update 2019-07-30 0643 AM: FWIW I abandoned this fork. Imo it's a honeypot even pretending this version works on windows. Thanks for trying to help all to whatever degree you did so.

@Janaue
Copy link

Janaue commented Jun 14, 2020

Following @qvint's method described in #1030 (comment) works on version 81.

My steps:

1. Go to https://chromium.googlesource.com/chromium/deps/hunspell_dictionaries/+/master

2. Find a bdic you want, click on it. You will see a mostly empty page aside from "X-byte binary file"

3. On the bottom right corner, click "txt". For en-US-9-0.bdic, you will get a link https://chromium.googlesource.com/chromium/deps/hunspell_dictionaries/+/master/en-US-9-0.bdic?format=TEXT

4. This is a base64-encoded file. On Linux, simply run `base64 -d en-US-9-0.bdic > ~/.config/chromium/Dictionaries/en-US-9-0.bdic` (assuming you want the dictionary to be in the default profile)

5. Toggle spell check in `chrome://settings/languages`, or restart the browser for the dictionaries to take effect.

In windows, the TXT gives a .bdic, but it need to be open in 7z and then extracted and renamed into a .bdic.

@Kein
Copy link

Kein commented Aug 14, 2020

This probably could be realized as an extension similar to chromium-web-store extension. The only human-interaction step is to save processed bdic-file into proper directory since extension cant do that.

@GorvGoyl
Copy link

GorvGoyl commented Aug 30, 2020

In windows, the TXT gives a .bdic, but it need to be open in 7z and then extracted and renamed into a .bdic.

this doesn't work on Windows 10 as it gives a en-US-9-0.txt file which can't be opened in 7z.
To solve this I just copied dictionary file (in my case en-US-9-0.bdic) from Google chrome (C:\Users\your_user\AppData\Local\Google\Chrome\User Data) to ugc (C:\Users\your_user\AppData\Local\Chromium\User Data).
yes, need to put at \User Data instead of non-existent \User Data\Dictionaries folder.

make sure to toggle that spell check button (chrome://settings/languages) and restart.


If you don't have google chrome I've also attached en-US-9-0.bdic inside zip folder.
en-US-9-0.zip

@davidhealey
Copy link

On Debian, using Ungoogled Chromium, that download link provides a .txt file not a .bdic file. I tried renaming the file but the dictionary isn't showing up in settings.

@nettlebay
Copy link

nettlebay commented Dec 1, 2021

Linux Manjaro. Chromium Version 95.0.4638.54 (Official Build, ungoogled-chromium) (64 bits) PORTABLE.
Yes, I know, it's a relatively old version but I had other issues with the last version.
Hello everyone, I have been trying for days to get the French spell check in Ungoogled Chromium. And I found! I only copied the /home/user/.config/iridium/Dictionaries/fr-FR-3-0.bdic (in an old installation of Iridium) and pasted into /home/user/.config/chromium/Dictionaries/. I reboot and everything works like a charm: (snapshot)

correcteur

In the snapshot, English words are underlined because I haven't installed the English dictionnary yet

Edit: I just realized that GorvGoyl did almost the same in Windows.

@aidalgol
Copy link

aidalgol commented Apr 26, 2022

Following @qvint's method described in #1030 (comment) works on version 81.

My steps:

  1. Go to https://chromium.googlesource.com/chromium/deps/hunspell_dictionaries/+/master
  2. Find a bdic you want, click on it. You will see a mostly empty page aside from "X-byte binary file"
  3. On the bottom right corner, click "txt". For en-US-9-0.bdic, you will get a link https://chromium.googlesource.com/chromium/deps/hunspell_dictionaries/+/master/en-US-9-0.bdic?format=TEXT
  4. This is a base64-encoded file. On Linux, simply run base64 -d en-US-9-0.bdic > ~/.config/chromium/Dictionaries/en-US-9-0.bdic (assuming you want the dictionary to be in the default profile)
  5. Toggle spell check in chrome://settings/languages, or restart the browser for the dictionaries to take effect.

This solution has no visible effect in "Version 100.0.4896.127 (Official Build, ungoogled-chromium) (64-bit)". Does the version number in the file name have to match what ungoogled-chromium was expecting at compile time? I also tried copying the files from the user data dir that the same build of regular chromium creates on startup into the ungoogled-chromium Dictionaries directory, and still nothing is being underlined in red in text boxes.

Edited to add 19 hours later: Well now it's started working the next morning after a reboot. Why a reboot made the dictionary files take effect but simply restarting chromium was not is a complete mystery to me.

@Roy-Orbison
Copy link

Thanks @qvint, it worked for me.

Beware that the latest version in that tree may be ahead of your Chromium version, mine would not accept the 10-1 file but did the 10-0. Also the 4th step can be put into a one-liner, e.g.:

wget -qO- 'https://chromium.googlesource.com/chromium/deps/hunspell_dictionaries/+/41cdffd71c9948f63c7ad36e1fb0ff519aa7a37e/en-GB-10-0.bdic?format=TEXT' | base64 -d > ~/.config/chromium/Dictionaries/en-GB-10-0.bdic

@qcasey
Copy link

qcasey commented Jul 28, 2022

Thanks for the one-liner. Conversely on 103.0.5060.114 I needed 10-1 for spell check to work.

wget -qO- 'https://chromium.googlesource.com/chromium/deps/hunspell_dictionaries/+/41cdffd71c9948f63c7ad36e1fb0ff519aa7a37e/en-US-10-1.bdic?format=TEXT' | base64 -d > ~/.config/chromium/Dictionaries/en-US-10-1.bdic

After restarting chromium:

image

@Xoouu
Copy link

Xoouu commented Oct 25, 2022

Would like some help in getting spell check to work. I have tried putting the file in %LOCALAPPDATA%\Chromium\Application\Dictionaries\ as suggested in the FAQ and also in C:\Users\your_user\AppData\Local\Chromium\User Data, but nothing is happening. I have checked the spell check in settings and have restarted the browser multiple times. Maybe a reboot might help??

@Roy-Orbison
Copy link

@Xoouu Have you followed the FAQ steps exactly? Make sure you have no Chrome processes running in Task Manager's Details tab, make sure you got the right version of the file, and it's been base64 decoded, and the decoded version has the correct filename.

@Xoouu
Copy link

Xoouu commented Oct 26, 2022

I got it working! The file I downloaded was the wrong one. I should have payed attention whether it had numbers after the locale.

@PF4Public
Copy link
Contributor

PF4Public commented Jan 26, 2023

A somewhat related note. One needs to get hyphen-data from any other chromium (-fork) profile into one's profile for automatic css hyphenation to work. Maybe it would be possible to extract those files from chromium sources, but I didn't explore that possibility.
https://googlechrome.github.io/samples/css-hyphens/

screen.mp4
screen-.2.mp4

EDIT: It is possible to use hyphen-data from Android to add currently unsupported languages:
image

@Roy-Orbison
Copy link

Roy-Orbison commented Apr 3, 2023

That version of the file is outdated and no longer in the repo. You probably want this (adjust bdic var to match your language):

( bdic=en-GB-10-1.bdic; wget -qO- 'https://chromium.googlesource.com/chromium/deps/hunspell_dictionaries/+/refs/heads/main/'$bdic'?format=TEXT' | base64 -d > ~/.config/chromium/Dictionaries/$bdic )

@Roy-Orbison
Copy link

At the top of the page I linked to is this message:

Remove old versions of English dictionary .bdic files

Bug: 343438
Change-Id: I39dd59b9a265007008512f878c0f6c1416893230

en-AU-10-0.bdic[Deleted - diff]
en-CA-10-0.bdic[Deleted - diff]
en-GB-10-0.bdic[Deleted - diff]
en-GB-oxendict-10-0.bdic[Deleted - diff]
en-US-10-0.bdic[Deleted - diff]

The URLs you're using have a hash in them that refer to files from a specific, outdated commit. They are no longer relevant to the current version of Chromium. As I wrote in the comment with the original one-liner, the sources contained files that were ahead of the version of Chromium I was using, so I linked to the older ones.

You need to use newer versions. I tested the updated one-liner on my own installation, and my spell check is working fine. I'm unsure why you chose to ignore the newer instructions I provided.

@rstub
Copy link

rstub commented Apr 17, 2023

@u2human I had the same problem when using Flatpak. Issue seems to be that configuration files are in a different place. One has to use ~/.var/app/com.github.Eloston.UngoogledChromium/config/chromium/Dictionaries/ instead of ~/.config/chromium/Dictionaries/.

@PF4Public
Copy link
Contributor

@u2human Have you enabled the languages you need in settings?

@PF4Public
Copy link
Contributor

@u2human You need to also have them here: chrome://settings/languages

@PF4Public
Copy link
Contributor

PF4Public commented Apr 27, 2023

no I don't have them there:

Which should explain why spellcheck does not work. Should be working for English though.

BTW: You didn't tick "check for spelling errors" setting.

@PF4Public
Copy link
Contributor

Thogh they do not work all together

They do. But in my experience it does sometimes underline a correct word in English if it is a misspelled word in German and vice versa. That was beyond annoying and made me keep only English.

Besides, having multiple languages in that setting does result in them being sent with accept-languages header.

@blipk
Copy link

blipk commented Aug 13, 2024

In case anyone else comes across this issue I have made a simple enough to use python script to list and install the language files.

It works for Flatpak or standard installs on linux only.

https://gist.github.com/blipk/921a6b376ef2f5e247750d50cf95fcfe

Might be useful if we could pin this issue to prevent duplicates
@networkException @Eloston

Perhaps you could also consider including them as they seem to be open source from the hunspell repo (at least the English dictionaries) and the BDIC convertor from the chromium source is BSD-style licenced:
https://github.com/adobe/chromium/blob/master/chrome/tools/convert_dict/convert_dict.cc
https://chromium.googlesource.com/chromium/deps/hunspell_dictionaries/+/refs/heads/main/README_en_GB.txt

@PF4Public
Copy link
Contributor

@blipk Have you considered submitting PR in https://github.com/ungoogled-software/contrib?

@blipk
Copy link

blipk commented Aug 14, 2024

@PF4Public
I considered it, but I really don't know C/++ nor how the .patch files work, and don't have the time at the moment.
Perhaps someday, my python script works well enough for most use cases for now.

@PF4Public
Copy link
Contributor

I considered it, but I really don't know C/++ nor how the .patch files work

I would imagine creating another top directory named "scripts", where you could place your python script with some readme or something like that (in a subdirectory), could be appropriate, no need to convert it into C++.

@blipk
Copy link

blipk commented Aug 16, 2024

@PF4Public

Done: ungoogled-software/contrib#17

@iskunk
Copy link
Contributor

iskunk commented Aug 16, 2024

Hi everyone,

I saw @blipk's script PR. That looks good, though making use of that is still a bit involved for end users who are not accustomed to running scripts. (I do see that Chromium uses their own custom format for these dictionaries, and so cannot consume standard system hunspell files.)

Is there a reason why we can't just distribute these files ourselves? Either as part of the installer, or as an add-on package?

The dictionary files don't appear to be Google property. If you look in the Git directory where they live, there is an update_dictionaries.py script that downloads the main English ones from third-party SourceForge and GitHub projects, and then the README_*.txt files have licensing and attribution information for the others. AFAICT, everything's under some combination of MIT/GPL/LGPL/MPL/Apache license.

All the files together make for a <70 MB tarball, and uncompressed they are about 260 MB. Seems not unreasonable for an add-on download...

@blipk
Copy link

blipk commented Aug 16, 2024

@iskunk

See my comment link above, and same file in the chromium repo: https://chromium.googlesource.com/chromium/src/+/lkgr/chrome/tools/convert_dict/convert_dict.cc

This tool converts Hunspell .aff/.dic pairs to a combined binary dictionary format (.bdic)

It's BSD style licenced so I don't see it being a problem to integrate the update_dictionaries.py and convert_dict.cc into your own build process, or perhaps you could just use the bdic files from upstream chrome anyway.

I am just not familiar enough with the licences, with C or your build process to be able to get it done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests