Skip to content
Commit 6efe4ae8 authored by Dimitris Kardarakos's avatar Dimitris Kardarakos
Browse files

Fix Bug 356239 and facilitate proper grammar downloading

After porting to frameworks, only languages from the currently installed language packages can be selected when creating a new collection.
Moreover, grammar fetching does not work in some cases even if the grammar file exists in http://edu.kde.org/parley/locale/.
Instead of using QLocale().uiLanguages() in order to create the combobox of to-be-selected languages, a key map has been created with
key = language-country, value = locale. Now, user is presented with a list of Language (Country) entries. After selecting, the locale
(value of the key map) is set to the data part of the combobox. So, the looping in uiLanguages() in DocumentProperties::acceptLanguageConfiguration
can be avoided. uiLanguages() returns an ordered list of locale names like "en-Latn-US", "en-US", "en". E.g., in case of american english,
en-US is set. Trying to fetch the grammar from http://edu.kde.org/parley/locale/, although en.kvtml exists, we cannot get the grammar.
With this fix, locale info is stored as a string of the form "language_country" (using QLocal name() function). When trying to fetch grammar,
only the first part (language) is used. Thus, de.kvtml, en.kvtml, es.kvtml, fr.kvtml can now be properly downloaded.

BUG: 356239

REVIEW: 127063
parent a87c55eb
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment