SUMMARY The new spell checking feature of digikam 8 doesn't follow kde's spell checking settings, nor does it appear to be possible to set a default spell check language within digikam. STEPS TO REPRODUCE 1. Set KDE System Settings -> Regional Settings -> Spell Check to "Default Language - British English" and "British English" as the preferred language. (Screenshot 01) 2. Enable Spell Checking in digikam. (Screenshot 02) 3. OBSERVED RESULT digikam uses both en_US and en_GB - For example: the words "color" (US) and "colour" (GB) are both shown as correct spellings. There is no (apparent) option in digikam's Spell Checking setup to select a default or preferred language. EXPECTED RESULT To follow the KDE default setting, or the ability to define the Spell Check language, as for example "kate" does. (Screenshot 03) SOFTWARE/OS VERSIONS Operating System: openSUSE Leap 15.4 KDE Plasma Version: 5.24.4 KDE Frameworks Version: 5.90.0 Qt Version: 5.15.2 Kernel Version: 5.14.21-150400.24.60-default (64-bit) Graphics Platform: X11 Processors: 6 × AMD FX(tm)-6300 Six-Core Processor Memory: 7.7 GiB of RAM Graphics Processor: NV106 ADDITIONAL INFORMATION
Created attachment 158239 [details] Screenshot 01 - KDE System Settings - Spell Check
Created attachment 158240 [details] Screenshot 02 - digikam Spell Check Settings
Created attachment 158241 [details] Screenshot 03 - kate Spell Check Settings (for comparison)
Hi Paul, First, the Spell Checker in digiKam as nothing to do with KDE settings. Application has a dedicated setting usable everywhere, not only under Linux/KDE. Remember that digiKam run on Mac and Windows. Second, look well in the config panel, it's explained : "Turn on this option to activate the background spellcheck feature on captions, titles, and other text-edit widgets. Spellcheck is able to auto-detect the current language used in text and will propose alternative with miss-spelled words." In other word, the text is parsed and language auto-detected. If relevant dictionary is installed, spellcheck will be processed. Remember also that all text enter in digiKam GUI use the Alternative Language feature. It's different than a simple text editor as Kate, where the language for the string as a properties to specify the langue used for the text. This property is used first to choose the right dictionary (for ex FR-fr) or the auto-detection is processed if the default alternative language is selected (x-default) . So you don't need the default language in the settings, as all is automatized... Only the dictionaries must be installed to be sure that langauge is detected and spell checking processed. Gilles Caulier
Paul, If it's enough clear in the online documentation, let's me hear: https://docs.digikam.org/en/setup_application/miscs_settings.html#spellcheck-settings Best Gilles Caulier
(In reply to caulier.gilles from comment #4) > > ... Spellcheck is able to > auto-detect the current language used in text and will propose alternative > with miss-spelled words." > > In other word, the text is parsed and language auto-detected. If relevant > dictionary is installed, spellcheck will be processed. > So how does it differentiate between en_US and en_GB? (or for that matter any other variant of English) Unfortunately the en_US dictionary is a hard dependency "YaST2 conflicts list ... the installed hunspell-1.6.2-150000.3.11.1.x86_64 requires 'myspell-en_US'..." so I can't simply remove it.
(In reply to Paul from comment #6) > > Unfortunately the en_US dictionary is a hard dependency "YaST2 conflicts > list ... the installed hunspell-1.6.2-150000.3.11.1.x86_64 requires > 'myspell-en_US'..." so I can't simply remove it. Uninstalled 'myspell-en_US' (which 'breaks' hunspell) and I now have only the en_GB dictionary being used by digikam (Screenshot 04). Auto detection of language for spell checking may work well in most cases that don't involve a variant of a language, but for languages that have spelling variants, such as British English and American English, there needs to be (IMHO) an option to disable auto detection and to explicitly set the dictionary used.
Created attachment 158265 [details] Screenshot 04 - digikam Spell Check Settings with myspell-en_US removed
For the English language variants, XMP supports alternative languages strings in metadata. https://invent.kde.org/graphics/digikam/-/blob/master/core/libs/widgets/metadata/utils/altlangstredit_p.cpp#L101 So to set the language in the alternative language edit widget with this kind of value will ask to check spelling with right dictionary, if it's installed of course. Gilles Caulier
I'm sorry, I clearly don't understand this :( All of my text is in British English, I have no need for any other variant of English, or for any other language. By default hunspell installs, and has a dependency upon en_US (American English). I manually installed en_GB (British English), other applications that use hunspell enable selecting en_GB. What do I need to do, short of removing en_US as outlined in comment #7, to enable digikam to use en_GB and only en_GB for spell checking? I apologise once more, but as I said, I clearly don't understand this...
Each alternative langage strings in digiKam have a property to set the language to use for the corresponding string. set en_GB and that all the spell-checking will parse your string with this language, if and only if the relevant dictionary is installed. For ex, the caption can be enter en french, german, spanish, etc. Each version of the caption will be parsed with the relevant dictionary. This last one is used when you switch from one alternative language entry to another one. It simple and automatic. Gilles Caulier
Created attachment 158273 [details] digikam-combo-list (In reply to caulier.gilles from comment #11) > Each alternative langage strings in digiKam have a property to set the > language to use for the corresponding string. set en_GB and that all the > spell-checking will parse your string with this language, if and only if the > relevant dictionary is installed. > You mean I have to select en_GB from the drop down box... ? Each and every time I make a text entry... ?? Why doesn't "x-default" default to en_GB (This machine locale settings: paul@HP255G7:~> locale LANG=en_GB.utf8 LC_CTYPE="en_GB.utf8" LC_NUMERIC="en_GB.utf8" LC_TIME="en_GB.utf8" LC_COLLATE="en_GB.utf8" LC_MONETARY="en_GB.utf8" LC_MESSAGES="en_GB.utf8" LC_PAPER="en_GB.utf8" LC_NAME="en_GB.utf8" LC_ADDRESS="en_GB.utf8" LC_TELEPHONE="en_GB.utf8" LC_MEASUREMENT=en_CA.UTF-8 LC_IDENTIFICATION="en_GB.utf8" LC_ALL= paul@HP255G7:~> ) I think I'll give up on this, sorry to have taken your time...
>You mean I have to select en_GB from the drop down box... ? Each and every time I make a text entry... ?? Exactly, this the goal to enter multi-language strings in metadata managed by digiKam. It follows rules give by the XMP standard from Adobe. >Why doesn't "x-default" default to en_GB This one is the "default" entry selected automatically when no one exist yet. The XMP norm said that it free for use which your prefered language, but it's highly recommend to write in English inside. With "x-default", in all case, digiKam will auto-detect the language used inside and process the spell checking with the right dictionary. Best Gilles Caulier
(In reply to caulier.gilles from comment #13) > > With "x-default", in all case, digiKam will auto-detect the language used > inside and process the spell checking with the right dictionary. > Yes, but here's the problem... digiKam doesn't differentiate between text written as British English (en_GB) or American English (en_US) and if both dictionaries are installed the spell checking is not always correct, as shown in my first post with the example of the words "color" (US) and "colour" (GB) which are both shown as correct spellings.
Git commit 0fb709ca4b4e2e729f2f83fe02d0772a876cfd19 by Gilles Caulier. Committed on 22/04/2023 at 20:33. Pushed by cgilles into branch 'master'. Add default language settings for spell checking and x-default value from alternative language widget. FIXED-IN: 8.1.0 M +9 -0 core/libs/widgets/text/dplaintextedit.cpp M +9 -0 core/libs/widgets/text/dtextedit.cpp M +1 -1 core/libs/widgets/text/localizeconfig.cpp M +1 -1 core/libs/widgets/text/localizeconfig.h M +5 -1 core/libs/widgets/text/localizecontainer.cpp M +2 -1 core/libs/widgets/text/localizecontainer.h M +1 -1 core/libs/widgets/text/localizesettings.cpp M +1 -1 core/libs/widgets/text/localizesettings.h M +28 -5 core/libs/widgets/text/spellcheckconfig.cpp M +1 -1 core/libs/widgets/text/spellcheckconfig.h https://invent.kde.org/graphics/digikam/commit/0fb709ca4b4e2e729f2f83fe02d0772a876cfd19
Git commit 8e825a04f7e564cccc7121fb16e0585758ba9960 by Gilles Caulier. Committed on 23/04/2023 at 04:53. Pushed by cgilles into branch 'master'. Online documentation: update spellchecking settings page with the default language configuration M +- -- setup_application/images/setup_miscs_spellcheck.webp M +3 -1 setup_application/miscs_settings.rst https://invent.kde.org/documentation/digikam-doc/commit/8e825a04f7e564cccc7121fb16e0585758ba9960