Bug 507931 - Lokalize (flatpak): spell checking for language different from English does not work
Summary: Lokalize (flatpak): spell checking for language different from English does n...
Status: RESOLVED FIXED
Alias: None
Product: lokalize
Classification: Applications
Component: general (other bugs)
Version First Reported In: 25.04.3
Platform: Flatpak Linux
: NOR normal
Target Milestone: ---
Assignee: Finley Watson
URL: https://flathub.org/de/apps/org.kde.l...
Keywords:
Depends on:
Blocks:
 
Reported: 2025-08-06 09:37 UTC by AlexB
Modified: 2025-10-16 20:09 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description AlexB 2025-08-06 09:37:15 UTC
SUMMARY
Spell checking for "de" or "de_DE" does not work in Lokalize 25.04.3 (flatpak), all correct words are red underlined.
Following error messages could be seen in terminal:
$ journalctrl -ft flatpak
  
flatpak[5092]: Qt: Session management error: Could not open network socket
flatpak[5092]: org.kde.lokalize: db "default_lokalize_connection_134887130523328" opened 5 "de"
flatpak[5092]: kf.sonnet.clients.hunspell: Unable to find dictionary for "de_DE_frami" in path "/de_DE_frami"
flatpak[5092]: kf.sonnet.clients.hunspell: Can't create a client without a speller
Comment 1 Finley Watson 2025-08-06 15:41:30 UTC
Thanks for reporting. From what I can tell, outside of Flatpak, the spell checking dictionary options appear based on whatever dictionaries are installed: I installed hunspell-de from the Arch repos and reopening Lokalize showed the new Deutsch dictionary options without my having to configure anything.

The "frami" part suggests the Flatpak version of Lokalize is looking for the Hunspell dictionary available e.g. here https://extensions.libreoffice.org/en/extensions/show/german-de-de-frami-dictionaries so it's not the default Hunspell dictionary but rather a specific version.

If I'm right in assuming the dictionaries are bundled within the Flatpak, then I guess Lokalize needs to include the correct dictionary. If they're not bundled, then you probably need to install either the normal de_DE dictionary or the de_DE_frami version.

