Localize Kernel build date/time. Fixes #9230.

This task was completed during GCI 2012

Signed-off-by: Siarzhuk Zharski <[email protected]>
This commit is contained in:
Przemysław Buczkowski
2012-12-02 11:04:45 +01:00
committed by Siarzhuk Zharski
parent 64e07c0f38
commit 2b754fc1fa
+17 -3
View File
@@ -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 <AppMisc.h>
#include <AutoDeleter.h>
#include <cpu_type.h>
#include <parsedate.h>
#include <system_revision.h>
#include <Catalog.h>
@@ -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,