ungoogled-software / ungoogled-chromium

Google Chromium, sans integration with Google
BSD 3-Clause "New" or "Revised" License
20.28k stars 820 forks source link

language spell check #188

Open jhuss opened 7 years ago

jhuss commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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

Eloston commented 7 years ago

Well I found some other links: https://github.com/electron/electron/issues/3189 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=814552

Eloston commented 7 years ago

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 commented 7 years ago

@Eloston how to do that?

Eloston commented 7 years ago

@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 commented 7 years ago

Some discussion about spell checking over here: https://github.com/gcarq/inox-patchset/issues/83

Atavic commented 7 years ago

@jhuss https://github.com/hunspell/hunspell

Eloston commented 7 years ago

New status update: https://github.com/gcarq/inox-patchset/issues/83#issuecomment-323229832

qvint commented 5 years ago

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 :confused:

TCB13 commented 5 years ago

@Eloston how to do that?

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

Innomen commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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

Some useful commands for Gentoo-users:

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 commented 5 years ago

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 commented 5 years ago

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

TCB13 commented 5 years ago

@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 commented 5 years ago

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 commented 5 years ago

@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 commented 5 years ago

@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 commented 5 years ago

@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 commented 5 years ago

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 commented 5 years ago

@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.

Eloston commented 4 years ago

Following @qvint's method described in https://github.com/Eloston/ungoogled-chromium/issues/1030#issuecomment-626454805 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.
Janaue commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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\youruser\AppData\Local\Google\Chrome\User Data) to ugc (_C:\Users\youruser\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 commented 3 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 1 year ago

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 commented 1 year ago

@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 commented 1 year ago

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 commented 1 year ago

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/

https://user-images.githubusercontent.com/10319700/214816173-4fd4c0ce-7bef-4e43-9781-6868be6c7321.mp4

https://user-images.githubusercontent.com/10319700/214817348-ef517c8d-49c6-4583-a0a8-230adf6bb65d.mp4

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

Roy-Orbison commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

@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 commented 1 year ago

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

PF4Public commented 1 year ago

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

PF4Public commented 1 year ago

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 commented 1 year ago

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 commented 1 month ago

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 commented 1 month ago

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

blipk commented 1 month ago

@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 commented 1 month ago

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 commented 1 month ago

@PF4Public

Done: https://github.com/ungoogled-software/contrib/pull/17

iskunk commented 1 month ago

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 commented 1 month ago

@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.