for that to work what KConfig expects (the language only) has to be first
in the list, otherwise KConfig returns entries that are actually not in the
set locale (go figure)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
to avoid conversion from QString to QByteArray when possible, the trace is
handled as array of latin1-encoded strings anyway
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
a crashed program trying to restart itself is very unreliable,
especially program that uses KUniqueApplication instance. so, instead
all the information about the crash shall be written to a file on the
disk (in the temporary directory) and read by external kcrash KDED
module that will report the crash (possibily even upload the crash
details somewhere) and restart the program as necessarry.
this also opens up possibility for per-application configuration for
things such as the automatic restart feature but that shall be done by the
kcrash KDED module instead (parsing a config from a crashed program is
not a good idea)
KCrash::NoRestart will be unused but kept for future expansion
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
as noted in de7070d2bb having multiple
languages and matching the correct one for each use case will have to be
tuned
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
default as in no explicit language has been passed as argument to KLocale
and the language comes either from config or the environemnt variables
with this change KCalendarWidget properly adapts to KLocale config change,
however other applications and widgets may not which is something that has
to be looked into. note that logout is (and was before the KLocale rewrite
even) recommended by the locale KCM for the change to fully take effect
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
otherwise KLocale::formatNumber() has to guess the precision that was
passed to KLocalizedString::subs() and make up a localized integer string
with a magic wand, the precision for precise number types (e.g. ulong,
qlonglong, etc.) remains -1
fixes KSignalPlotter test case failure
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
the test case for this is in a KSignalPlotter test, see:
kde-workspace/libs/ksysguard/tests/signalplottertest.cpp
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
beware that bad things will happen if the input strings are not in one of
the formats KLocale::formatDate() and KLocale::formatTime() output
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
e.g. "bg" for "bg_BG", the default locale is special case for that method
too because of expectations in other places (such as KConfig, KMimeType
tries to match all of the languages returned by KLocale::languageList()
which is how it should be done but that is for another commit)
that is essentially the last bit to bring it back to a compatible state
with the previous implementation, except now more locales are supported
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
also adjust KLocalizedString test case, "Job" is no longer translated
string in the source code thus not in the french translation
on a side note there are KLocale tests all around - KLocalizedString, KIO
tests, etc. so perhaphs only quircks should be tested by the KLocale
specifiec tests
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
while the threads are running the kdelibs4 catalog may or may not get
removed resulting in a race and different results in the functions (if
the catalog is not there there will be no translation but the test
functions expect it to be translated when french translations are
installed)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
people really messed up the precisions, look at what kcalc does with the
constants:
kde-extraapps/kcalc/kcalcdisplay.cpp
zero precision is essentially rounding the constants! also setlocale() no
longer has effect on Katie and thus Katana so updated the method to
override locale in KLocalizedString test while at it (tests pass after one
adjustment for the french locale case)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
much like the old (and now gone) KLocale::prettyFormatDuration() except
with miliseconds precision instead of days
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
by using QLocale in KLocale and separating the date, time and numbers
conversion from translation KLocale actually gets extended locale
support from QLocale (which uses CLDR data v43 currently). translation
remains unaffected. for comparison here is the result of two function
calls the result of which should explain the whole change:
KLocale::allLanguagesList().size() = 669
KLocale::installedLanguages().size() = 68
the first number is locales Katie supports, the second being the
number of languages Katana is translated into
KSwitchLanguageDialog needs a rewrite but that is on the TODO
also copyrighting KCatalog to me because I rewrote it, for reference:
881b47b8ea
KCalendarSystem gets the middle finger - batteries not included for date
and time. extra calendar systems can, but are unlikely to be, supported
in the future
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>