Made localizable attribute control's label formatting.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40404 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Philippe Houdoin 2011-02-09 11:28:56 +00:00
parent 46af96832f
commit 78a471321c
2 changed files with 13 additions and 6 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright 2005-2010, Haiku, Inc. All rights reserved.
* Copyright 2005-2011, Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT license.
*
* Authors:
@ -14,7 +14,13 @@
#include <string.h>
#include <malloc.h>
#include <Font.h>
#include <Catalog.h>
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "People"
AttributeTextControl::AttributeTextControl(const char* label,
@ -25,7 +31,8 @@ AttributeTextControl::AttributeTextControl(const char* label,
fOriginalValue()
{
if (label != NULL && label[0] != 0)
SetLabel(BString(label).Append(":"));
SetLabel(BString(B_TRANSLATE("%attribute_label:"))
.ReplaceFirst("%attribute_label", label));
SetAlignment(B_ALIGN_RIGHT, B_ALIGN_LEFT);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2005-2010, Haiku, Inc. All rights reserved.
* Copyright 2005-2011, Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT license.
*
* Authors:
@ -8,8 +8,8 @@
* Copyright 1999, Be Incorporated. All Rights Reserved.
* This file may be used under the terms of the Be Sample Code License.
*/
#ifndef TEXT_CONTROL_H
#define TEXT_CONTROL_H
#ifndef ATTRIBUTE_TEXT_CONTROL_H
#define ATTRIBUTE_TEXT_CONTROL_H
#include <String.h>
#include <TextControl.h>
@ -33,4 +33,4 @@ private:
BString fOriginalValue;
};
#endif // TEXT_CONTROL_H
#endif // ATTRIBUTE_TEXT_CONTROL_H