Author: pulkomandy Date: 2010-06-21 12:58:26 +0200 (Mon, 21 Jun 2010) New Revision: 37186 Changeset: http://dev.haiku-os.org/changeset/37186/haiku Ticket: http://dev.haiku-os.org/ticket/6080 Modified: haiku/trunk/src/apps/diskprobe/DiskProbe.cpp haiku/trunk/src/apps/diskprobe/FindWindow.cpp haiku/trunk/src/apps/diskprobe/ProbeView.cpp haiku/trunk/src/apps/diskprobe/TypeEditors.cpp Log: Patch by Jorma Karvonen (#6080) : improve diskprobe localization. Modified: haiku/trunk/src/apps/diskprobe/DiskProbe.cpp =================================================================== --- haiku/trunk/src/apps/diskprobe/DiskProbe.cpp 2010-06-21 10:10:36 UTC (rev 37185) +++ haiku/trunk/src/apps/diskprobe/DiskProbe.cpp 2010-06-21 10:58:26 UTC (rev 37186) @@ -364,8 +364,10 @@ if (status != B_OK) { char buffer[1024]; snprintf(buffer, sizeof(buffer), - B_TRANSLATE("Could not open \"%s\":\n" - "%s"), + B_TRANSLATE_COMMENT("Could not open \"%s\":\n" + "%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)); (new BAlert(B_TRANSLATE("DiskProbe request"), Modified: haiku/trunk/src/apps/diskprobe/FindWindow.cpp =================================================================== --- haiku/trunk/src/apps/diskprobe/FindWindow.cpp 2010-06-21 10:10:36 UTC (rev 37185) +++ haiku/trunk/src/apps/diskprobe/FindWindow.cpp 2010-06-21 10:58:26 UTC (rev 37186) @@ -509,8 +509,9 @@ message->AddInt8("mode", kAsciiMode); if (mode == kAsciiMode) item->SetMarked(true); - fMenu->AddItem(item = new BMenuItem(B_TRANSLATE("Hexadecimal"), - message = new BMessage(kMsgFindMode))); + fMenu->AddItem(item = new BMenuItem(B_TRANSLATE_COMMENT("Hexadecimal", + "A menu item, as short as possible, noun is recommended if it is " + "shorter than adjective."), message = new BMessage(kMsgFindMode))); message->AddInt8("mode", kHexMode); if (mode == kHexMode) item->SetMarked(true); Modified: haiku/trunk/src/apps/diskprobe/ProbeView.cpp =================================================================== --- haiku/trunk/src/apps/diskprobe/ProbeView.cpp 2010-06-21 10:10:36 UTC (rev 37185) +++ haiku/trunk/src/apps/diskprobe/ProbeView.cpp 2010-06-21 10:58:26 UTC (rev 37186) @@ -490,8 +490,9 @@ plainFont.SetSize(10.0); BRect rect = Bounds(); - fStopButton = new BButton(BRect(0, 0, 20, 20), B_EMPTY_STRING, "Stop", - new BMessage(kMsgStopFind), B_FOLLOW_TOP | B_FOLLOW_RIGHT); + fStopButton = new BButton(BRect(0, 0, 20, 20), B_EMPTY_STRING, + B_TRANSLATE("Stop"), new BMessage(kMsgStopFind), + B_FOLLOW_TOP | B_FOLLOW_RIGHT); fStopButton->SetFont(&plainFont); fStopButton->ResizeToPreferred(); fStopButton->MoveTo(rect.right - 4 - fStopButton->Bounds().Width(), 4); @@ -575,7 +576,10 @@ rect.left = rect.right + 4; rect.right = rect.left + 75; 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); AddChild(fSizeView); UpdateFileSizeView(); @@ -1100,8 +1104,9 @@ // If the user had to wait more than 8 seconds for the result, // we are trying to please him with a requester... (new BAlert(B_TRANSLATE("DiskProbe request"), - B_TRANSLATE("Could not find search string."), B_TRANSLATE("OK"), NULL, NULL, - B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go(NULL); + B_TRANSLATE("Could not find search string."), + B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL, + B_WARNING_ALERT))->Go(NULL); } else beep(); } @@ -1307,7 +1312,8 @@ if (menu->CountItems() == 0) { // if there are no attributes, add an item to the menu // that says so - BMenuItem *item = new BMenuItem("none", NULL); + BMenuItem *item = new BMenuItem(B_TRANSLATE_COMMENT("none", + "No attributes"), NULL); item->SetEnabled(false); menu->AddItem(item); } @@ -1501,21 +1507,29 @@ // "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) - 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->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); if (fHeaderView->Base() == kDecimalBase) item->SetMarked(true); message = new BMessage(kMsgBaseType); 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); if (fHeaderView->Base() == kHexBase) item->SetMarked(true); @@ -1525,7 +1539,9 @@ // 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); const uint32 blockSizes[] = {512, 1024, 2048}; for (uint32 i = 0; i < sizeof(blockSizes) / sizeof(blockSizes[0]); i++) { @@ -1570,7 +1586,8 @@ item->SetMarked(true); } 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->AddFloat("font_size", 0.0f); if (fontSize == 0) @@ -1756,7 +1773,7 @@ _RemoveTypeEditor(); - fTypeView = new TypeView(Frame(), B_TRANSLATE("type shell"), index, fEditor, + fTypeView = new TypeView(Frame(), "type shell", index, fEditor, B_FOLLOW_ALL); if (Parent() != NULL) Modified: haiku/trunk/src/apps/diskprobe/TypeEditors.cpp =================================================================== --- haiku/trunk/src/apps/diskprobe/TypeEditors.cpp 2010-06-21 10:10:36 UTC (rev 37185) +++ haiku/trunk/src/apps/diskprobe/TypeEditors.cpp 2010-06-21 10:58:26 UTC (rev 37186) @@ -195,7 +195,7 @@ 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)); @@ -746,7 +746,7 @@ 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)); @@ -843,7 +843,8 @@ 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), fBitmap(NULL), fScaleSlider(NULL) @@ -871,7 +872,8 @@ #endif 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); AddChild(fDescriptionView); @@ -1075,10 +1077,12 @@ break; } 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); } 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 @@ -1184,7 +1188,9 @@ fTextView->SetText(""); 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); type_code type; @@ -1353,11 +1359,11 @@ GetNthTypeEditor(int32 index, const char** _name) { static const char* kEditors[] = { - B_TRANSLATE("Text"), - B_TRANSLATE("Number"), - B_TRANSLATE("Boolean"), - B_TRANSLATE("Message"), - B_TRANSLATE("Image") + B_TRANSLATE_COMMENT("Text", "This is the type of editor"), + B_TRANSLATE_COMMENT("Number", "This is the type of editor"), + B_TRANSLATE_COMMENT("Boolean", "This is the type of editor"), + B_TRANSLATE_COMMENT("Message", "This is the type of view"), + B_TRANSLATE_COMMENT("Image", "This is the type of view") }; if (index < 0 || index >= int32(sizeof(kEditors) / sizeof(kEditors[0])))