Skip to content

Commit

Permalink
Localize Kernel build date/time. Fixes #9230.
Browse files Browse the repository at this point in the history
This task was completed during GCI 2012

Signed-off-by: Siarzhuk Zharski <zharik@gmx.li>
  • Loading branch information
przemub authored and siarzhuk committed Dec 2, 2012
1 parent 64e07c0 commit 2b754fc
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions 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:
Expand Down Expand Up @@ -46,6 +46,7 @@
#include <AppMisc.h>
#include <AutoDeleter.h>
#include <cpu_type.h>
#include <parsedate.h>
#include <system_revision.h>

#include <Catalog.h>
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 2b754fc

Please sign in to comment.