From 2b754fc1fabdb3dd09a5ad9ca04dfcdfe892b3d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Buczkowski?= Date: Sun, 2 Dec 2012 11:04:45 +0100 Subject: [PATCH] Localize Kernel build date/time. Fixes #9230. This task was completed during GCI 2012 Signed-off-by: Siarzhuk Zharski --- src/apps/aboutsystem/AboutSystem.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/apps/aboutsystem/AboutSystem.cpp b/src/apps/aboutsystem/AboutSystem.cpp index 5ed73039c68..c36f5a7da60 100644 --- a/src/apps/aboutsystem/AboutSystem.cpp +++ b/src/apps/aboutsystem/AboutSystem.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2005-2011, Haiku, Inc. + * Copyright 2005-2012, Haiku, Inc. * Distributed under the terms of the MIT license. * * Authors: @@ -46,6 +46,7 @@ #include #include #include +#include #include #include @@ -662,8 +663,21 @@ AboutView::AboutView() B_ALIGN_VERTICAL_UNSET)); // Kernel build time/date - snprintf(string, sizeof(string), "%s %s", - systemInfo.kernel_build_date, systemInfo.kernel_build_time); + BString kernelTimeDate; + kernelTimeDate << systemInfo.kernel_build_date + << " " << systemInfo.kernel_build_time; + BString buildTimeDate; + const BLocale* locale = BLocale::Default(); + + time_t buildTimeDateStamp = parsedate(kernelTimeDate, -1); + if (buildTimeDateStamp > 0) { + if (locale->FormatDateTime(&buildTimeDate, buildTimeDateStamp, + B_LONG_DATE_FORMAT, B_MEDIUM_TIME_FORMAT) != B_OK) + buildTimeDate.SetTo(kernelTimeDate); + } else + buildTimeDate.SetTo(kernelTimeDate); + + snprintf(string, sizeof(string), buildTimeDate); BStringView* kernelView = new BStringView("kerneltext", string); kernelView->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT,