From 8092c0fdcd1c8eb3941fd8877a6ed8dbe1e74cd6 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Wed, 6 Aug 2014 10:48:01 -0700 Subject: [PATCH] Attempt to hack around the problems with Swedish date localization When trying to shorten the long date format into a "medium" length date format we are messing up Swedish dates. This should fix the issue. Not a great solution but should be good enough for 4.2 Signed-off-by: Dirk Hohndel --- qt-gui.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qt-gui.cpp b/qt-gui.cpp index ed960d7eb..bb3001ff4 100644 --- a/qt-gui.cpp +++ b/qt-gui.cpp @@ -98,8 +98,11 @@ QString uiLanguage(QLocale *callerLoc) shortDateFormat = loc.dateFormat(QLocale::ShortFormat); dateFormat = loc.dateFormat(QLocale::LongFormat); dateFormat.replace("dddd,", "ddd").replace("dddd", "ddd").replace("MMMM", "MMM"); + // special hack for Swedish as our switching from long weekday names to short weekday names + // messes things up there + dateFormat.replace("'en' 'den' d:'e'", " d"); timeFormat = loc.timeFormat(); - timeFormat.replace("(t)", "").replace(" t", "").replace("t", "").replace("hh", "h").replace("HH", "H"); + timeFormat.replace("(t)", "").replace(" t", "").replace("t", "").replace("hh", "h").replace("HH", "H").replace("'kl'.", ""); return uiLang; }