From b198a5f210fb0253e5a80276d2e94564a5cfc177 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Thu, 22 Jul 2010 13:16:33 +0000 Subject: [PATCH] * Fix unpractical translation string in AboutSystem. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37693 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/aboutsystem/AboutSystem.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/apps/aboutsystem/AboutSystem.cpp b/src/apps/aboutsystem/AboutSystem.cpp index f7a8e2e112..0d55ab1ef9 100644 --- a/src/apps/aboutsystem/AboutSystem.cpp +++ b/src/apps/aboutsystem/AboutSystem.cpp @@ -1691,9 +1691,16 @@ MemSizeToString(char string[], size_t size, system_info* info) int inaccessibleMemory = int(info->ignored_pages * (B_PAGE_SIZE / 1048576.0f) + 0.5f); if (inaccessibleMemory > 0) { - snprintf(string, size, B_TRANSLATE("%d MiB total, %d MiB inaccessible"), - int((info->max_pages + info->ignored_pages) - * (B_PAGE_SIZE / 1048576.0f) + 0.5f), inaccessibleMemory); + BString message(B_TRANSLATE("%total MiB total, %inaccessible MiB " + "inacessible")); + + snprintf(string, size, "%d", int((info->max_pages + + info->ignored_pages) * (B_PAGE_SIZE / 1048576.0f) + 0.5f)); + message.ReplaceFirst("%total", string); + + snprintf(string, size, "%d", inaccessibleMemory); + message.ReplaceFirst("%inaccessible", string); + strncpy(string, message.String(), size); } else { snprintf(string, size, B_TRANSLATE("%d MiB total"), int(info->max_pages * (B_PAGE_SIZE / 1048576.0f) + 0.5f)); @@ -1721,7 +1728,7 @@ UptimeToString(char string[], size_t size) BString str; formatter.Format(system_time() / 1000000, &str); - str.CopyInto(string,0,size); + str.CopyInto(string, 0, size); string[str.Length()] = '\0'; return string;