Patch by Jorma Karvonen (#6080) : improve diskprobe localization.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37186 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Adrien Destugues
2010-06-21 10:58:26 +00:00
parent e8f533b27b
commit e77e4cff3e
4 changed files with 55 additions and 29 deletions
+4 -2
View File
@@ -364,8 +364,10 @@ DiskProbe::RefsReceived(BMessage *message)
if (status != B_OK) { if (status != B_OK) {
char buffer[1024]; char buffer[1024];
snprintf(buffer, sizeof(buffer), snprintf(buffer, sizeof(buffer),
B_TRANSLATE("Could not open \"%s\":\n" B_TRANSLATE_COMMENT("Could not open \"%s\":\n"
"%s"), "%s", "Opening of entry reference buffer for a DiskProbe "
"request Alert message. The name of entry reference and "
"error message is shown."),
ref.name, strerror(status)); ref.name, strerror(status));
(new BAlert(B_TRANSLATE("DiskProbe request"), (new BAlert(B_TRANSLATE("DiskProbe request"),
+3 -2
View File
@@ -509,8 +509,9 @@ FindWindow::FindWindow(BRect _rect, BMessage& previous, BMessenger& target,
message->AddInt8("mode", kAsciiMode); message->AddInt8("mode", kAsciiMode);
if (mode == kAsciiMode) if (mode == kAsciiMode)
item->SetMarked(true); item->SetMarked(true);
fMenu->AddItem(item = new BMenuItem(B_TRANSLATE("Hexadecimal"), fMenu->AddItem(item = new BMenuItem(B_TRANSLATE_COMMENT("Hexadecimal",
message = new BMessage(kMsgFindMode))); "A menu item, as short as possible, noun is recommended if it is "
"shorter than adjective."), message = new BMessage(kMsgFindMode)));
message->AddInt8("mode", kHexMode); message->AddInt8("mode", kHexMode);
if (mode == kHexMode) if (mode == kHexMode)
item->SetMarked(true); item->SetMarked(true);
+30 -13
View File
@@ -490,8 +490,9 @@ HeaderView::HeaderView(BRect frame, const entry_ref *ref, DataEditor &editor)
plainFont.SetSize(10.0); plainFont.SetSize(10.0);
BRect rect = Bounds(); BRect rect = Bounds();
fStopButton = new BButton(BRect(0, 0, 20, 20), B_EMPTY_STRING, "Stop", fStopButton = new BButton(BRect(0, 0, 20, 20), B_EMPTY_STRING,
new BMessage(kMsgStopFind), B_FOLLOW_TOP | B_FOLLOW_RIGHT); B_TRANSLATE("Stop"), new BMessage(kMsgStopFind),
B_FOLLOW_TOP | B_FOLLOW_RIGHT);
fStopButton->SetFont(&plainFont); fStopButton->SetFont(&plainFont);
fStopButton->ResizeToPreferred(); fStopButton->ResizeToPreferred();
fStopButton->MoveTo(rect.right - 4 - fStopButton->Bounds().Width(), 4); fStopButton->MoveTo(rect.right - 4 - fStopButton->Bounds().Width(), 4);
@@ -575,7 +576,10 @@ HeaderView::HeaderView(BRect frame, const entry_ref *ref, DataEditor &editor)
rect.left = rect.right + 4; rect.left = rect.right + 4;
rect.right = rect.left + 75; rect.right = rect.left + 75;
rect.OffsetBy(0, 2); rect.OffsetBy(0, 2);
fSizeView = new BStringView(rect, B_EMPTY_STRING, B_TRANSLATE("of 0x0")); fSizeView = new BStringView(rect, B_EMPTY_STRING, B_TRANSLATE_COMMENT("of "
"0x0", "This is a part of \"Block 0xXXXX of 0x0026\" message. In "
"languages without 'of' structure it can be replaced simply "
"with '/'."));
fSizeView->SetFont(&plainFont); fSizeView->SetFont(&plainFont);
AddChild(fSizeView); AddChild(fSizeView);
UpdateFileSizeView(); UpdateFileSizeView();
@@ -1100,8 +1104,9 @@ EditorLooper::Find(off_t startAt, const uint8 *data, size_t dataSize,
// If the user had to wait more than 8 seconds for the result, // If the user had to wait more than 8 seconds for the result,
// we are trying to please him with a requester... // we are trying to please him with a requester...
(new BAlert(B_TRANSLATE("DiskProbe request"), (new BAlert(B_TRANSLATE("DiskProbe request"),
B_TRANSLATE("Could not find search string."), B_TRANSLATE("OK"), NULL, NULL, B_TRANSLATE("Could not find search string."),
B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go(NULL); B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL,
B_WARNING_ALERT))->Go(NULL);
} else } else
beep(); beep();
} }
@@ -1307,7 +1312,8 @@ ProbeView::_UpdateAttributesMenu(BMenu *menu)
if (menu->CountItems() == 0) { if (menu->CountItems() == 0) {
// if there are no attributes, add an item to the menu // if there are no attributes, add an item to the menu
// that says so // that says so
BMenuItem *item = new BMenuItem("none", NULL); BMenuItem *item = new BMenuItem(B_TRANSLATE_COMMENT("none",
"No attributes"), NULL);
item->SetEnabled(false); item->SetEnabled(false);
menu->AddItem(item); menu->AddItem(item);
} }
@@ -1501,21 +1507,29 @@ ProbeView::AttachedToWindow()
// "View" menu // "View" menu
menu = new BMenu(B_TRANSLATE("View")); menu = new BMenu(B_TRANSLATE_COMMENT("View",
"This is the last menubar item \"File Edit Block View\""));
// Number Base (hex/decimal) // Number Base (hex/decimal)
subMenu = new BMenu(B_TRANSLATE("Base")); subMenu = new BMenu(B_TRANSLATE_COMMENT("Base", "A menu item, the number "
"that is basis for a system of calculation. The base 10 system is a "
"decimal system. This is in the same menu window than \"Font size\" "
"and \"BlockSize\""));
message = new BMessage(kMsgBaseType); message = new BMessage(kMsgBaseType);
message->AddInt32("base_type", kDecimalBase); message->AddInt32("base_type", kDecimalBase);
subMenu->AddItem(item = new BMenuItem(B_TRANSLATE("Decimal"), message, 'D')); subMenu->AddItem(item = new BMenuItem(B_TRANSLATE_COMMENT("Decimal",
"A menu item, as short as possible, noun is recommended if it is "
"shorter than adjective."), message, 'D'));
item->SetTarget(this); item->SetTarget(this);
if (fHeaderView->Base() == kDecimalBase) if (fHeaderView->Base() == kDecimalBase)
item->SetMarked(true); item->SetMarked(true);
message = new BMessage(kMsgBaseType); message = new BMessage(kMsgBaseType);
message->AddInt32("base_type", kHexBase); message->AddInt32("base_type", kHexBase);
subMenu->AddItem(item = new BMenuItem(B_TRANSLATE("Hex"), message, 'H')); subMenu->AddItem(item = new BMenuItem(B_TRANSLATE_COMMENT("Hex",
"A menu item, as short as possible, noun is recommended if it is "
"shorter than adjective."), message, 'H'));
item->SetTarget(this); item->SetTarget(this);
if (fHeaderView->Base() == kHexBase) if (fHeaderView->Base() == kHexBase)
item->SetMarked(true); item->SetMarked(true);
@@ -1525,7 +1539,9 @@ ProbeView::AttachedToWindow()
// Block Size // Block Size
subMenu = new BMenu(B_TRANSLATE("BlockSize")); subMenu = new BMenu(B_TRANSLATE_COMMENT("BlockSize", "A menu item, a "
"shortened form from \"block size\". This is in the same menu window"
"than \"Base\" and \"Font size\""));
subMenu->SetRadioMode(true); subMenu->SetRadioMode(true);
const uint32 blockSizes[] = {512, 1024, 2048}; const uint32 blockSizes[] = {512, 1024, 2048};
for (uint32 i = 0; i < sizeof(blockSizes) / sizeof(blockSizes[0]); i++) { for (uint32 i = 0; i < sizeof(blockSizes) / sizeof(blockSizes[0]); i++) {
@@ -1570,7 +1586,8 @@ ProbeView::AttachedToWindow()
item->SetMarked(true); item->SetMarked(true);
} }
subMenu->AddSeparatorItem(); subMenu->AddSeparatorItem();
subMenu->AddItem(item = new BMenuItem(B_TRANSLATE("Fit"), subMenu->AddItem(item = new BMenuItem(B_TRANSLATE_COMMENT("Fit",
"Size of fonts, fits to available room"),
message = new BMessage(kMsgFontSize))); message = new BMessage(kMsgFontSize)));
message->AddFloat("font_size", 0.0f); message->AddFloat("font_size", 0.0f);
if (fontSize == 0) if (fontSize == 0)
@@ -1756,7 +1773,7 @@ ProbeView::_SetTypeEditor(int32 index)
_RemoveTypeEditor(); _RemoveTypeEditor();
fTypeView = new TypeView(Frame(), B_TRANSLATE("type shell"), index, fEditor, fTypeView = new TypeView(Frame(), "type shell", index, fEditor,
B_FOLLOW_ALL); B_FOLLOW_ALL);
if (Parent() != NULL) if (Parent() != NULL)
+18 -12
View File
@@ -195,7 +195,7 @@ TypeEditorView::TypeMatches()
StringEditor::StringEditor(BRect rect, DataEditor& editor) StringEditor::StringEditor(BRect rect, DataEditor& editor)
: TypeEditorView(rect, "String editor", B_FOLLOW_ALL, 0, editor) : TypeEditorView(rect, B_TRANSLATE("String editor"), B_FOLLOW_ALL, 0, editor)
{ {
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
@@ -746,7 +746,7 @@ NumberEditor::MessageReceived(BMessage *message)
BooleanEditor::BooleanEditor(BRect rect, DataEditor &editor) BooleanEditor::BooleanEditor(BRect rect, DataEditor &editor)
: TypeEditorView(rect, "Boolean editor", B_FOLLOW_NONE, 0, editor) : TypeEditorView(rect, B_TRANSLATE("Boolean editor"), B_FOLLOW_NONE, 0, editor)
{ {
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
@@ -843,7 +843,8 @@ BooleanEditor::MessageReceived(BMessage *message)
ImageView::ImageView(BRect rect, DataEditor &editor) ImageView::ImageView(BRect rect, DataEditor &editor)
: TypeEditorView(rect, B_TRANSLATE("Image view"), B_FOLLOW_NONE, : TypeEditorView(rect, B_TRANSLATE_COMMENT("Image view", "Image means "
"here a picture file, not a disk image."), B_FOLLOW_NONE,
B_WILL_DRAW, editor), B_WILL_DRAW, editor),
fBitmap(NULL), fBitmap(NULL),
fScaleSlider(NULL) fScaleSlider(NULL)
@@ -871,7 +872,8 @@ ImageView::ImageView(BRect rect, DataEditor &editor)
#endif #endif
fDescriptionView = new BStringView(Bounds(), "", fDescriptionView = new BStringView(Bounds(), "",
B_TRANSLATE("Could not read image"), B_FOLLOW_NONE); B_TRANSLATE_COMMENT("Could not read image", "Image means "
"here a picture file, not a disk image."), B_FOLLOW_NONE);
fDescriptionView->SetAlignment(B_ALIGN_CENTER); fDescriptionView->SetAlignment(B_ALIGN_CENTER);
AddChild(fDescriptionView); AddChild(fDescriptionView);
@@ -1075,10 +1077,12 @@ ImageView::_UpdateImage()
break; break;
} }
snprintf(buffer, sizeof(buffer), "%s, %g x %g, %s", type, snprintf(buffer, sizeof(buffer), "%s, %g x %g, %s", type,
fBitmap->Bounds().Width() + 1, fBitmap->Bounds().Height() + 1, colorSpace); fBitmap->Bounds().Width() + 1, fBitmap->Bounds().Height() + 1,
colorSpace);
fDescriptionView->SetText(buffer); fDescriptionView->SetText(buffer);
} else } else
fDescriptionView->SetText(B_TRANSLATE("Could not read image")); fDescriptionView->SetText(B_TRANSLATE_COMMENT("Could not read image",
"Image means here a picture file, not a disk image."));
// Update the view size to match the image and its description // Update the view size to match the image and its description
@@ -1184,7 +1188,9 @@ MessageView::SetTo(BMessage& message)
fTextView->SetText(""); fTextView->SetText("");
char text[512]; char text[512];
snprintf(text, sizeof(text), B_TRANSLATE("what: '%.4s'\n\n"), (char*)&message.what); snprintf(text, sizeof(text), B_TRANSLATE_COMMENT("what: '%.4s'\n\n",
"'What' is a message specifier that defines the type of the message."),
(char*)&message.what);
fTextView->Insert(text); fTextView->Insert(text);
type_code type; type_code type;
@@ -1353,11 +1359,11 @@ status_t
GetNthTypeEditor(int32 index, const char** _name) GetNthTypeEditor(int32 index, const char** _name)
{ {
static const char* kEditors[] = { static const char* kEditors[] = {
B_TRANSLATE("Text"), B_TRANSLATE_COMMENT("Text", "This is the type of editor"),
B_TRANSLATE("Number"), B_TRANSLATE_COMMENT("Number", "This is the type of editor"),
B_TRANSLATE("Boolean"), B_TRANSLATE_COMMENT("Boolean", "This is the type of editor"),
B_TRANSLATE("Message"), B_TRANSLATE_COMMENT("Message", "This is the type of view"),
B_TRANSLATE("Image") B_TRANSLATE_COMMENT("Image", "This is the type of view")
}; };
if (index < 0 || index >= int32(sizeof(kEditors) / sizeof(kEditors[0]))) if (index < 0 || index >= int32(sizeof(kEditors) / sizeof(kEditors[0])))