Updated to use B_TRANSLATE* macros. relates to #5408.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36684 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Matt Madia
2010-05-06 23:40:10 +00:00
parent 05f7d43e06
commit b1c66135aa
11 changed files with 313 additions and 276 deletions
@@ -240,7 +240,7 @@ ApplicationTypeWindow::ApplicationTypeWindow(BPoint position,
const BEntry& entry) const BEntry& entry)
: :
BWindow(BRect(0.0f, 0.0f, 250.0f, 340.0f).OffsetBySelf(position), BWindow(BRect(0.0f, 0.0f, 250.0f, 340.0f).OffsetBySelf(position),
TR("Application type"), B_TITLED_WINDOW, B_TRANSLATE("Application type"), B_TITLED_WINDOW,
B_NOT_ZOOMABLE | B_ASYNCHRONOUS_CONTROLS | B_NOT_ZOOMABLE | B_ASYNCHRONOUS_CONTROLS |
B_FRAME_EVENTS | B_AUTO_UPDATE_SIZE_LIMITS), B_FRAME_EVENTS | B_AUTO_UPDATE_SIZE_LIMITS),
fChangedProperties(0) fChangedProperties(0)
@@ -256,24 +256,25 @@ ApplicationTypeWindow::ApplicationTypeWindow(BPoint position,
BMenuBar* menuBar = new BMenuBar((char*)NULL); BMenuBar* menuBar = new BMenuBar((char*)NULL);
menuBar->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT, B_ALIGN_TOP)); menuBar->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT, B_ALIGN_TOP));
BMenu* menu = new BMenu(TR("File")); BMenu* menu = new BMenu(B_TRANSLATE("File"));
fSaveMenuItem = new BMenuItem(TR("Save"), new BMessage(kMsgSave), 'S'); fSaveMenuItem = new BMenuItem(B_TRANSLATE("Save"),
new BMessage(kMsgSave), 'S');
fSaveMenuItem->SetEnabled(false); fSaveMenuItem->SetEnabled(false);
menu->AddItem(fSaveMenuItem); menu->AddItem(fSaveMenuItem);
BMenuItem* item; BMenuItem* item;
menu->AddItem(item = new BMenuItem( menu->AddItem(item = new BMenuItem(
TR("Save into resource file" B_UTF8_ELLIPSIS), NULL)); B_TRANSLATE("Save into resource file" B_UTF8_ELLIPSIS), NULL));
item->SetEnabled(false); item->SetEnabled(false);
menu->AddSeparatorItem(); menu->AddSeparatorItem();
menu->AddItem(new BMenuItem(TR("Close"), new BMessage(B_QUIT_REQUESTED), menu->AddItem(new BMenuItem(B_TRANSLATE("Close"),
'W', B_COMMAND_KEY)); new BMessage(B_QUIT_REQUESTED), 'W', B_COMMAND_KEY));
menuBar->AddItem(menu); menuBar->AddItem(menu);
// Signature // Signature
fSignatureControl = new BTextControl(TR("Signature:"), NULL, fSignatureControl = new BTextControl(B_TRANSLATE("Signature:"), NULL,
new BMessage(kMsgSignatureChanged)); new BMessage(kMsgSignatureChanged));
fSignatureControl->SetModificationMessage( fSignatureControl->SetModificationMessage(
new BMessage(kMsgSignatureChanged)); new BMessage(kMsgSignatureChanged));
@@ -290,24 +291,24 @@ ApplicationTypeWindow::ApplicationTypeWindow(BPoint position,
BBox* flagsBox = new BBox("flagsBox"); BBox* flagsBox = new BBox("flagsBox");
fFlagsCheckBox = new BCheckBox("flags", TR("Application flags"), fFlagsCheckBox = new BCheckBox("flags", B_TRANSLATE("Application flags"),
new BMessage(kMsgToggleAppFlags)); new BMessage(kMsgToggleAppFlags));
fFlagsCheckBox->SetValue(B_CONTROL_ON); fFlagsCheckBox->SetValue(B_CONTROL_ON);
fSingleLaunchButton = new BRadioButton("single", TR("Single launch"), fSingleLaunchButton = new BRadioButton("single",
new BMessage(kMsgAppFlagsChanged)); B_TRANSLATE("Single launch"), new BMessage(kMsgAppFlagsChanged));
fMultipleLaunchButton = new BRadioButton("multiple", fMultipleLaunchButton = new BRadioButton("multiple",
TR("Multiple launch"), new BMessage(kMsgAppFlagsChanged)); B_TRANSLATE("Multiple launch"), new BMessage(kMsgAppFlagsChanged));
fExclusiveLaunchButton = new BRadioButton("exclusive", fExclusiveLaunchButton = new BRadioButton("exclusive",
TR("Exclusive launch"), new BMessage(kMsgAppFlagsChanged)); B_TRANSLATE("Exclusive launch"), new BMessage(kMsgAppFlagsChanged));
fArgsOnlyCheckBox = new BCheckBox("args only", TR("Args only"), fArgsOnlyCheckBox = new BCheckBox("args only", B_TRANSLATE("Args only"),
new BMessage(kMsgAppFlagsChanged)); new BMessage(kMsgAppFlagsChanged));
fBackgroundAppCheckBox = new BCheckBox("background", fBackgroundAppCheckBox = new BCheckBox("background",
TR("Background app"), new BMessage(kMsgAppFlagsChanged)); B_TRANSLATE("Background app"), new BMessage(kMsgAppFlagsChanged));
flagsBox->AddChild(BGridLayoutBuilder(padding, padding) flagsBox->AddChild(BGridLayoutBuilder(padding, padding)
.Add(fSingleLaunchButton, 0, 0).Add(fArgsOnlyCheckBox, 1, 0) .Add(fSingleLaunchButton, 0, 0).Add(fArgsOnlyCheckBox, 1, 0)
@@ -319,7 +320,7 @@ ApplicationTypeWindow::ApplicationTypeWindow(BPoint position,
// "Icon" group // "Icon" group
BBox* iconBox = new BBox("IconBox"); BBox* iconBox = new BBox("IconBox");
iconBox->SetLabel(TR("Icon")); iconBox->SetLabel(B_TRANSLATE("Icon"));
fIconView = new IconView("icon"); fIconView = new IconView("icon");
fIconView->SetModificationMessage(new BMessage(kMsgIconChanged)); fIconView->SetModificationMessage(new BMessage(kMsgIconChanged));
iconBox->AddChild( iconBox->AddChild(
@@ -331,7 +332,7 @@ ApplicationTypeWindow::ApplicationTypeWindow(BPoint position,
// "Supported Types" group // "Supported Types" group
BBox* typeBox = new BBox("typesBox"); BBox* typeBox = new BBox("typesBox");
typeBox->SetLabel(TR("Supported types")); typeBox->SetLabel(B_TRANSLATE("Supported types"));
fTypeListView = new SupportedTypeListView("Suppported Types", fTypeListView = new SupportedTypeListView("Suppported Types",
B_SINGLE_SELECTION_LIST); B_SINGLE_SELECTION_LIST);
@@ -340,10 +341,10 @@ ApplicationTypeWindow::ApplicationTypeWindow(BPoint position,
BScrollView* scrollView = new BScrollView("type scrollview", fTypeListView, BScrollView* scrollView = new BScrollView("type scrollview", fTypeListView,
B_FRAME_EVENTS | B_WILL_DRAW, false, true); B_FRAME_EVENTS | B_WILL_DRAW, false, true);
fAddTypeButton = new BButton("add type", TR("Add" B_UTF8_ELLIPSIS), fAddTypeButton = new BButton("add type",
new BMessage(kMsgAddType)); B_TRANSLATE("Add" B_UTF8_ELLIPSIS), new BMessage(kMsgAddType));
fRemoveTypeButton = new BButton("remove type", TR("Remove"), fRemoveTypeButton = new BButton("remove type", B_TRANSLATE("Remove"),
new BMessage(kMsgRemoveType)); new BMessage(kMsgRemoveType));
fTypeIconView = new IconView("type icon"); fTypeIconView = new IconView("type icon");
@@ -365,9 +366,10 @@ ApplicationTypeWindow::ApplicationTypeWindow(BPoint position,
// "Version Info" group // "Version Info" group
BBox* versionBox = new BBox("versionBox"); BBox* versionBox = new BBox("versionBox");
versionBox->SetLabel(TR("Version info")); versionBox->SetLabel(B_TRANSLATE("Version info"));
fMajorVersionControl = new BTextControl(TR("Version:"), NULL, NULL); fMajorVersionControl = new BTextControl(B_TRANSLATE("Version:"),
NULL, NULL);
_MakeNumberTextControl(fMajorVersionControl); _MakeNumberTextControl(fMajorVersionControl);
fMiddleVersionControl = new BTextControl(".", NULL, NULL); fMiddleVersionControl = new BTextControl(".", NULL, NULL);
@@ -377,26 +379,27 @@ ApplicationTypeWindow::ApplicationTypeWindow(BPoint position,
_MakeNumberTextControl(fMinorVersionControl); _MakeNumberTextControl(fMinorVersionControl);
fVarietyMenu = new BPopUpMenu("variety", true, true); fVarietyMenu = new BPopUpMenu("variety", true, true);
fVarietyMenu->AddItem(new BMenuItem(TR("Development"), NULL)); fVarietyMenu->AddItem(new BMenuItem(B_TRANSLATE("Development"), NULL));
fVarietyMenu->AddItem(new BMenuItem(TR("Alpha"), NULL)); fVarietyMenu->AddItem(new BMenuItem(B_TRANSLATE("Alpha"), NULL));
fVarietyMenu->AddItem(new BMenuItem(TR("Beta"), NULL)); fVarietyMenu->AddItem(new BMenuItem(B_TRANSLATE("Beta"), NULL));
fVarietyMenu->AddItem(new BMenuItem(TR("Gamma"), NULL)); fVarietyMenu->AddItem(new BMenuItem(B_TRANSLATE("Gamma"), NULL));
item = new BMenuItem(TR("Golden master"), NULL); item = new BMenuItem(B_TRANSLATE("Golden master"), NULL);
fVarietyMenu->AddItem(item); fVarietyMenu->AddItem(item);
item->SetMarked(true); item->SetMarked(true);
fVarietyMenu->AddItem(new BMenuItem(TR("Final"), NULL)); fVarietyMenu->AddItem(new BMenuItem(B_TRANSLATE("Final"), NULL));
BMenuField* varietyField = new BMenuField("", fVarietyMenu); BMenuField* varietyField = new BMenuField("", fVarietyMenu);
fInternalVersionControl = new BTextControl("/", NULL, NULL); fInternalVersionControl = new BTextControl("/", NULL, NULL);
fShortDescriptionControl = fShortDescriptionControl =
new BTextControl(TR("Short description:"), NULL, NULL); new BTextControl(B_TRANSLATE("Short description:"), NULL, NULL);
// TODO: workaround for a GCC 4.1.0 bug? Or is that really what the standard says? // TODO: workaround for a GCC 4.1.0 bug? Or is that really what the standard says?
version_info versionInfo; version_info versionInfo;
fShortDescriptionControl->TextView()->SetMaxBytes( fShortDescriptionControl->TextView()->SetMaxBytes(
sizeof(versionInfo.short_info)); sizeof(versionInfo.short_info));
BStringView* longLabel = new BStringView(NULL, TR("Long description:")); BStringView* longLabel = new BStringView(NULL,
B_TRANSLATE("Long description:"));
longLabel->SetExplicitAlignment(labelAlignment); longLabel->SetExplicitAlignment(labelAlignment);
fLongDescriptionView = new TabFilteringTextView("long desc"); fLongDescriptionView = new TabFilteringTextView("long desc");
fLongDescriptionView->SetMaxBytes(sizeof(versionInfo.long_info)); fLongDescriptionView->SetMaxBytes(sizeof(versionInfo.long_info));
@@ -979,9 +982,10 @@ bool
ApplicationTypeWindow::QuitRequested() ApplicationTypeWindow::QuitRequested()
{ {
if (_NeedsSaving(CHECK_ALL) != 0) { if (_NeedsSaving(CHECK_ALL) != 0) {
BAlert* alert = new BAlert(TR("Save request"), TR("Do you want to " BAlert* alert = new BAlert(B_TRANSLATE("Save request"),
"save the changes?"), TR("Quit, don't save"), TR("Cancel"), B_TRANSLATE("Do you want to save the changes?"),
TR("Save"), B_WIDTH_AS_USUAL, B_WARNING_ALERT); B_TRANSLATE("Quit, don't save"), B_TRANSLATE("Cancel"),
B_TRANSLATE("Save"), B_WIDTH_AS_USUAL, B_WARNING_ALERT);
int32 choice = alert->Go(); int32 choice = alert->Go();
switch (choice) { switch (choice) {
case 0: case 0:
@@ -77,17 +77,17 @@ variety_to_text(uint32 variety)
switch (variety) { switch (variety) {
case B_DEVELOPMENT_VERSION: case B_DEVELOPMENT_VERSION:
return TR("Development"); return B_TRANSLATE("Development");
case B_ALPHA_VERSION: case B_ALPHA_VERSION:
return TR("Alpha"); return B_TRANSLATE("Alpha");
case B_BETA_VERSION: case B_BETA_VERSION:
return TR("Beta"); return B_TRANSLATE("Beta");
case B_GAMMA_VERSION: case B_GAMMA_VERSION:
return TR("Gamma"); return B_TRANSLATE("Gamma");
case B_GOLDEN_MASTER_VERSION: case B_GOLDEN_MASTER_VERSION:
return TR("Golden master"); return B_TRANSLATE("Golden master");
case B_FINAL_VERSION: case B_FINAL_VERSION:
return TR("Final"); return B_TRANSLATE("Final");
} }
return "-"; return "-";
@@ -100,7 +100,7 @@ variety_to_text(uint32 variety)
ProgressWindow::ProgressWindow(const char* message, ProgressWindow::ProgressWindow(const char* message,
int32 max, volatile bool* signalQuit) int32 max, volatile bool* signalQuit)
: :
BWindow(BRect(0, 0, 300, 200), TR("Progress"), B_MODAL_WINDOW_LOOK, BWindow(BRect(0, 0, 300, 200), B_TRANSLATE("Progress"), B_MODAL_WINDOW_LOOK,
B_MODAL_SUBSET_WINDOW_FEEL, B_ASYNCHRONOUS_CONTROLS | B_MODAL_SUBSET_WINDOW_FEEL, B_ASYNCHRONOUS_CONTROLS |
B_NOT_V_RESIZABLE | B_AUTO_UPDATE_SIZE_LIMITS), B_NOT_V_RESIZABLE | B_AUTO_UPDATE_SIZE_LIMITS),
fQuitListener(signalQuit) fQuitListener(signalQuit)
@@ -110,7 +110,8 @@ ProgressWindow::ProgressWindow(const char* message,
fStatusBar = new BStatusBar("status", message, count); fStatusBar = new BStatusBar("status", message, count);
fStatusBar->SetMaxValue(max); fStatusBar->SetMaxValue(max);
fAbortButton = new BButton("abort", TR("Abort"), new BMessage(B_CANCEL)); fAbortButton = new BButton("abort", B_TRANSLATE("Abort"),
new BMessage(B_CANCEL));
SetLayout(new BGroupLayout(B_VERTICAL)); SetLayout(new BGroupLayout(B_VERTICAL));
AddChild(BGroupLayoutBuilder(B_VERTICAL, 3.0f) AddChild(BGroupLayoutBuilder(B_VERTICAL, 3.0f)
@@ -161,7 +162,8 @@ ProgressWindow::MessageReceived(BMessage* message)
ApplicationTypesWindow::ApplicationTypesWindow(const BMessage& settings) ApplicationTypesWindow::ApplicationTypesWindow(const BMessage& settings)
: BWindow(_Frame(settings), TR("Application types"), B_TITLED_WINDOW, : BWindow(_Frame(settings), B_TRANSLATE("Application types"),
B_TITLED_WINDOW,
B_NOT_ZOOMABLE | B_ASYNCHRONOUS_CONTROLS | B_AUTO_UPDATE_SIZE_LIMITS) B_NOT_ZOOMABLE | B_ASYNCHRONOUS_CONTROLS | B_AUTO_UPDATE_SIZE_LIMITS)
{ {
@@ -185,7 +187,7 @@ ApplicationTypesWindow::ApplicationTypesWindow(const BMessage& settings)
BScrollView* scrollView = new BScrollView("scrollview", fTypeListView, BScrollView* scrollView = new BScrollView("scrollview", fTypeListView,
B_FRAME_EVENTS | B_WILL_DRAW, false, true); B_FRAME_EVENTS | B_WILL_DRAW, false, true);
BButton* button = new BButton("remove", TR("Remove uninstalled"), BButton* button = new BButton("remove", B_TRANSLATE("Remove uninstalled"),
new BMessage(kMsgRemoveUninstalled)); new BMessage(kMsgRemoveUninstalled));
SetLayout(BGroupLayoutBuilder(B_HORIZONTAL)); SetLayout(BGroupLayoutBuilder(B_HORIZONTAL));
@@ -193,16 +195,16 @@ ApplicationTypesWindow::ApplicationTypesWindow(const BMessage& settings)
// "Information" group // "Information" group
BBox* infoBox = new BBox((char*)NULL); BBox* infoBox = new BBox((char*)NULL);
infoBox->SetLabel(TR("Information")); infoBox->SetLabel(B_TRANSLATE("Information"));
infoBox->SetExplicitAlignment(fullWidthTopAlignment); infoBox->SetExplicitAlignment(fullWidthTopAlignment);
fNameView = new StringView(TR("Name:"), NULL); fNameView = new StringView(B_TRANSLATE("Name:"), NULL);
fNameView->TextView()->SetExplicitAlignment(labelAlignment); fNameView->TextView()->SetExplicitAlignment(labelAlignment);
fNameView->LabelView()->SetExplicitAlignment(labelAlignment); fNameView->LabelView()->SetExplicitAlignment(labelAlignment);
fSignatureView = new StringView(TR("Signature:"), NULL); fSignatureView = new StringView(B_TRANSLATE("Signature:"), NULL);
fSignatureView->TextView()->SetExplicitAlignment(labelAlignment); fSignatureView->TextView()->SetExplicitAlignment(labelAlignment);
fSignatureView->LabelView()->SetExplicitAlignment(labelAlignment); fSignatureView->LabelView()->SetExplicitAlignment(labelAlignment);
fPathView = new StringView(TR("Path:"), NULL); fPathView = new StringView(B_TRANSLATE("Path:"), NULL);
fPathView->TextView()->SetExplicitAlignment(labelAlignment); fPathView->TextView()->SetExplicitAlignment(labelAlignment);
fPathView->LabelView()->SetExplicitAlignment(labelAlignment); fPathView->LabelView()->SetExplicitAlignment(labelAlignment);
@@ -220,13 +222,13 @@ ApplicationTypesWindow::ApplicationTypesWindow(const BMessage& settings)
// "Version" group // "Version" group
BBox* versionBox = new BBox(""); BBox* versionBox = new BBox("");
versionBox->SetLabel(TR("Version")); versionBox->SetLabel(B_TRANSLATE("Version"));
versionBox->SetExplicitAlignment(fullWidthTopAlignment); versionBox->SetExplicitAlignment(fullWidthTopAlignment);
fVersionView = new StringView(TR("Version:"), NULL); fVersionView = new StringView(B_TRANSLATE("Version:"), NULL);
fVersionView->TextView()->SetExplicitAlignment(labelAlignment); fVersionView->TextView()->SetExplicitAlignment(labelAlignment);
fVersionView->LabelView()->SetExplicitAlignment(labelAlignment); fVersionView->LabelView()->SetExplicitAlignment(labelAlignment);
fDescriptionLabel = new StringView(TR("Description:"), NULL); fDescriptionLabel = new StringView(B_TRANSLATE("Description:"), NULL);
fDescriptionLabel->LabelView()->SetExplicitAlignment(labelAlignment); fDescriptionLabel->LabelView()->SetExplicitAlignment(labelAlignment);
fDescriptionView = new BTextView("description"); fDescriptionView = new BTextView("description");
fDescriptionView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); fDescriptionView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
@@ -245,10 +247,12 @@ ApplicationTypesWindow::ApplicationTypesWindow(const BMessage& settings)
// Launch and Tracker buttons // Launch and Tracker buttons
fEditButton = new BButton(TR("Edit" B_UTF8_ELLIPSIS), new BMessage(kMsgEdit)); fEditButton = new BButton(B_TRANSLATE("Edit" B_UTF8_ELLIPSIS),
new BMessage(kMsgEdit));
// launch and tracker buttons get messages in _SetType() // launch and tracker buttons get messages in _SetType()
fLaunchButton = new BButton(TR("Launch")); fLaunchButton = new BButton(B_TRANSLATE("Launch"));
fTrackerButton = new BButton(TR("Show in Tracker" B_UTF8_ELLIPSIS)); fTrackerButton = new BButton(
B_TRANSLATE("Show in Tracker" B_UTF8_ELLIPSIS));
AddChild(BGroupLayoutBuilder(B_HORIZONTAL, padding) AddChild(BGroupLayoutBuilder(B_HORIZONTAL, padding)
.Add(BGroupLayoutBuilder(B_VERTICAL, padding) .Add(BGroupLayoutBuilder(B_VERTICAL, padding)
@@ -301,7 +305,8 @@ ApplicationTypesWindow::_RemoveUninstalled()
volatile bool quit = false; volatile bool quit = false;
BWindow* progressWindow = BWindow* progressWindow =
new ProgressWindow(TR("Removing uninstalled application types"), new ProgressWindow(
B_TRANSLATE("Removing uninstalled application types"),
fTypeListView->FullListCountItems(), &quit); fTypeListView->FullListCountItems(), &quit);
progressWindow->AddToSubset(this); progressWindow->AddToSubset(this);
progressWindow->Show(); progressWindow->Show();
@@ -356,8 +361,9 @@ ApplicationTypesWindow::_RemoveUninstalled()
char message[512]; char message[512];
// TODO: Use ICU to properly format this. // TODO: Use ICU to properly format this.
snprintf(message, sizeof(message), TR("%ld Application type%s could be " snprintf(message, sizeof(message),
"removed."), removed, removed == 1 ? "" : "s"); B_TRANSLATE("%ld Application type%s could be removed."),
removed, removed == 1 ? "" : "s");
error_alert(message, B_OK, B_INFO_ALERT); error_alert(message, B_OK, B_INFO_ALERT);
} }
+28 -24
View File
@@ -96,9 +96,9 @@ display_as_parameter(const char* special)
AttributeWindow::AttributeWindow(FileTypesWindow* target, BMimeType& mimeType, AttributeWindow::AttributeWindow(FileTypesWindow* target, BMimeType& mimeType,
AttributeItem* attributeItem) AttributeItem* attributeItem)
: :
BWindow(BRect(100, 100, 350, 200), TR("Attribute"), B_MODAL_WINDOW_LOOK, BWindow(BRect(100, 100, 350, 200), B_TRANSLATE("Attribute"),
B_MODAL_SUBSET_WINDOW_FEEL, B_NOT_ZOOMABLE | B_AUTO_UPDATE_SIZE_LIMITS B_MODAL_WINDOW_LOOK, B_MODAL_SUBSET_WINDOW_FEEL,
| B_ASYNCHRONOUS_CONTROLS), B_NOT_ZOOMABLE | B_AUTO_UPDATE_SIZE_LIMITS | B_ASYNCHRONOUS_CONTROLS),
fTarget(target), fTarget(target),
fMimeType(mimeType.Type()) fMimeType(mimeType.Type())
{ {
@@ -109,13 +109,13 @@ AttributeWindow::AttributeWindow(FileTypesWindow* target, BMimeType& mimeType,
if (attributeItem != NULL) if (attributeItem != NULL)
fAttribute = *attributeItem; fAttribute = *attributeItem;
fPublicNameControl = new BTextControl(TR("Attribute name:"), fPublicNameControl = new BTextControl(B_TRANSLATE("Attribute name:"),
fAttribute.PublicName(), NULL); fAttribute.PublicName(), NULL);
fPublicNameControl->SetModificationMessage( fPublicNameControl->SetModificationMessage(
new BMessage(kMsgAttributeUpdated)); new BMessage(kMsgAttributeUpdated));
fPublicNameControl->SetAlignment(B_ALIGN_RIGHT, B_ALIGN_LEFT); fPublicNameControl->SetAlignment(B_ALIGN_RIGHT, B_ALIGN_LEFT);
fAttributeControl = new BTextControl(TR("Internal name:"), fAttributeControl = new BTextControl(B_TRANSLATE("Internal name:"),
fAttribute.Name(), NULL); fAttribute.Name(), NULL);
fAttributeControl->SetModificationMessage( fAttributeControl->SetModificationMessage(
new BMessage(kMsgAttributeUpdated)); new BMessage(kMsgAttributeUpdated));
@@ -141,11 +141,11 @@ AttributeWindow::AttributeWindow(FileTypesWindow* target, BMimeType& mimeType,
item->SetMarked(true); item->SetMarked(true);
} }
BMenuField* typeMenuField = new BMenuField("types" , TR("Type:"), BMenuField* typeMenuField = new BMenuField("types" , B_TRANSLATE("Type:"),
fTypeMenu); fTypeMenu);
typeMenuField->SetAlignment(B_ALIGN_RIGHT); typeMenuField->SetAlignment(B_ALIGN_RIGHT);
fVisibleCheckBox = new BCheckBox("visible", TR("Visible"), fVisibleCheckBox = new BCheckBox("visible", B_TRANSLATE("Visible"),
new BMessage(kMsgVisibilityChanged)); new BMessage(kMsgVisibilityChanged));
fVisibleCheckBox->SetValue(fAttribute.Visible()); fVisibleCheckBox->SetValue(fAttribute.Visible());
@@ -167,16 +167,17 @@ AttributeWindow::AttributeWindow(FileTypesWindow* target, BMimeType& mimeType,
} }
fDisplayAsMenuField = new BMenuField("display as", fDisplayAsMenuField = new BMenuField("display as",
TR_CMT("Display as:", "Tracker offers different display modes for " B_TRANSLATE_COMMENT("Display as:",
"attributes."), menu); "Tracker offers different display modes for attributes."), menu);
fDisplayAsMenuField->SetAlignment(B_ALIGN_RIGHT); fDisplayAsMenuField->SetAlignment(B_ALIGN_RIGHT);
fEditableCheckBox = new BCheckBox("editable", TR_CMT("Editable", fEditableCheckBox = new BCheckBox("editable",
"If Tracker allows to edit this attribute."), B_TRANSLATE_COMMENT("Editable",
"If Tracker allows to edit this attribute."),
new BMessage(kMsgAttributeUpdated)); new BMessage(kMsgAttributeUpdated));
fEditableCheckBox->SetValue(fAttribute.Editable()); fEditableCheckBox->SetValue(fAttribute.Editable());
fSpecialControl = new BTextControl(TR("Special:"), fSpecialControl = new BTextControl(B_TRANSLATE("Special:"),
display_as_parameter(fAttribute.DisplayAs()), NULL); display_as_parameter(fAttribute.DisplayAs()), NULL);
fSpecialControl->SetModificationMessage( fSpecialControl->SetModificationMessage(
new BMessage(kMsgAttributeUpdated)); new BMessage(kMsgAttributeUpdated));
@@ -185,8 +186,9 @@ AttributeWindow::AttributeWindow(FileTypesWindow* target, BMimeType& mimeType,
char text[64]; char text[64];
snprintf(text, sizeof(text), "%ld", fAttribute.Width()); snprintf(text, sizeof(text), "%ld", fAttribute.Width());
fWidthControl = new BTextControl(TR_CMT("Width:", fWidthControl = new BTextControl(B_TRANSLATE_COMMENT("Width:",
"Default column width in Tracker for this attribute."), text, NULL); "Default column width in Tracker for this attribute."),
text, NULL);
fWidthControl->SetModificationMessage( fWidthControl->SetModificationMessage(
new BMessage(kMsgAttributeUpdated)); new BMessage(kMsgAttributeUpdated));
fWidthControl->SetAlignment(B_ALIGN_RIGHT, B_ALIGN_LEFT); fWidthControl->SetAlignment(B_ALIGN_RIGHT, B_ALIGN_LEFT);
@@ -203,12 +205,12 @@ AttributeWindow::AttributeWindow(FileTypesWindow* target, BMimeType& mimeType,
int32 alignment; int32 alignment;
const char* name; const char* name;
} kAlignmentMap[] = { } kAlignmentMap[] = {
{B_ALIGN_LEFT, TR_CMT("Left", "Attribute column alignment in " {B_ALIGN_LEFT, B_TRANSLATE_COMMENT("Left",
"Tracker")}, "Attribute column alignment in Tracker")},
{B_ALIGN_RIGHT, TR_CMT("Right", "Attribute column alignment in " {B_ALIGN_RIGHT, B_TRANSLATE_COMMENT("Right",
"Tracker")}, "Attribute column alignment in Tracker")},
{B_ALIGN_CENTER, TR_CMT("Center", "Attribute column alignment in " {B_ALIGN_CENTER, B_TRANSLATE_COMMENT("Center",
"Tracker")}, "Attribute column alignment in Tracker")},
{0, NULL} {0, NULL}
}; };
@@ -225,14 +227,15 @@ AttributeWindow::AttributeWindow(FileTypesWindow* target, BMimeType& mimeType,
} }
fAlignmentMenuField = new BMenuField("alignment", fAlignmentMenuField = new BMenuField("alignment",
TR("Alignment:"), menu); B_TRANSLATE("Alignment:"), menu);
fAlignmentMenuField->SetAlignment(B_ALIGN_RIGHT); fAlignmentMenuField->SetAlignment(B_ALIGN_RIGHT);
fAcceptButton = new BButton("add", item ? TR("Done") : TR("Add"), fAcceptButton = new BButton("add", item
? B_TRANSLATE("Done") : B_TRANSLATE("Add"),
new BMessage(kMsgAccept)); new BMessage(kMsgAccept));
fAcceptButton->SetEnabled(false); fAcceptButton->SetEnabled(false);
BButton* cancelButton = new BButton("cancel", TR("Cancel"), BButton* cancelButton = new BButton("cancel", B_TRANSLATE("Cancel"),
new BMessage(B_QUIT_REQUESTED)); new BMessage(B_QUIT_REQUESTED));
BBox* visibleBox; BBox* visibleBox;
@@ -475,7 +478,8 @@ AttributeWindow::MessageReceived(BMessage* message)
} }
if (status != B_OK) if (status != B_OK)
error_alert(TR("Could not change attributes"), status); error_alert(B_TRANSLATE("Could not change attributes"),
status);
PostMessage(B_QUIT_REQUESTED); PostMessage(B_QUIT_REQUESTED);
break; break;
+10 -6
View File
@@ -112,8 +112,9 @@ replace_extension(BMimeType& type, const char* newExtension,
ExtensionWindow::ExtensionWindow(FileTypesWindow* target, BMimeType& type, ExtensionWindow::ExtensionWindow(FileTypesWindow* target, BMimeType& type,
const char* extension) const char* extension)
: BWindow(BRect(100, 100, 350, 200), TR("Extension"), B_MODAL_WINDOW_LOOK, : BWindow(BRect(100, 100, 350, 200), B_TRANSLATE("Extension"),
B_MODAL_SUBSET_WINDOW_FEEL, B_NOT_ZOOMABLE | B_NOT_RESIZABLE B_MODAL_WINDOW_LOOK, B_MODAL_SUBSET_WINDOW_FEEL,
B_NOT_ZOOMABLE | B_NOT_RESIZABLE
| B_ASYNCHRONOUS_CONTROLS | B_AUTO_UPDATE_SIZE_LIMITS), | B_ASYNCHRONOUS_CONTROLS | B_AUTO_UPDATE_SIZE_LIMITS),
fTarget(target), fTarget(target),
fMimeType(type.Type()), fMimeType(type.Type()),
@@ -126,7 +127,8 @@ ExtensionWindow::ExtensionWindow(FileTypesWindow* target, BMimeType& type,
// padding = be_control_look->DefaultItemSpacing(); // padding = be_control_look->DefaultItemSpacing();
// this seems to be very large! // this seems to be very large!
fExtensionControl = new BTextControl(TR("Extension:"), extension, NULL); fExtensionControl = new BTextControl(B_TRANSLATE("Extension:"),
extension, NULL);
fExtensionControl->SetModificationMessage( fExtensionControl->SetModificationMessage(
new BMessage(kMsgExtensionUpdated)); new BMessage(kMsgExtensionUpdated));
fExtensionControl->SetAlignment(B_ALIGN_LEFT, B_ALIGN_LEFT); fExtensionControl->SetAlignment(B_ALIGN_LEFT, B_ALIGN_LEFT);
@@ -138,11 +140,12 @@ ExtensionWindow::ExtensionWindow(FileTypesWindow* target, BMimeType& type,
textView->DisallowChar(disallowedCharacters[i]); textView->DisallowChar(disallowedCharacters[i]);
} }
fAcceptButton = new BButton(extension ? TR("Done") : TR("Add"), fAcceptButton = new BButton(extension
? B_TRANSLATE("Done") : B_TRANSLATE("Add"),
new BMessage(kMsgAccept)); new BMessage(kMsgAccept));
fAcceptButton->SetEnabled(false); fAcceptButton->SetEnabled(false);
BButton* button = new BButton(TR("Cancel"), BButton* button = new BButton(B_TRANSLATE("Cancel"),
new BMessage(B_QUIT_REQUESTED)); new BMessage(B_QUIT_REQUESTED));
AddChild(BGridLayoutBuilder(padding, padding) AddChild(BGridLayoutBuilder(padding, padding)
@@ -199,7 +202,8 @@ ExtensionWindow::MessageReceived(BMessage* message)
status_t status = replace_extension(fMimeType, newExtension, status_t status = replace_extension(fMimeType, newExtension,
fExtension.String()); fExtension.String());
if (status != B_OK) if (status != B_OK)
error_alert(TR("Could not change file extensions"), status); error_alert(B_TRANSLATE("Could not change file extensions"),
status);
PostMessage(B_QUIT_REQUESTED); PostMessage(B_QUIT_REQUESTED);
break; break;
+21 -18
View File
@@ -51,9 +51,9 @@ const uint32 kMsgSamePreferredAppAsOpened = 'spaO';
FileTypeWindow::FileTypeWindow(BPoint position, const BMessage& refs) FileTypeWindow::FileTypeWindow(BPoint position, const BMessage& refs)
: :
BWindow(BRect(0.0f, 0.0f, 200.0f, 200.0f).OffsetBySelf(position), BWindow(BRect(0.0f, 0.0f, 200.0f, 200.0f).OffsetBySelf(position),
TR("File type"), B_TITLED_WINDOW, B_TRANSLATE("File type"), B_TITLED_WINDOW,
B_NOT_V_RESIZABLE | B_NOT_ZOOMABLE | B_NOT_V_RESIZABLE | B_NOT_ZOOMABLE
B_ASYNCHRONOUS_CONTROLS | B_AUTO_UPDATE_SIZE_LIMITS) | B_ASYNCHRONOUS_CONTROLS | B_AUTO_UPDATE_SIZE_LIMITS)
{ {
float padding = 3.0f; float padding = 3.0f;
// if (be_control_look) // if (be_control_look)
@@ -62,7 +62,7 @@ FileTypeWindow::FileTypeWindow(BPoint position, const BMessage& refs)
// "File Type" group // "File Type" group
BBox* fileTypeBox = new BBox("file type BBox"); BBox* fileTypeBox = new BBox("file type BBox");
fileTypeBox->SetLabel(TR("File type")); fileTypeBox->SetLabel(B_TRANSLATE("File type"));
fTypeControl = new BTextControl("type", NULL, "Type Control", fTypeControl = new BTextControl("type", NULL, "Type Control",
new BMessage(kMsgTypeEntered)); new BMessage(kMsgTypeEntered));
@@ -75,10 +75,10 @@ FileTypeWindow::FileTypeWindow(BPoint position, const BMessage& refs)
} }
fSelectTypeButton = new BButton("select type", fSelectTypeButton = new BButton("select type",
TR("Select" B_UTF8_ELLIPSIS), new BMessage(kMsgSelectType)); B_TRANSLATE("Select" B_UTF8_ELLIPSIS), new BMessage(kMsgSelectType));
fSameTypeAsButton = new BButton("same type as", fSameTypeAsButton = new BButton("same type as",
TR("Same as" B_UTF8_ELLIPSIS), new BMessage(kMsgSameTypeAs)); B_TRANSLATE("Same as" B_UTF8_ELLIPSIS), new BMessage(kMsgSameTypeAs));
fileTypeBox->AddChild(BGridLayoutBuilder(padding, padding) fileTypeBox->AddChild(BGridLayoutBuilder(padding, padding)
.Add(fTypeControl, 0, 0, 2, 1) .Add(fTypeControl, 0, 0, 2, 1)
@@ -90,7 +90,7 @@ FileTypeWindow::FileTypeWindow(BPoint position, const BMessage& refs)
// "Icon" group // "Icon" group
BBox* iconBox = new BBox("icon BBox"); BBox* iconBox = new BBox("icon BBox");
iconBox->SetLabel(TR("Icon")); iconBox->SetLabel(B_TRANSLATE("Icon"));
fIconView = new IconView("icon"); fIconView = new IconView("icon");
iconBox->AddChild(BGroupLayoutBuilder(B_HORIZONTAL) iconBox->AddChild(BGroupLayoutBuilder(B_HORIZONTAL)
.Add(fIconView) .Add(fIconView)
@@ -99,20 +99,22 @@ FileTypeWindow::FileTypeWindow(BPoint position, const BMessage& refs)
// "Preferred Application" group // "Preferred Application" group
BBox* preferredBox = new BBox("preferred BBox"); BBox* preferredBox = new BBox("preferred BBox");
preferredBox->SetLabel(TR("Preferred application")); preferredBox->SetLabel(B_TRANSLATE("Preferred application"));
BMenu* menu = new BPopUpMenu("preferred"); BMenu* menu = new BPopUpMenu("preferred");
BMenuItem* item; BMenuItem* item;
menu->AddItem(item = new BMenuItem(TR("Default application"), menu->AddItem(item = new BMenuItem(B_TRANSLATE("Default application"),
new BMessage(kMsgPreferredAppChosen))); new BMessage(kMsgPreferredAppChosen)));
item->SetMarked(true); item->SetMarked(true);
fPreferredField = new BMenuField("preferred", NULL, menu); fPreferredField = new BMenuField("preferred", NULL, menu);
fSelectAppButton = new BButton("select app", TR("Select" B_UTF8_ELLIPSIS), fSelectAppButton = new BButton("select app",
B_TRANSLATE("Select" B_UTF8_ELLIPSIS),
new BMessage(kMsgSelectPreferredApp)); new BMessage(kMsgSelectPreferredApp));
fSameAppAsButton = new BButton("same app as", TR("Same as" B_UTF8_ELLIPSIS), fSameAppAsButton = new BButton("same app as",
B_TRANSLATE("Same as" B_UTF8_ELLIPSIS),
new BMessage(kMsgSamePreferredAppAs)); new BMessage(kMsgSamePreferredAppAs));
preferredBox->AddChild(BGridLayoutBuilder(padding, padding) preferredBox->AddChild(BGridLayoutBuilder(padding, padding)
@@ -173,13 +175,13 @@ FileTypeWindow::_Title(const BMessage& refs)
if (same && parent.GetName(name) == B_OK) { if (same && parent.GetName(name) == B_OK) {
char buffer[512]; char buffer[512];
snprintf(buffer, sizeof(buffer), snprintf(buffer, sizeof(buffer),
TR("Multiple files from \"%s\" file type"), name); B_TRANSLATE("Multiple files from \"%s\" file type"), name);
title = buffer; title = buffer;
} else } else
title = TR("[Multiple files] file types"); title = B_TRANSLATE("[Multiple files] file types");
} else if (refs.FindRef("refs", 0, &ref) == B_OK) { } else if (refs.FindRef("refs", 0, &ref) == B_OK) {
char buffer[512]; char buffer[512];
snprintf(buffer, sizeof(buffer), TR("%s file type"), ref.name); snprintf(buffer, sizeof(buffer), B_TRANSLATE("%s file type"), ref.name);
title = buffer; title = buffer;
} }
@@ -265,7 +267,7 @@ FileTypeWindow::_AdoptType(BMessage* message)
} }
if (status != B_OK) { if (status != B_OK) {
error_alert(TR("Could not open file"), status); error_alert(B_TRANSLATE("Could not open file"), status);
return; return;
} }
@@ -362,7 +364,7 @@ FileTypeWindow::MessageReceived(BMessage* message)
case kMsgSameTypeAs: case kMsgSameTypeAs:
{ {
BMessage panel(kMsgOpenFilePanel); BMessage panel(kMsgOpenFilePanel);
panel.AddString("title", TR("Select same type as")); panel.AddString("title", B_TRANSLATE("Select same type as"));
panel.AddInt32("message", kMsgSameTypeAsOpened); panel.AddInt32("message", kMsgSameTypeAsOpened);
panel.AddMessenger("target", this); panel.AddMessenger("target", this);
@@ -390,7 +392,8 @@ FileTypeWindow::MessageReceived(BMessage* message)
case kMsgSelectPreferredApp: case kMsgSelectPreferredApp:
{ {
BMessage panel(kMsgOpenFilePanel); BMessage panel(kMsgOpenFilePanel);
panel.AddString("title", TR("Select preferred application")); panel.AddString("title",
B_TRANSLATE("Select preferred application"));
panel.AddInt32("message", kMsgPreferredAppOpened); panel.AddInt32("message", kMsgPreferredAppOpened);
panel.AddMessenger("target", this); panel.AddMessenger("target", this);
@@ -405,7 +408,7 @@ FileTypeWindow::MessageReceived(BMessage* message)
{ {
BMessage panel(kMsgOpenFilePanel); BMessage panel(kMsgOpenFilePanel);
panel.AddString("title", panel.AddString("title",
TR("Select same preferred application as")); B_TRANSLATE("Select same preferred application as"));
panel.AddInt32("message", kMsgSamePreferredAppAsOpened); panel.AddInt32("message", kMsgSamePreferredAppAsOpened);
panel.AddMessenger("target", this); panel.AddMessenger("target", this);
+10 -10
View File
@@ -216,12 +216,12 @@ FileTypes::RefsReceived(BMessage *message)
char buffer[1024]; char buffer[1024];
snprintf(buffer, sizeof(buffer), snprintf(buffer, sizeof(buffer),
TR("Could not open \"%s\":\n" B_TRANSLATE("Could not open \"%s\":\n"
"%s"), "%s"),
ref.name, strerror(status)); ref.name, strerror(status));
(new BAlert(TR("FileTypes request"), (new BAlert(B_TRANSLATE("FileTypes request"),
buffer, TR("OK"), NULL, NULL, buffer, B_TRANSLATE("OK"), NULL, NULL,
B_WIDTH_AS_USUAL, B_STOP_ALERT))->Go(); B_WIDTH_AS_USUAL, B_STOP_ALERT))->Go();
message->RemoveData("refs", --index); message->RemoveData("refs", --index);
@@ -356,7 +356,7 @@ FileTypes::MessageReceived(BMessage *message)
// the open file panel sends us a message when it's done // the open file panel sends us a message when it's done
const char* subTitle; const char* subTitle;
if (message->FindString("title", &subTitle) != B_OK) if (message->FindString("title", &subTitle) != B_OK)
subTitle = TR("Open file"); subTitle = B_TRANSLATE("Open file");
int32 what; int32 what;
if (message->FindInt32("message", &what) != B_OK) if (message->FindInt32("message", &what) != B_OK)
@@ -366,7 +366,7 @@ FileTypes::MessageReceived(BMessage *message)
if (message->FindMessenger("target", &target) != B_OK) if (message->FindMessenger("target", &target) != B_OK)
target = be_app_messenger; target = be_app_messenger;
BString title = TR("FileTypes"); BString title = B_TRANSLATE("FileTypes");
if (subTitle != NULL && subTitle[0]) { if (subTitle != NULL && subTitle[0]) {
title.Append(": "); title.Append(": ");
title.Append(subTitle); title.Append(subTitle);
@@ -407,12 +407,12 @@ FileTypes::MessageReceived(BMessage *message)
void void
FileTypes::AboutRequested() FileTypes::AboutRequested()
{ {
BString aboutText(TR("FileTypes")); BString aboutText(B_TRANSLATE("FileTypes"));
int32 titleLength = aboutText.Length(); int32 titleLength = aboutText.Length();
aboutText << "\n"; aboutText << "\n";
aboutText << TR("\twritten by Axel Dörfler\n" aboutText << B_TRANSLATE("\twritten by Axel Dörfler\n"
"\tCopyright 2006-2007, Haiku.\n"); "\tCopyright 2006-2007, Haiku.\n");
BAlert *alert = new BAlert("about", aboutText.String(), TR("OK")); BAlert *alert = new BAlert("about", aboutText.String(), B_TRANSLATE("OK"));
BTextView *view = alert->TextView(); BTextView *view = alert->TextView();
BFont font; BFont font;
@@ -462,9 +462,9 @@ error_alert(const char* message, status_t status, alert_type type)
strerror(status)); strerror(status));
} }
(new BAlert(TR("FileTypes request"), (new BAlert(B_TRANSLATE("FileTypes request"),
status == B_OK ? message : warning, status == B_OK ? message : warning,
TR("OK"), NULL, NULL, B_WIDTH_AS_USUAL, type))->Go(); B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL, type))->Go();
} }
+62 -54
View File
@@ -137,13 +137,13 @@ TypeIconView::Draw(BRect updateRect)
switch (IconSource()) { switch (IconSource()) {
case kNoIcon: case kNoIcon:
text = TR("no icon"); text = B_TRANSLATE("no icon");
break; break;
case kApplicationIcon: case kApplicationIcon:
text = TR("(from application)"); text = B_TRANSLATE("(from application)");
break; break;
case kSupertypeIcon: case kSupertypeIcon:
text = TR("(from super type)"); text = B_TRANSLATE("(from super type)");
break; break;
default: default:
@@ -172,8 +172,8 @@ void
TypeIconView::GetPreferredSize(float* _width, float* _height) TypeIconView::GetPreferredSize(float* _width, float* _height)
{ {
if (_width) { if (_width) {
float a = StringWidth(TR("(from application)")); float a = StringWidth(B_TRANSLATE("(from application)"));
float b = StringWidth(TR("(from super type)")); float b = StringWidth(B_TRANSLATE("(from super type)"));
float width = max_c(a, b); float width = max_c(a, b);
if (width < IconSize()) if (width < IconSize())
width = IconSize(); width = IconSize();
@@ -199,7 +199,7 @@ TypeIconView::BitmapRect() const
font_height fontHeight; font_height fontHeight;
GetFontHeight(&fontHeight); GetFontHeight(&fontHeight);
float width = StringWidth(TR("no icon")) + 8.0f; float width = StringWidth(B_TRANSLATE("no icon")) + 8.0f;
float height = ceilf(fontHeight.ascent + fontHeight.descent) + 6.0f; float height = ceilf(fontHeight.ascent + fontHeight.descent) + 6.0f;
float x = (Bounds().Width() - width) / 2.0f; float x = (Bounds().Width() - width) / 2.0f;
float y = ceilf((IconSize() - fontHeight.ascent - fontHeight.descent) float y = ceilf((IconSize() - fontHeight.ascent - fontHeight.descent)
@@ -286,7 +286,7 @@ ExtensionListView::SetType(BMimeType* type)
FileTypesWindow::FileTypesWindow(const BMessage& settings) FileTypesWindow::FileTypesWindow(const BMessage& settings)
: :
BWindow(_Frame(settings), TR("FileTypes"), B_TITLED_WINDOW, BWindow(_Frame(settings), B_TRANSLATE("FileTypes"), B_TITLED_WINDOW,
B_NOT_ZOOMABLE | B_ASYNCHRONOUS_CONTROLS | B_AUTO_UPDATE_SIZE_LIMITS), B_NOT_ZOOMABLE | B_ASYNCHRONOUS_CONTROLS | B_AUTO_UPDATE_SIZE_LIMITS),
fNewTypeWindow(NULL) fNewTypeWindow(NULL)
{ {
@@ -311,40 +311,42 @@ FileTypesWindow::FileTypesWindow(const BMessage& settings)
// add the menu // add the menu
BMenuBar* menuBar = new BMenuBar(""); BMenuBar* menuBar = new BMenuBar("");
BMenu* menu = new BMenu(TR("File")); BMenu* menu = new BMenu(B_TRANSLATE("File"));
BMenuItem* item; BMenuItem* item;
menu->AddItem(item = new BMenuItem(TR("New resource file" B_UTF8_ELLIPSIS), menu->AddItem(item = new BMenuItem(
B_TRANSLATE("New resource file" B_UTF8_ELLIPSIS),
NULL, 'N', B_COMMAND_KEY)); NULL, 'N', B_COMMAND_KEY));
item->SetEnabled(false); item->SetEnabled(false);
BMenu* recentsMenu = BRecentFilesList::NewFileListMenu( BMenu* recentsMenu = BRecentFilesList::NewFileListMenu(
TR("Open" B_UTF8_ELLIPSIS), NULL, NULL, be_app, 10, false, NULL, B_TRANSLATE("Open" B_UTF8_ELLIPSIS), NULL, NULL,
kSignature); be_app, 10, false, NULL, kSignature);
item = new BMenuItem(recentsMenu, new BMessage(kMsgOpenFilePanel)); item = new BMenuItem(recentsMenu, new BMessage(kMsgOpenFilePanel));
item->SetShortcut('O', B_COMMAND_KEY); item->SetShortcut('O', B_COMMAND_KEY);
menu->AddItem(item); menu->AddItem(item);
menu->AddItem(new BMenuItem(TR("Application types" B_UTF8_ELLIPSIS), menu->AddItem(new BMenuItem(
B_TRANSLATE("Application types" B_UTF8_ELLIPSIS),
new BMessage(kMsgOpenApplicationTypesWindow))); new BMessage(kMsgOpenApplicationTypesWindow)));
menu->AddSeparatorItem(); menu->AddSeparatorItem();
menu->AddItem(new BMenuItem(TR("About FileTypes" B_UTF8_ELLIPSIS), menu->AddItem(new BMenuItem(B_TRANSLATE("About FileTypes" B_UTF8_ELLIPSIS),
new BMessage(B_ABOUT_REQUESTED))); new BMessage(B_ABOUT_REQUESTED)));
menu->AddSeparatorItem(); menu->AddSeparatorItem();
menu->AddItem(new BMenuItem(TR("Quit"), new BMessage(B_QUIT_REQUESTED), menu->AddItem(new BMenuItem(B_TRANSLATE("Quit"),
'Q', B_COMMAND_KEY)); new BMessage(B_QUIT_REQUESTED), 'Q', B_COMMAND_KEY));
menu->SetTargetForItems(be_app); menu->SetTargetForItems(be_app);
menuBar->AddItem(menu); menuBar->AddItem(menu);
menu = new BMenu(TR("Settings")); menu = new BMenu(B_TRANSLATE("Settings"));
item = new BMenuItem(TR("Show icons in list"), item = new BMenuItem(B_TRANSLATE("Show icons in list"),
new BMessage(kMsgToggleIcons)); new BMessage(kMsgToggleIcons));
item->SetMarked(showIcons); item->SetMarked(showIcons);
item->SetTarget(this); item->SetTarget(this);
menu->AddItem(item); menu->AddItem(item);
item = new BMenuItem(TR("Show recognition rule"), item = new BMenuItem(B_TRANSLATE("Show recognition rule"),
new BMessage(kMsgToggleRule)); new BMessage(kMsgToggleRule));
item->SetMarked(showRule); item->SetMarked(showRule);
item->SetTarget(this); item->SetTarget(this);
@@ -355,10 +357,10 @@ FileTypesWindow::FileTypesWindow(const BMessage& settings)
menuBar->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT, B_ALIGN_TOP)); menuBar->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT, B_ALIGN_TOP));
// MIME Types list // MIME Types list
BButton* addTypeButton = new BButton("add", TR("Add" B_UTF8_ELLIPSIS), BButton* addTypeButton = new BButton("add",
new BMessage(kMsgAddType)); B_TRANSLATE("Add" B_UTF8_ELLIPSIS), new BMessage(kMsgAddType));
fRemoveTypeButton = new BButton("remove", TR("Remove"), fRemoveTypeButton = new BButton("remove", B_TRANSLATE("Remove"),
new BMessage(kMsgRemoveType) ); new BMessage(kMsgRemoveType) );
fTypeListView = new MimeTypeListView("typeview", NULL, showIcons, false); fTypeListView = new MimeTypeListView("typeview", NULL, showIcons, false);
@@ -371,7 +373,7 @@ FileTypesWindow::FileTypesWindow(const BMessage& settings)
fIconView = new TypeIconView("icon"); fIconView = new TypeIconView("icon");
fIconBox = new BBox("Icon BBox"); fIconBox = new BBox("Icon BBox");
fIconBox->SetLabel(TR("Icon")); fIconBox->SetLabel(B_TRANSLATE("Icon"));
fIconBox->AddChild(BGroupLayoutBuilder(B_VERTICAL, padding) fIconBox->AddChild(BGroupLayoutBuilder(B_VERTICAL, padding)
.Add(BSpaceLayoutItem::CreateGlue(), 1) .Add(BSpaceLayoutItem::CreateGlue(), 1)
.Add(fIconView, 3) .Add(fIconView, 3)
@@ -382,16 +384,16 @@ FileTypesWindow::FileTypesWindow(const BMessage& settings)
// "File Recognition" group // "File Recognition" group
fRecognitionBox = new BBox("Recognition Box"); fRecognitionBox = new BBox("Recognition Box");
fRecognitionBox->SetLabel(TR("File recognition")); fRecognitionBox->SetLabel(B_TRANSLATE("File recognition"));
fRecognitionBox->SetExplicitAlignment(fullAlignment); fRecognitionBox->SetExplicitAlignment(fullAlignment);
fExtensionLabel = new StringView(TR("Extensions:"), NULL); fExtensionLabel = new StringView(B_TRANSLATE("Extensions:"), NULL);
fExtensionLabel->LabelView()->SetExplicitAlignment(labelAlignment); fExtensionLabel->LabelView()->SetExplicitAlignment(labelAlignment);
fAddExtensionButton = new BButton("add ext", TR("Add" B_UTF8_ELLIPSIS), fAddExtensionButton = new BButton("add ext",
new BMessage(kMsgAddExtension)); B_TRANSLATE("Add" B_UTF8_ELLIPSIS), new BMessage(kMsgAddExtension));
fRemoveExtensionButton = new BButton("remove ext", TR("Remove"), fRemoveExtensionButton = new BButton("remove ext", B_TRANSLATE("Remove"),
new BMessage(kMsgRemoveExtension)); new BMessage(kMsgRemoveExtension));
fExtensionListView = new ExtensionListView("listview ext", fExtensionListView = new ExtensionListView("listview ext",
@@ -404,7 +406,7 @@ FileTypesWindow::FileTypesWindow(const BMessage& settings)
BScrollView* scrollView = new BScrollView("scrollview ext", BScrollView* scrollView = new BScrollView("scrollview ext",
fExtensionListView, B_FRAME_EVENTS | B_WILL_DRAW, false, true); fExtensionListView, B_FRAME_EVENTS | B_WILL_DRAW, false, true);
fRuleControl = new BTextControl("rule", TR("Rule:"), "", fRuleControl = new BTextControl("rule", B_TRANSLATE("Rule:"), "",
new BMessage(kMsgRuleEntered)); new BMessage(kMsgRuleEntered));
fRuleControl->SetAlignment(B_ALIGN_RIGHT, B_ALIGN_LEFT); fRuleControl->SetAlignment(B_ALIGN_RIGHT, B_ALIGN_LEFT);
fRuleControl->Hide(); fRuleControl->Hide();
@@ -424,15 +426,15 @@ FileTypesWindow::FileTypesWindow(const BMessage& settings)
// "Description" group // "Description" group
fDescriptionBox = new BBox("description BBox"); fDescriptionBox = new BBox("description BBox");
fDescriptionBox->SetLabel(TR("Description")); fDescriptionBox->SetLabel(B_TRANSLATE("Description"));
fDescriptionBox->SetExplicitAlignment(fullAlignment); fDescriptionBox->SetExplicitAlignment(fullAlignment);
fInternalNameView = new StringView(TR("Internal name:"), NULL); fInternalNameView = new StringView(B_TRANSLATE("Internal name:"), NULL);
fInternalNameView->SetEnabled(false); fInternalNameView->SetEnabled(false);
fTypeNameControl = new BTextControl("type", TR("Type name:"), "", fTypeNameControl = new BTextControl("type", B_TRANSLATE("Type name:"), "",
new BMessage(kMsgTypeEntered)); new BMessage(kMsgTypeEntered));
fDescriptionControl = new BTextControl("description", TR("Description:"), fDescriptionControl = new BTextControl("description",
"", new BMessage(kMsgDescriptionEntered)); B_TRANSLATE("Description:"), "", new BMessage(kMsgDescriptionEntered));
fDescriptionBox->AddChild(BGridLayoutBuilder(padding, padding) fDescriptionBox->AddChild(BGridLayoutBuilder(padding, padding)
.Add(fInternalNameView->LabelView(), 0, 0) .Add(fInternalNameView->LabelView(), 0, 0)
@@ -448,18 +450,20 @@ FileTypesWindow::FileTypesWindow(const BMessage& settings)
// "Preferred Application" group // "Preferred Application" group
fPreferredBox = new BBox("preferred BBox"); fPreferredBox = new BBox("preferred BBox");
fPreferredBox->SetLabel(TR("Preferred application")); fPreferredBox->SetLabel(B_TRANSLATE("Preferred application"));
menu = new BPopUpMenu("preferred"); menu = new BPopUpMenu("preferred");
menu->AddItem(item = new BMenuItem(TR("None"), menu->AddItem(item = new BMenuItem(B_TRANSLATE("None"),
new BMessage(kMsgPreferredAppChosen))); new BMessage(kMsgPreferredAppChosen)));
item->SetMarked(true); item->SetMarked(true);
fPreferredField = new BMenuField("preferred", (char*)NULL, menu); fPreferredField = new BMenuField("preferred", (char*)NULL, menu);
fSelectButton = new BButton("select", TR("Select" B_UTF8_ELLIPSIS), fSelectButton = new BButton("select",
B_TRANSLATE("Select" B_UTF8_ELLIPSIS),
new BMessage(kMsgSelectPreferredApp)); new BMessage(kMsgSelectPreferredApp));
fSameAsButton = new BButton("same as", TR("Same as" B_UTF8_ELLIPSIS), fSameAsButton = new BButton("same as",
B_TRANSLATE("Same as" B_UTF8_ELLIPSIS),
new BMessage(kMsgSamePreferredAppAs)); new BMessage(kMsgSamePreferredAppAs));
fPreferredBox->AddChild( fPreferredBox->AddChild(
@@ -472,12 +476,12 @@ FileTypesWindow::FileTypesWindow(const BMessage& settings)
// "Extra Attributes" group // "Extra Attributes" group
fAttributeBox = new BBox("Attribute Box"); fAttributeBox = new BBox("Attribute Box");
fAttributeBox->SetLabel(TR("Extra attributes")); fAttributeBox->SetLabel(B_TRANSLATE("Extra attributes"));
fAddAttributeButton = new BButton("add attr", fAddAttributeButton = new BButton("add attr",
"Add" B_UTF8_ELLIPSIS, new BMessage(kMsgAddAttribute)); "Add" B_UTF8_ELLIPSIS, new BMessage(kMsgAddAttribute));
fRemoveAttributeButton = new BButton("remove attr", TR("Remove"), fRemoveAttributeButton = new BButton("remove attr", B_TRANSLATE("Remove"),
new BMessage(kMsgRemoveAttribute)); new BMessage(kMsgRemoveAttribute));
fAttributeListView = new AttributeListView("listview attr"); fAttributeListView = new AttributeListView("listview attr");
@@ -601,7 +605,8 @@ FileTypesWindow::_AdoptPreferredApplication(BMessage* message, bool sameAs)
status_t status = fCurrentType.SetPreferredApp(preferred.String()); status_t status = fCurrentType.SetPreferredApp(preferred.String());
if (status != B_OK) if (status != B_OK)
error_alert(TR("Could not set preferred application"), status); error_alert(B_TRANSLATE("Could not set preferred application"),
status);
} }
@@ -800,28 +805,29 @@ FileTypesWindow::MessageReceived(BMessage* message)
BAlert* alert; BAlert* alert;
if (fCurrentType.IsSupertypeOnly()) { if (fCurrentType.IsSupertypeOnly()) {
alert = new BPrivate::OverrideAlert(TR("FileTypes request"), alert = new BPrivate::OverrideAlert(
TR("Removing a super type cannot be reverted.\n" B_TRANSLATE("FileTypes request"),
B_TRANSLATE("Removing a super type cannot be reverted.\n"
"All file types that belong to this super type " "All file types that belong to this super type "
"will be lost!\n\n" "will be lost!\n\n"
"Are you sure you want to do this? To remove the whole " "Are you sure you want to do this? To remove the whole "
"group, hold down the Shift key and press \"Remove\"."), "group, hold down the Shift key and press \"Remove\"."),
TR("Remove"), B_SHIFT_KEY, TR("Cancel"), 0, NULL, 0, B_TRANSLATE("Remove"), B_SHIFT_KEY, B_TRANSLATE("Cancel"),
B_WIDTH_AS_USUAL, B_STOP_ALERT); 0, NULL, 0, B_WIDTH_AS_USUAL, B_STOP_ALERT);
} else { } else {
alert = new BAlert(TR("FileTypes request"), alert = new BAlert(B_TRANSLATE("FileTypes request"),
TR("Removing a file type cannot be reverted.\n" B_TRANSLATE("Removing a file type cannot be reverted.\n"
"Are you sure you want to remove it?"), "Are you sure you want to remove it?"),
TR("Remove"), TR("Cancel"), NULL, B_WIDTH_AS_USUAL, B_TRANSLATE("Remove"), B_TRANSLATE("Cancel"),
B_WARNING_ALERT); NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
} }
if (alert->Go()) if (alert->Go())
break; break;
status_t status = fCurrentType.Delete(); status_t status = fCurrentType.Delete();
if (status != B_OK) { if (status != B_OK) {
fprintf(stderr, TR("Could not remove file type: %s\n"), fprintf(stderr, B_TRANSLATE(
strerror(status)); "Could not remove file type: %s\n"), strerror(status));
} }
break; break;
} }
@@ -896,7 +902,8 @@ FileTypesWindow::MessageReceived(BMessage* message)
BString parseError; BString parseError;
if (BMimeType::CheckSnifferRule(fRuleControl->Text(), if (BMimeType::CheckSnifferRule(fRuleControl->Text(),
&parseError) != B_OK) { &parseError) != B_OK) {
parseError.Prepend(TR("Recognition rule is not valid:\n\n")); parseError.Prepend(
B_TRANSLATE("Recognition rule is not valid:\n\n"));
error_alert(parseError.String()); error_alert(parseError.String());
} else } else
fCurrentType.SetSnifferRule(fRuleControl->Text()); fCurrentType.SetSnifferRule(fRuleControl->Text());
@@ -932,7 +939,8 @@ FileTypesWindow::MessageReceived(BMessage* message)
case kMsgSelectPreferredApp: case kMsgSelectPreferredApp:
{ {
BMessage panel(kMsgOpenFilePanel); BMessage panel(kMsgOpenFilePanel);
panel.AddString("title", TR("Select preferred application")); panel.AddString("title",
B_TRANSLATE("Select preferred application"));
panel.AddInt32("message", kMsgPreferredAppOpened); panel.AddInt32("message", kMsgPreferredAppOpened);
panel.AddMessenger("target", this); panel.AddMessenger("target", this);
@@ -946,8 +954,8 @@ FileTypesWindow::MessageReceived(BMessage* message)
case kMsgSamePreferredAppAs: case kMsgSamePreferredAppAs:
{ {
BMessage panel(kMsgOpenFilePanel); BMessage panel(kMsgOpenFilePanel);
panel.AddString("title", TR("Select same preferred application " panel.AddString("title",
"as")); B_TRANSLATE("Select same preferred application as"));
panel.AddInt32("message", kMsgSamePreferredAppAsOpened); panel.AddInt32("message", kMsgSamePreferredAppAsOpened);
panel.AddMessenger("target", this); panel.AddMessenger("target", this);
+6 -4
View File
@@ -819,15 +819,17 @@ IconView::MouseDown(BPoint where)
bool hasIcon = fHasType ? fSource == kOwnIcon : fIcon != NULL; bool hasIcon = fHasType ? fSource == kOwnIcon : fIcon != NULL;
if (hasIcon) { if (hasIcon) {
menu->AddItem(new BMenuItem(TR("Edit icon" B_UTF8_ELLIPSIS), menu->AddItem(new BMenuItem(
B_TRANSLATE("Edit icon" B_UTF8_ELLIPSIS),
new BMessage(kMsgEditIcon))); new BMessage(kMsgEditIcon)));
} else { } else {
menu->AddItem(new BMenuItem(TR("Add icon" B_UTF8_ELLIPSIS), menu->AddItem(new BMenuItem(
B_TRANSLATE("Add icon" B_UTF8_ELLIPSIS),
new BMessage(kMsgAddIcon))); new BMessage(kMsgAddIcon)));
} }
BMenuItem* item = new BMenuItem(TR("Remove icon"), BMenuItem* item = new BMenuItem(
new BMessage(kMsgRemoveIcon)); B_TRANSLATE("Remove icon"), new BMessage(kMsgRemoveIcon));
if (!hasIcon) if (!hasIcon)
item->SetEnabled(false); item->SetEnabled(false);
+17 -14
View File
@@ -42,9 +42,9 @@ const uint32 kMsgAddType = 'atyp';
NewFileTypeWindow::NewFileTypeWindow(FileTypesWindow* target, NewFileTypeWindow::NewFileTypeWindow(FileTypesWindow* target,
const char* currentType) const char* currentType)
: :
BWindow(BRect(100, 100, 350, 200), TR("New file type"), B_MODAL_WINDOW, BWindow(BRect(100, 100, 350, 200), B_TRANSLATE("New file type"),
B_NOT_ZOOMABLE | B_NOT_V_RESIZABLE | B_ASYNCHRONOUS_CONTROLS B_MODAL_WINDOW, B_NOT_ZOOMABLE | B_NOT_V_RESIZABLE
| B_AUTO_UPDATE_SIZE_LIMITS ), | B_ASYNCHRONOUS_CONTROLS | B_AUTO_UPDATE_SIZE_LIMITS ),
fTarget(target) fTarget(target)
{ {
fSupertypesMenu = new BPopUpMenu("supertypes"); fSupertypesMenu = new BPopUpMenu("supertypes");
@@ -69,17 +69,17 @@ NewFileTypeWindow::NewFileTypeWindow(FileTypesWindow* target,
fSupertypesMenu->AddSeparatorItem(); fSupertypesMenu->AddSeparatorItem();
} }
fSupertypesMenu->AddItem(new BMenuItem(TR("Add new group"), fSupertypesMenu->AddItem(new BMenuItem(B_TRANSLATE("Add new group"),
new BMessage(kMsgNewSupertypeChosen))); new BMessage(kMsgNewSupertypeChosen)));
BMenuField* typesMenuField = new BMenuField(NULL, fSupertypesMenu); BMenuField* typesMenuField = new BMenuField(NULL, fSupertypesMenu);
BStringView* typesMenuLabel = new BStringView(NULL, TR("Group:")); BStringView* typesMenuLabel = new BStringView(NULL, B_TRANSLATE("Group:"));
// Create a separate label view, otherwise things don't line up right // Create a separate label view, otherwise things don't line up right
typesMenuLabel->SetAlignment(B_ALIGN_LEFT); typesMenuLabel->SetAlignment(B_ALIGN_LEFT);
typesMenuLabel->SetExplicitAlignment( typesMenuLabel->SetExplicitAlignment(
BAlignment(B_ALIGN_LEFT, B_ALIGN_USE_FULL_HEIGHT)); BAlignment(B_ALIGN_LEFT, B_ALIGN_USE_FULL_HEIGHT));
fNameControl = new BTextControl(TR("Internal name:"), "", NULL); fNameControl = new BTextControl(B_TRANSLATE("Internal name:"), "", NULL);
fNameControl->SetModificationMessage(new BMessage(kMsgNameUpdated)); fNameControl->SetModificationMessage(new BMessage(kMsgNameUpdated));
// filter out invalid characters that can't be part of a MIME type name // filter out invalid characters that can't be part of a MIME type name
@@ -89,7 +89,8 @@ NewFileTypeWindow::NewFileTypeWindow(FileTypesWindow* target,
nameControlTextView->DisallowChar(disallowedCharacters[i]); nameControlTextView->DisallowChar(disallowedCharacters[i]);
} }
fAddButton = new BButton(TR("Add type"), new BMessage(kMsgAddType)); fAddButton = new BButton(B_TRANSLATE("Add type"),
new BMessage(kMsgAddType));
float padding = 3.0f; float padding = 3.0f;
// if (be_control_look) // if (be_control_look)
@@ -103,7 +104,8 @@ NewFileTypeWindow::NewFileTypeWindow(FileTypesWindow* target,
.Add(fNameControl->CreateLabelLayoutItem(), 0, 1) .Add(fNameControl->CreateLabelLayoutItem(), 0, 1)
.Add(fNameControl->CreateTextViewLayoutItem(), 1, 1, 2) .Add(fNameControl->CreateTextViewLayoutItem(), 1, 1, 2)
.Add(BSpaceLayoutItem::CreateGlue(), 0, 2) .Add(BSpaceLayoutItem::CreateGlue(), 0, 2)
.Add(new BButton(TR("Cancel"), new BMessage(B_QUIT_REQUESTED)), 1, 2) .Add(new BButton(B_TRANSLATE("Cancel"),
new BMessage(B_QUIT_REQUESTED)), 1, 2)
.Add(fAddButton, 2, 2) .Add(fAddButton, 2, 2)
.SetColumnWeight(0, 3) .SetColumnWeight(0, 3)
); );
@@ -134,15 +136,15 @@ NewFileTypeWindow::MessageReceived(BMessage* message)
{ {
switch (message->what) { switch (message->what) {
case kMsgSupertypeChosen: case kMsgSupertypeChosen:
fAddButton->SetLabel(TR("Add type")); fAddButton->SetLabel(B_TRANSLATE("Add type"));
fNameControl->SetLabel(TR("Internal name:")); fNameControl->SetLabel(B_TRANSLATE("Internal name:"));
fNameControl->MakeFocus(true); fNameControl->MakeFocus(true);
InvalidateLayout(true); InvalidateLayout(true);
break; break;
case kMsgNewSupertypeChosen: case kMsgNewSupertypeChosen:
fAddButton->SetLabel(TR("Add group")); fAddButton->SetLabel(B_TRANSLATE("Add group"));
fNameControl->SetLabel(TR("Group name:")); fNameControl->SetLabel(B_TRANSLATE("Group name:"));
fNameControl->MakeFocus(true); fNameControl->MakeFocus(true);
InvalidateLayout(true); InvalidateLayout(true);
break; break;
@@ -173,13 +175,14 @@ NewFileTypeWindow::MessageReceived(BMessage* message)
BMimeType mimeType(type.String()); BMimeType mimeType(type.String());
if (mimeType.IsInstalled()) { if (mimeType.IsInstalled()) {
error_alert(TR("This file type already exists")); error_alert(B_TRANSLATE("This file type already exists"));
break; break;
} }
status_t status = mimeType.Install(); status_t status = mimeType.Install();
if (status != B_OK) if (status != B_OK)
error_alert(TR("Could not install file type"), status); error_alert(B_TRANSLATE("Could not install file type"),
status);
else { else {
BMessage update(kMsgSelectNewType); BMessage update(kMsgSelectNewType);
update.AddString("type", type.String()); update.AddString("type", type.String());
+10 -8
View File
@@ -248,14 +248,16 @@ retrieve_preferred_app(BMessage* message, bool sameAs, const char* forType,
} }
if (status != B_OK) { if (status != B_OK) {
error_alert(TR("File could not be opened"), status, B_STOP_ALERT); error_alert(B_TRANSLATE("File could not be opened"),
status, B_STOP_ALERT);
return status; return status;
} }
if (!preferred[0]) { if (!preferred[0]) {
error_alert(sameAs error_alert(sameAs
? TR("Could not retrieve preferred application of this file") ? B_TRANSLATE("Could not retrieve preferred application of this "
: TR("Could not retrieve application signature")); "file")
: B_TRANSLATE("Could not retrieve application signature"));
return B_ERROR; return B_ERROR;
} }
@@ -283,14 +285,14 @@ retrieve_preferred_app(BMessage* message, bool sameAs, const char* forType,
description[0] = '\0'; description[0] = '\0';
char warning[512]; char warning[512];
snprintf(warning, sizeof(warning), TR("The application \"%s\" does " snprintf(warning, sizeof(warning), B_TRANSLATE("The application "
"not support this file type.\n" "\"%s\" does not support this file type.\n"
"Are you sure you want to set it anyway?"), "Are you sure you want to set it anyway?"),
description[0] ? description : preferred); description[0] ? description : preferred);
BAlert* alert = new BAlert(TR("FileTypes request"), warning, BAlert* alert = new BAlert(B_TRANSLATE("FileTypes request"), warning,
TR("Set Preferred Application"), TR("Cancel"), NULL, B_TRANSLATE("Set Preferred Application"), B_TRANSLATE("Cancel"),
B_WIDTH_AS_USUAL, B_WARNING_ALERT); NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
if (alert->Go() == 1) if (alert->Go() == 1)
return B_ERROR; return B_ERROR;
} }
+4 -3
View File
@@ -28,7 +28,8 @@ const uint32 kMsgSelected = 'seld';
TypeListWindow::TypeListWindow(const char* currentType, TypeListWindow::TypeListWindow(const char* currentType,
uint32 what, BWindow* target) uint32 what, BWindow* target)
: :
BWindow(BRect(100, 100, 360, 440), TR("Choose type"), B_MODAL_WINDOW, BWindow(BRect(100, 100, 360, 440), B_TRANSLATE("Choose type"),
B_MODAL_WINDOW,
B_NOT_ZOOMABLE | B_ASYNCHRONOUS_CONTROLS | B_AUTO_UPDATE_SIZE_LIMITS), B_NOT_ZOOMABLE | B_ASYNCHRONOUS_CONTROLS | B_AUTO_UPDATE_SIZE_LIMITS),
fTarget(target), fTarget(target),
fWhat(what) fWhat(what)
@@ -38,11 +39,11 @@ TypeListWindow::TypeListWindow(const char* currentType,
// padding = be_control_look->DefaultItemSpacing(); // padding = be_control_look->DefaultItemSpacing();
// seems too big // seems too big
fSelectButton = new BButton("select", TR("Done"), fSelectButton = new BButton("select", B_TRANSLATE("Done"),
new BMessage(kMsgSelected)); new BMessage(kMsgSelected));
fSelectButton->SetEnabled(false); fSelectButton->SetEnabled(false);
BButton* button = new BButton("cancel", TR("Cancel"), BButton* button = new BButton("cancel", B_TRANSLATE("Cancel"),
new BMessage(B_CANCEL)); new BMessage(B_CANCEL));
fSelectButton->MakeDefault(true); fSelectButton->MakeDefault(true);