Have you used a previous Flatpak version where the dictionary was working?
Comment 2 AlexB 2025-08-06 16:49:14 UTC
(In reply to Finley Watson from comment #1)
> Thanks for reporting. From what I can tell, outside of Flatpak, the spell
> checking dictionary options appear based on whatever dictionaries are
> installed: I installed hunspell-de from the Arch repos and reopening
> Lokalize showed the new Deutsch dictionary options without my having to
> configure anything.
>
> The "frami" part suggests the Flatpak version of Lokalize is looking for the
> Hunspell dictionary available e.g. here
> https://extensions.libreoffice.org/en/extensions/show/german-de-de-frami-
> dictionaries so it's not the default Hunspell dictionary but rather a
> specific version.

Hi Finley, thank you for your reply!
Does it mean, that for Flatpak packaged applications (e.g. for Lokalize) one needs to install additional/special dictionaries?
If yes, why there is no message/warning about this within application?

> If I'm right in assuming the dictionaries are bundled within the Flatpak,
> then I guess Lokalize needs to include the correct dictionary. If they're
> not bundled, then you probably need to install either the normal de_DE
> dictionary or the de_DE_frami version.
> 
> Have you used a previous Flatpak version where the dictionary was working?

Some days before I have used Lokalize version 24.12.3 (not Flatpak-Version, installed from Discover). There was no issue with spell checking.
Current installed version 25.04.3 is also taken from Discover, but is Flatpak-Version. This version has the issue with spell checking.
I can still uninstall Flatpak-Version of Lokalize and install 24.12.3 version and spell checking directly works.
Comment 3 AlexB 2025-08-06 17:01:05 UTC
Some additional information:

$ apt list | grep hunspell-de

hunspell-de-at-frami/noble,noble 1:24.2.1-1 all
hunspell-de-at/noble,noble 20161207-12 all
hunspell-de-ch-frami/noble,noble,now 1:24.2.1-1 all  [installiert]
hunspell-de-ch/noble,noble 20161207-12 all
hunspell-de-de-frami/noble,noble,now 1:24.2.1-1 all  [installiert]
hunspell-de-de/noble,noble 20161207-12 all
hunspell-de-med/noble,noble 20230905-1 all

But as I understood Flatpak versions of applications are not using spell checkers from the underlying system.
Comment 4 Nicolas Fella 2025-08-06 17:07:56 UTC
As far as I can tell the Flatpak has the right files in /usr/share/hunspell, but it fails to find them.

The relevant code is at https://invent.kde.org/frameworks/sonnet/-/blob/master/src/plugins/hunspell/hunspellclient.cpp#L56
Comment 5 AlexB 2025-08-06 17:41:19 UTC
(In reply to Nicolas Fella from comment #4)
> As far as I can tell the Flatpak has the right files in /usr/share/hunspell,
> but it fails to find them.

Yes, I can confirm, those files exist in this directory:
$ ls -la /usr/share/hunspell

drwxr-xr-x     2  root root    4096 Jul 10 22:45 .
drwxr-xr-x 392  root root   12288 Aug  1 23:18 ..
lrwxrwxrwx   1  root root      15 Feb 25  2024 de_CH.aff -> de_CH_frami.aff
lrwxrwxrwx   1  root root      15 Feb 25  2024 de_CH.dic -> de_CH_frami.dic
-rw-r--r--         1 root root   19068 Feb 25  2024 de_CH_frami.aff
-rw-r--r--         1 root root 4358308 Feb 25  2024 de_CH_frami.dic
lrwxrwxrwx   1 root root      15 Feb 25  2024 de_DE.aff -> de_DE_frami.aff
lrwxrwxrwx   1 root root      15 Feb 25  2024 de_DE.dic -> de_DE_frami.dic
-rw-r--r--         1 root root   19067 Feb 25  2024 de_DE_frami.aff
-rw-r--r--         1 root root 4356858 Feb 25  2024 de_DE_frami.dic
-rw-r--r--         1 root root   35291 Feb 25  2024 en_GB.aff
-rw-r--r--         1 root root 1223137 Feb 25  2024 en_GB.dic
-rw-r--r--         1 root root    3131 Jan 20  2022 en_US.aff
-rw-r--r--         1 root root  860381 Jan 20  2022 en_US.dic
Comment 6 AlexB 2025-08-06 17:56:52 UTC
(In reply to Nicolas Fella from comment #4)
> As far as I can tell the Flatpak has the right files in /usr/share/hunspell,
> but it fails to find them.
> 
> The relevant code is at
> https://invent.kde.org/frameworks/sonnet/-/blob/master/src/plugins/hunspell/
> hunspellclient.cpp#L56

Additional information:
$ apt list | grep sonnet

jsonnet/noble 0.20.0+ds-1build2 amd64
libjsonnet-dev/noble 0.20.0+ds-1build2 amd64
libjsonnet0/noble 0.20.0+ds-1build2 amd64
libkf5sonnet-dev-bin/tuxedo 5.116.0-0ubuntu1~tux1 amd64
libkf5sonnet-dev/tuxedo 5.116.0-0ubuntu1~tux1 amd64
libkf5sonnet-doc/tuxedo,tuxedo 5.116.0-0ubuntu1~tux1 all
libkf5sonnet5-data/tuxedo,tuxedo,now 5.116.0-0ubuntu1~tux1 all  [Installiert,automatisch]
libkf5sonnetcore5/tuxedo,now 5.116.0-0ubuntu1~tux1 amd64  [Installiert,automatisch]
libkf5sonnetui5/tuxedo,now 5.116.0-0ubuntu1~tux1 amd64  [Installiert,automatisch]
libkf6sonnet-data/tuxedo,tuxedo,now 6.15.0-0ubuntu0~tux1 all  [Installiert,automatisch]
libkf6sonnet-dev-bin/tuxedo 6.15.0-0ubuntu0~tux1 amd64
libkf6sonnet-dev/tuxedo 6.15.0-0ubuntu0~tux1 amd64
libkf6sonnet-doc/tuxedo,tuxedo 6.15.0-0ubuntu0~tux1 all
libkf6sonnetcore6/tuxedo,now 6.15.0-0ubuntu0~tux1 amd64  [Installiert,automatisch]
libkf6sonnetui6/tuxedo,now 6.15.0-0ubuntu0~tux1 amd64  [Installiert,automatisch]
python3-jsonnet/noble 0.20.0+ds-1build2 amd64
qml-module-org-kde-sonnet/tuxedo,now 5.116.0-0ubuntu1~tux1 amd64  [Installiert,automatisch]
qml6-module-org-kde-sonnet/tuxedo,now 6.15.0-0ubuntu0~tux1 amd64  [Installiert,automatisch]
sonnet-plugins/tuxedo,now 5.116.0-0ubuntu1~tux1 amd64  [Installiert,automatisch]
sonnet6-plugins/tuxedo,now 6.15.0-0ubuntu0~tux1 amd64  [Installiert,automatisch]
Comment 7 AlexB 2025-08-06 18:26:21 UTC
(In reply to Nicolas Fella from comment #4)
> As far as I can tell the Flatpak has the right files in /usr/share/hunspell,
> but it fails to find them.
> 
> The relevant code is at
> https://invent.kde.org/frameworks/sonnet/-/blob/master/src/plugins/hunspell/
> hunspellclient.cpp#L56

To check if I have the issue with symlinks I have done following:

sudo cp -r hunspell hunspell.backup
sudo rm de_DE.aff; sudo cp de_DE_frami.aff de_DE.aff
sudo rm de_DE.dic; sudo cp de_DE_frami.dic de_DE.dic

sudo cp -r hunspell-bdic hunspell-bdic.backup
cd hunspell-bdic
sudo rm de_DE.bdic; sudo cp de_DE_frami.bdic de_DE.bdic

Lokalize still have no working spell checking for "de" and following flatpak output is still there:

$ journalctrl -ft flatpak
  
flatpak[5092]: Qt: Session management error: Could not open network socket
flatpak[5092]: org.kde.lokalize: db "default_lokalize_connection_134887130523328" opened 5 "de"
flatpak[5092]: kf.sonnet.clients.hunspell: Unable to find dictionary for "de_DE_frami" in path "/de_DE_frami"
flatpak[5092]: kf.sonnet.clients.hunspell: Can't create a client without a speller
Comment 8 Nicolas Fella 2025-08-07 10:32:37 UTC
The Flatpak has it's own filesystem, so anything you do in the system's /usr/share does not affect the Flatpak
Comment 9 Bug Janitor Service 2025-08-07 10:51:01 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/sonnet/-/merge_requests/130
Comment 10 AlexB 2025-09-07 00:15:33 UTC
Lokalize 25.08.0 has still the issue, it cannot load de_DE.dic

Some additional information from my investigations:

1. Started monitoring file access in terminal:

inotifywait -rmq /var/lib/flatpak/runtime/org.kde.Platform/x86_64/6.9/1404fa5b216e0c9cac7fb1a611b58ddff8a07b55c69eea47dbe3ffe7b3fafdde/files/share/hunspell/

2. Started Lokalize

3. Output from inotifywait from 1.:

/var/lib/flatpak/runtime/org.kde.Platform/x86_64/6.9/1404fa5b216e0c9cac7fb1a611b58ddff8a07b55c69eea47dbe3ffe7b3fafdde/files/share/hunspell/ OPEN en_US.dic
/var/lib/flatpak/runtime/org.kde.Platform/x86_64/6.9/1404fa5b216e0c9cac7fb1a611b58ddff8a07b55c69eea47dbe3ffe7b3fafdde/files/share/hunspell/ ACCESS en_US.dic
/var/lib/flatpak/runtime/org.kde.Platform/x86_64/6.9/1404fa5b216e0c9cac7fb1a611b58ddff8a07b55c69eea47dbe3ffe7b3fafdde/files/share/hunspell/ CLOSE_NOWRITE,CLOSE en_US.dic

4. Checked in folder

/var/lib/flatpak/runtime/org.kde.Platform/x86_64/6.9/1404fa5b216e0c9cac7fb1a611b58ddff8a07b55c69eea47dbe3ffe7b3fafdde/files/share/hunspell/ 

for de_DE.dic → it is a link to

../locale/de/hunspell/de_DE_frami.dic

/var/lib/flatpak/runtime/org.kde.Platform/x86_64/6.9/1404fa5b216e0c9cac7fb1a611b58ddff8a07b55c69eea47dbe3ffe7b3fafdde/files/share/locale/de
points to ../runtime/locale/de/share/de

/var/lib/flatpak/runtime/org.kde.Platform/x86_64/6.9/1404fa5b216e0c9cac7fb1a611b58ddff8a07b55c69eea47dbe3ffe7b3fafdde/files/share/runtime/locale/de/
is a folder and is empty!!!

Question: How to install a language / locale into 
/var/lib/flatpak/runtime/org.kde.Platform/x86_64/6.9/ ?
Comment 11 Christoph Cullmann 2025-09-12 18:09:10 UTC
Git commit b37656db641500a0ba7a411e3bb4338f7d842992 by Christoph Cullmann.
Committed on 12/09/2025 at 18:09.
Pushed by cullmann into branch 'master'.

fix handling of symlinks for hunspell dicts

don't assume all symlinks are just aliases, that breaks e.g. for
Flatpak as /usr/share/hunspell/de_DE.aff is a symlink to
/usr/share/runtime/locale/de/share/de/hunspell/de_DE_frami.aff

Co-authored-by: Nicolas Fella <nicolas.fella@gmx.de>

M  +5    -0    src/plugins/hunspell/hunspellclient.cpp

https://invent.kde.org/frameworks/sonnet/-/commit/b37656db641500a0ba7a411e3bb4338f7d842992
Comment 12 AlexB 2025-10-06 12:28:14 UTC
(In reply to Christoph Cullmann from comment #11)
> Git commit b37656db641500a0ba7a411e3bb4338f7d842992 by Christoph Cullmann.
> Committed on 12/09/2025 at 18:09.
> Pushed by cullmann into branch 'master'.
> 
> fix handling of symlinks for hunspell dicts
> 
> don't assume all symlinks are just aliases, that breaks e.g. for
> Flatpak as /usr/share/hunspell/de_DE.aff is a symlink to
> /usr/share/runtime/locale/de/share/de/hunspell/de_DE_frami.aff
> 
> Co-authored-by: Nicolas Fella <nicolas.fella@gmx.de>
> 
> M  +5    -0    src/plugins/hunspell/hunspellclient.cpp
> 
> https://invent.kde.org/frameworks/sonnet/-/commit/
> b37656db641500a0ba7a411e3bb4338f7d842992

Just as information for myself and others who is interested in fix of this issue:

1. Flatpak version of Lokalize is using https://invent.kde.org/frameworks/sonnet for spell checking
2. https://invent.kde.org/frameworks/sonnet/-/commit/b37656db641500a0ba7a411e3bb4338f7d842992 should fix spell checking issue
3. Sonnet framework is part of https://invent.kde.org/packaging/flatpak-kde-runtime as you could see here: https://invent.kde.org/packaging/flatpak-kde-runtime/-/blob/qt6.9/org.kde.Sdk.json.in?ref_type=heads#L1592
4. Latest "KDE Flatpak runtime" references still older version of Sonnet framework, see https://invent.kde.org/packaging/flatpak-kde-runtime/-/blob/qt6.9/org.kde.Sdk.json.in?ref_type=heads#L1602
→ We need still to wait for next "KDE Flatpak runtime".
Comment 13 AlexB 2025-10-16 20:09:44 UTC
(In reply to AlexB from comment #12)
> (In reply to Christoph Cullmann from comment #11)
> > Git commit b37656db641500a0ba7a411e3bb4338f7d842992 by Christoph Cullmann.
> > Committed on 12/09/2025 at 18:09.
> > Pushed by cullmann into branch 'master'.
> > 
> > fix handling of symlinks for hunspell dicts
> > 
> > don't assume all symlinks are just aliases, that breaks e.g. for
> > Flatpak as /usr/share/hunspell/de_DE.aff is a symlink to
> > /usr/share/runtime/locale/de/share/de/hunspell/de_DE_frami.aff
> > 
> > Co-authored-by: Nicolas Fella <nicolas.fella@gmx.de>
> > 
> > M  +5    -0    src/plugins/hunspell/hunspellclient.cpp
> > 
> > https://invent.kde.org/frameworks/sonnet/-/commit/
> > b37656db641500a0ba7a411e3bb4338f7d842992
> 
> Just as information for myself and others who is interested in fix of this
> issue:
> 
> 1. Flatpak version of Lokalize is using
> https://invent.kde.org/frameworks/sonnet for spell checking
> 2.
> https://invent.kde.org/frameworks/sonnet/-/commit/
> b37656db641500a0ba7a411e3bb4338f7d842992 should fix spell checking issue
> 3. Sonnet framework is part of
> https://invent.kde.org/packaging/flatpak-kde-runtime as you could see here:
> https://invent.kde.org/packaging/flatpak-kde-runtime/-/blob/qt6.9/org.kde.
> Sdk.json.in?ref_type=heads#L1592
> 4. Latest "KDE Flatpak runtime" references still older version of Sonnet
> framework, see
> https://invent.kde.org/packaging/flatpak-kde-runtime/-/blob/qt6.9/org.kde.
> Sdk.json.in?ref_type=heads#L1602
> → We need still to wait for next "KDE Flatpak runtime".
Finally KDE Flatpak runtime contains now the fix and spell check of Lokalize works as expected!
Thank you very much!