diff --git a/src/apps/icon-o-matic/IconEditorApp.cpp b/src/apps/icon-o-matic/IconEditorApp.cpp index f0810e020f..e8920bb5f1 100644 --- a/src/apps/icon-o-matic/IconEditorApp.cpp +++ b/src/apps/icon-o-matic/IconEditorApp.cpp @@ -13,12 +13,14 @@ #include #include +#include #include #include #include #include #include #include +#include #include #include @@ -49,6 +51,11 @@ #include "SVGExporter.h" #include "SVGImporter.h" + +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "Icon-O-Matic-Main" + + using std::nothrow; static const char* kAppSig = "application/x-vnd.haiku-icon_o_matic"; @@ -284,8 +291,9 @@ IconEditorApp::_CheckSaveIcon(const BMessage* currentMessage) if (fDocument->IsEmpty() || fDocument->CommandStack()->IsSaved()) return true; - BAlert* alert = new BAlert("save", "Save changes to current icon?", - "Discard", "Cancel", "Save"); + BAlert* alert = new BAlert("save", + B_TRANSLATE("Save changes to current icon?"), B_TRANSLATE("Discard"), + B_TRANSLATE("Cancel"), B_TRANSLATE("Save")); int32 choice = alert->Go(); switch (choice) { case 0: @@ -437,10 +445,14 @@ IconEditorApp::_Open(const entry_ref& ref, bool append) if (ret < B_OK) { // inform user of failure at this point - BString helper("Opening the document failed!"); - helper << "\n\n" << "Error: " << strerror(ret); - BAlert* alert = new BAlert("bad news", helper.String(), - "Bummer", NULL, NULL); + BString helper(B_TRANSLATE("Opening the document failed!")); + helper << "\n\n" << B_TRANSLATE("Error: ") << strerror(ret); + BAlert* alert = new BAlert( + B_TRANSLATE_WITH_CONTEXT("bad news", "Title of error alert"), + helper.String(), + B_TRANSLATE_WITH_CONTEXT("Bummer", + "Cancel button - error alert"), + NULL, NULL); // launch alert asynchronously alert->Go(NULL); @@ -520,10 +532,14 @@ IconEditorApp::_Open(const BMessenger& externalObserver, const uint8* data, if (ret < B_OK) { // inform user of failure at this point - BString helper("Opening the icon failed!"); - helper << "\n\n" << "Error: " << strerror(ret); - BAlert* alert = new BAlert("bad news", helper.String(), - "Bummer", NULL, NULL); + BString helper(B_TRANSLATE("Opening the icon failed!")); + helper << "\n\n" << B_TRANSLATE("Error: ") << strerror(ret); + BAlert* alert = new BAlert( + B_TRANSLATE_WITH_CONTEXT("bad news", "Title of error alert"), + helper.String(), + B_TRANSLATE_WITH_CONTEXT("Bummer", + "Cancel button - error alert"), + NULL, NULL); // launch alert asynchronously alert->Go(NULL); diff --git a/src/apps/icon-o-matic/Jamfile b/src/apps/icon-o-matic/Jamfile index 32873d9c81..a05878ec82 100644 --- a/src/apps/icon-o-matic/Jamfile +++ b/src/apps/icon-o-matic/Jamfile @@ -299,7 +299,61 @@ Application Icon-O-Matic : MainWindow.cpp Util.cpp - : be tracker translation libshared.a libagg.a libexpat.a $(TARGET_LIBSTDC++) + : be tracker translation libshared.a libagg.a libexpat.a + $(TARGET_LIBSTDC++) $(HAIKU_LOCALE_LIBS) : Icon-O-Matic.rdef ; + +DoCatalogs Icon-O-Matic : + x-vnd.haiku-icon_o_matic + : + MainWindow.cpp + IconEditorApp.cpp + SetPropertiesCommand.cpp + ColorPickerPanel.cpp + PropertyListView.cpp + CommonPropertyIDs.cpp + IconObjectListView.cpp + PathListView.cpp + SavePanel.cpp + ShapeListView.cpp + StyleListView.cpp + StyleView.cpp + TransformerListView.cpp + StyledTextImporter.cpp + SVGExporter.cpp + SVGImporter.cpp + Exporter.cpp + AddPathsCommand.cpp + AddPointCommand.cpp + AddShapesCommand.cpp + AddTransformersCommand.cpp + ChangePointCommand.cpp + CleanUpPathCommand.cpp + FlipPointsCommand.cpp + FreezeTransformationCommand.cpp + InsertPointCommand.cpp + MovePathsCommand.cpp + MoveShapesCommand.cpp + MoveTransformersCommand.cpp + NudgePointsCommand.cpp + PathCommand.cpp + RemovePathsCommand.cpp + RemovePointsCommand.cpp + RemoveShapesCommand.cpp + RemoveTransformersCommand.cpp + ReversePathCommand.cpp + RotatePathIndicesCommand.cpp + SplitPointsCommand.cpp + UnassignPathCommand.cpp + PathManipulator.cpp + AddStylesCommand.cpp + AssignStyleCommand.cpp + MoveStylesCommand.cpp + RemoveStylesCommand.cpp + SetColorCommand.cpp + SetGradientCommand.cpp + ResetTransformationCommand.cpp + TransformBoxStates.cpp +; diff --git a/src/apps/icon-o-matic/MainWindow.cpp b/src/apps/icon-o-matic/MainWindow.cpp index 86b7850356..ff3bd4946c 100644 --- a/src/apps/icon-o-matic/MainWindow.cpp +++ b/src/apps/icon-o-matic/MainWindow.cpp @@ -18,6 +18,8 @@ #include #include #include +#include +#include #include "support_ui.h" @@ -61,6 +63,10 @@ #include "StyledTextImporter.h" +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "Icon-O-Matic-Main" + + using std::nothrow; enum { @@ -130,7 +136,9 @@ MainWindow::MessageReceived(BMessage* message) if (len != sizeof(rgb_color)) continue; char name[30]; - sprintf(name, "Color (#%02x%02x%02x)", + sprintf(name, + B_TRANSLATE_WITH_CONTEXT("Color (#%02x%02x%02x)", + "Style name after dropping a color"), color->red, color->green, color->blue); Style* style = new (nothrow) Style(*color); style->SetName(name); @@ -259,19 +267,25 @@ MainWindow::MessageReceived(BMessage* message) commands[1] = pathCommand; commands[2] = shapeCommand; command = new CompoundCommand(commands, 3, - "Add shape with path & style", 0); + B_TRANSLATE_WITH_CONTEXT("Add shape with path & style", + "Icon-O-Matic-Menu-Shape"), + 0); } else if (styleCommand) { Command** commands = new Command*[2]; commands[0] = styleCommand; commands[1] = shapeCommand; command = new CompoundCommand(commands, 2, - "Add shape with style", 0); + B_TRANSLATE_WITH_CONTEXT("Add shape with style", + "Icon-O-Matic-Menu-Shape"), + 0); } else { Command** commands = new Command*[2]; commands[0] = pathCommand; commands[1] = shapeCommand; command = new CompoundCommand(commands, 2, - "Add shape with path", 0); + B_TRANSLATE_WITH_CONTEXT("Add shape with path", + "Icon-O-Matic-Menu-Shape"), + 0); } } else { command = shapeCommand; @@ -426,20 +440,22 @@ MainWindow::ObjectChanged(const Observable* object) if (object == fDocument->CommandStack()) { // relable Undo item and update enabled status - BString label("Undo"); + BString label(B_TRANSLATE("Undo")); fUndoMI->SetEnabled(fDocument->CommandStack()->GetUndoName(label)); if (fUndoMI->IsEnabled()) fUndoMI->SetLabel(label.String()); else - fUndoMI->SetLabel(""); + fUndoMI->SetLabel(B_TRANSLATE_WITH_CONTEXT("", + "Icon-O-Matic-Menu-Edit")); // relable Redo item and update enabled status - label.SetTo("Redo"); + label.SetTo(B_TRANSLATE("Redo")); fRedoMI->SetEnabled(fDocument->CommandStack()->GetRedoName(label)); if (fRedoMI->IsEnabled()) fRedoMI->SetLabel(label.String()); else - fRedoMI->SetLabel(""); + fRedoMI->SetLabel(B_TRANSLATE_WITH_CONTEXT("", + "Icon-O-Matic-Menu-Edit")); } Unlock(); @@ -769,52 +785,66 @@ MainWindow::_CreateGUI(BRect bounds) swatchGroupView->MinSize().height)); } - BMenuBar* MainWindow::_CreateMenuBar(BRect frame) { BMenuBar* menuBar = new BMenuBar(frame, "main menu"); - BMenu* fileMenu = new BMenu("File"); - BMenu* editMenu = new BMenu("Edit"); - BMenu* settingsMenu = new BMenu("Options"); - fPathMenu = new BMenu("Path"); - fStyleMenu = new BMenu("Style"); - fShapeMenu = new BMenu("Shape"); - fTransformerMenu = new BMenu("Transformer"); - fPropertyMenu = new BMenu("Properties"); - fSwatchMenu = new BMenu("Swatches"); + + #undef B_TRANSLATE_CONTEXT + #define B_TRANSLATE_CONTEXT "Icon-O-Matic-Menus" + + + BMenu* fileMenu = new BMenu(B_TRANSLATE("File")); + BMenu* editMenu = new BMenu(B_TRANSLATE("Edit")); + BMenu* settingsMenu = new BMenu(B_TRANSLATE("Options")); + fPathMenu = new BMenu(B_TRANSLATE("Path")); + fStyleMenu = new BMenu(B_TRANSLATE("Style")); + fShapeMenu = new BMenu(B_TRANSLATE("Shape")); + fTransformerMenu = new BMenu(B_TRANSLATE("Transformer")); + fPropertyMenu = new BMenu(B_TRANSLATE("Properties")); + fSwatchMenu = new BMenu(B_TRANSLATE("Swatches")); menuBar->AddItem(fileMenu); menuBar->AddItem(editMenu); menuBar->AddItem(settingsMenu); + // File - fileMenu->AddItem(new BMenuItem("New", + #undef B_TRANSLATE_CONTEXT + #define B_TRANSLATE_CONTEXT "Icon-O-Matic-Menu-File" + + + fileMenu->AddItem(new BMenuItem(B_TRANSLATE("New"), new BMessage(MSG_NEW), 'N')); - fileMenu->AddItem(new BMenuItem("Open"B_UTF8_ELLIPSIS, + fileMenu->AddItem(new BMenuItem(B_TRANSLATE("Open"B_UTF8_ELLIPSIS), new BMessage(MSG_OPEN), 'O')); - fileMenu->AddItem(new BMenuItem("Append"B_UTF8_ELLIPSIS, + fileMenu->AddItem(new BMenuItem(B_TRANSLATE("Append"B_UTF8_ELLIPSIS), new BMessage(MSG_APPEND), 'O', B_SHIFT_KEY)); fileMenu->AddSeparatorItem(); - fileMenu->AddItem(new BMenuItem("Save", + fileMenu->AddItem(new BMenuItem(B_TRANSLATE("Save"), new BMessage(MSG_SAVE), 'S')); - fileMenu->AddItem(new BMenuItem("Save as"B_UTF8_ELLIPSIS, + fileMenu->AddItem(new BMenuItem(B_TRANSLATE("Save as"B_UTF8_ELLIPSIS), new BMessage(MSG_SAVE_AS), 'S', B_SHIFT_KEY)); fileMenu->AddSeparatorItem(); - fileMenu->AddItem(new BMenuItem("Export", + fileMenu->AddItem(new BMenuItem(B_TRANSLATE("Export"), new BMessage(MSG_EXPORT), 'P')); - fileMenu->AddItem(new BMenuItem("Export as"B_UTF8_ELLIPSIS, + fileMenu->AddItem(new BMenuItem(B_TRANSLATE("Export as"B_UTF8_ELLIPSIS), new BMessage(MSG_EXPORT_AS), 'P', B_SHIFT_KEY)); fileMenu->AddSeparatorItem(); - fileMenu->AddItem(new BMenuItem("Quit", + fileMenu->AddItem(new BMenuItem(B_TRANSLATE("Quit"), new BMessage(B_QUIT_REQUESTED), 'Q')); fileMenu->SetTargetForItems(be_app); + // Edit - fUndoMI = new BMenuItem("", + #undef B_TRANSLATE_CONTEXT + #define B_TRANSLATE_CONTEXT "Icon-O-Matic-Menu-Edit" + + + fUndoMI = new BMenuItem(B_TRANSLATE(""), new BMessage(MSG_UNDO), 'Z'); - fRedoMI = new BMenuItem("", + fRedoMI = new BMenuItem(B_TRANSLATE(""), new BMessage(MSG_REDO), 'Z', B_SHIFT_KEY); fUndoMI->SetEnabled(false); @@ -823,8 +853,13 @@ MainWindow::_CreateMenuBar(BRect frame) editMenu->AddItem(fUndoMI); editMenu->AddItem(fRedoMI); + // Settings - BMenu* filterModeMenu = new BMenu("Snap to grid"); + #undef B_TRANSLATE_CONTEXT + #define B_TRANSLATE_CONTEXT "Icon-O-Matic-Menu-Settings" + + + BMenu* filterModeMenu = new BMenu(B_TRANSLATE("Snap to grid")); BMessage* message = new BMessage(MSG_MOUSE_FILTER_MODE); message->AddInt32("mode", SNAPPING_OFF); filterModeMenu->AddItem(new BMenuItem("Off", message, '4')); diff --git a/src/apps/icon-o-matic/document/SetPropertiesCommand.cpp b/src/apps/icon-o-matic/document/SetPropertiesCommand.cpp index 67a4d6957d..40a21474b8 100644 --- a/src/apps/icon-o-matic/document/SetPropertiesCommand.cpp +++ b/src/apps/icon-o-matic/document/SetPropertiesCommand.cpp @@ -10,11 +10,19 @@ #include +#include +#include + #include "CommonPropertyIDs.h" #include "IconObject.h" #include "Property.h" #include "PropertyObject.h" + +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "Icon-O-Matic-Properties" + + // constructor SetPropertiesCommand::SetPropertiesCommand(IconObject** objects, int32 objectCount, @@ -75,15 +83,17 @@ SetPropertiesCommand::GetName(BString& name) { if (fOldProperties->CountProperties() > 1) { if (fObjectCount > 1) - name << "Multi Paste Properties"; + name << B_TRANSLATE("Multi Paste Properties"); else - name << "Paste Properties"; + name << B_TRANSLATE("Paste Properties"); } else { BString property = name_for_id( fOldProperties->PropertyAt(0)->Identifier()); if (fObjectCount > 1) - name << "Multi Set " << property; + name << B_TRANSLATE_WITH_CONTEXT("Multi Set ", + "Multi Set (property name)") << property; else - name << "Set " << property; + name << B_TRANSLATE_WITH_CONTEXT("Set ", "Set (property name)") + << property; } } diff --git a/src/apps/icon-o-matic/generic/gui/panel/color_picker/ColorPickerPanel.cpp b/src/apps/icon-o-matic/generic/gui/panel/color_picker/ColorPickerPanel.cpp index 182bb585fd..ef2870b0da 100644 --- a/src/apps/icon-o-matic/generic/gui/panel/color_picker/ColorPickerPanel.cpp +++ b/src/apps/icon-o-matic/generic/gui/panel/color_picker/ColorPickerPanel.cpp @@ -9,6 +9,8 @@ #include #include +#include +#include #if LIB_LAYOUT # include @@ -25,6 +27,11 @@ #include "ColorPickerView.h" + +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "Icon-O-Matic-ColorPicker" + + enum { MSG_CANCEL = 'cncl', MSG_DONE = 'done', @@ -43,12 +50,13 @@ ColorPickerPanel::ColorPickerPanel(BRect frame, rgb_color color, fMessage(message), fTarget(target) { - SetTitle("Pick a color"); + SetTitle(B_TRANSLATE("Pick a color")); fColorPickerView = new ColorPickerView("color picker", color, mode); #if LIB_LAYOUT - MButton* defaultButton = new MButton("OK", new BMessage(MSG_DONE), this); + MButton* defaultButton = new MButton(B_TRANSLATE("OK"), + new BMessage(MSG_DONE), this); // interface layout BView* topView = new VGroup ( @@ -57,7 +65,8 @@ ColorPickerPanel::ColorPickerPanel(BRect frame, rgb_color color, M_RAISED_BORDER, 5, "buttons", new HGroup ( new Space(minimax(0.0, 0.0, 10000.0, 10000.0, 5.0)), - new MButton("Cancel", new BMessage(MSG_CANCEL), this), + new MButton(B_TRANSLATE("Cancel"), new BMessage(MSG_CANCEL), + this), new Space(minimax(5.0, 0.0, 10.0, 10000.0, 1.0)), defaultButton, new Space(minimax(2.0, 0.0, 2.0, 10000.0, 0.0)), @@ -68,13 +77,13 @@ ColorPickerPanel::ColorPickerPanel(BRect frame, rgb_color color, ); #else // LIB_LAYOUT frame = BRect(0, 0, 40, 15); - BButton* defaultButton = new BButton(frame, "ok button", "OK", - new BMessage(MSG_DONE), - B_FOLLOW_RIGHT | B_FOLLOW_TOP); + BButton* defaultButton = new BButton(frame, "ok button", + B_TRANSLATE("OK"), new BMessage(MSG_DONE), + B_FOLLOW_RIGHT | B_FOLLOW_TOP); defaultButton->ResizeToPreferred(); - BButton* cancelButton = new BButton(frame, "cancel button", "Cancel", - new BMessage(MSG_CANCEL), - B_FOLLOW_RIGHT | B_FOLLOW_TOP); + BButton* cancelButton = new BButton(frame, "cancel button", + B_TRANSLATE("Cancel"), new BMessage(MSG_CANCEL), + B_FOLLOW_RIGHT | B_FOLLOW_TOP); cancelButton->ResizeToPreferred(); frame.bottom = frame.top + (defaultButton->Frame().Height() + 16); diff --git a/src/apps/icon-o-matic/generic/property/CommonPropertyIDs.cpp b/src/apps/icon-o-matic/generic/property/CommonPropertyIDs.cpp index 11f520a9cd..67ae798470 100644 --- a/src/apps/icon-o-matic/generic/property/CommonPropertyIDs.cpp +++ b/src/apps/icon-o-matic/generic/property/CommonPropertyIDs.cpp @@ -12,6 +12,14 @@ #include +#include +#include + + +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "Icon-O-Matic-PropertyNames" + + // name_for_id const char* name_for_id(int32 id) @@ -19,75 +27,75 @@ name_for_id(int32 id) const char* name = NULL; switch (id) { case PROPERTY_NAME: - name = "Name"; + name = B_TRANSLATE("Name"); break; case PROPERTY_OPACITY: - name = "Opacity"; + name = B_TRANSLATE("Opacity"); break; case PROPERTY_COLOR: - name = "Color"; + name = B_TRANSLATE("Color"); break; case PROPERTY_WIDTH: - name = "Width"; + name = B_TRANSLATE("Width"); break; case PROPERTY_HEIGHT: - name = "Height"; + name = B_TRANSLATE("Height"); break; case PROPERTY_CAP_MODE: - name = "Caps"; + name = B_TRANSLATE("Caps"); break; case PROPERTY_JOIN_MODE: - name = "Joins"; + name = B_TRANSLATE("Joins"); break; case PROPERTY_MITER_LIMIT: - name = "Miter Limit"; + name = B_TRANSLATE("Miter Limit"); break; case PROPERTY_STROKE_SHORTEN: - name = "Shorten"; + name = B_TRANSLATE("Shorten"); break; case PROPERTY_CLOSED: - name = "Closed"; + name = B_TRANSLATE("Closed"); break; case PROPERTY_PATH: - name = "Path"; + name = B_TRANSLATE("Path"); break; case PROPERTY_HINTING: - name = "Rounding"; + name = B_TRANSLATE("Rounding"); break; case PROPERTY_MIN_VISIBILITY_SCALE: - name = "Min LOD"; + name = B_TRANSLATE("Min LOD"); break; case PROPERTY_MAX_VISIBILITY_SCALE: - name = "Max LOD"; + name = B_TRANSLATE("Max LOD"); break; case PROPERTY_TRANSLATION_X: - name = "Translation X"; + name = B_TRANSLATE("Translation X"); break; case PROPERTY_TRANSLATION_Y: - name = "Translation Y"; + name = B_TRANSLATE("Translation Y"); break; case PROPERTY_ROTATION: - name = "Rotation"; + name = B_TRANSLATE("Rotation"); break; case PROPERTY_SCALE_X: - name = "Scale X"; + name = B_TRANSLATE("Scale X"); break; case PROPERTY_SCALE_Y: - name = "Scale Y"; + name = B_TRANSLATE("Scale Y"); break; case PROPERTY_DETECT_ORIENTATION: - name = "Detect Orient."; + name = B_TRANSLATE("Detect Orient."); break; default: - name = ""; + name = B_TRANSLATE(""); break; } return name; diff --git a/src/apps/icon-o-matic/generic/property/view/PropertyListView.cpp b/src/apps/icon-o-matic/generic/property/view/PropertyListView.cpp index d43d6087f2..e9dffce431 100644 --- a/src/apps/icon-o-matic/generic/property/view/PropertyListView.cpp +++ b/src/apps/icon-o-matic/generic/property/view/PropertyListView.cpp @@ -11,10 +11,12 @@ #include #include +#include #include #ifdef __HAIKU__ # include #endif +#include #include #include #include @@ -29,6 +31,11 @@ #include "Scroller.h" #include "ScrollView.h" + +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "Icon-O-Matic-Properties" + + enum { MSG_COPY_PROPERTIES = 'cppr', MSG_PASTE_PROPERTIES = 'pspr', @@ -315,12 +322,15 @@ PropertyListView::SetMenu(BMenu* menu) if (!fPropertyM) return; - fSelectM = new BMenu("Select"); - fSelectAllMI = new BMenuItem("All", new BMessage(MSG_SELECT_ALL)); + fSelectM = new BMenu(B_TRANSLATE("Select")); + fSelectAllMI = new BMenuItem(B_TRANSLATE("All"), + new BMessage(MSG_SELECT_ALL)); fSelectM->AddItem(fSelectAllMI); - fSelectNoneMI = new BMenuItem("None", new BMessage(MSG_SELECT_NONE)); + fSelectNoneMI = new BMenuItem(B_TRANSLATE("None"), + new BMessage(MSG_SELECT_NONE)); fSelectM->AddItem(fSelectNoneMI); - fInvertSelectionMI = new BMenuItem("Invert selection", new BMessage(MSG_INVERT_SELECTION)); + fInvertSelectionMI = new BMenuItem(B_TRANSLATE("Invert selection"), + new BMessage(MSG_INVERT_SELECTION)); fSelectM->AddItem(fInvertSelectionMI); fSelectM->SetTargetForItems(this); @@ -328,9 +338,11 @@ PropertyListView::SetMenu(BMenu* menu) fPropertyM->AddSeparatorItem(); - fCopyMI = new BMenuItem("Copy", new BMessage(MSG_COPY_PROPERTIES)); + fCopyMI = new BMenuItem(B_TRANSLATE("Copy"), + new BMessage(MSG_COPY_PROPERTIES)); fPropertyM->AddItem(fCopyMI); - fPasteMI = new BMenuItem("Paste", new BMessage(MSG_PASTE_PROPERTIES)); + fPasteMI = new BMenuItem(B_TRANSLATE("Paste"), + new BMessage(MSG_PASTE_PROPERTIES)); fPropertyM->AddItem(fPasteMI); fPropertyM->SetTargetForItems(this); @@ -728,10 +740,10 @@ PropertyListView::_CheckMenuStatus() // LanguageManager* m = LanguageManager::Default(); if (IsEditingMultipleObjects()) // fPasteMI->SetLabel(m->GetString(MULTI_PASTE, "Multi paste")); - fPasteMI->SetLabel("Multi paste"); + fPasteMI->SetLabel(B_TRANSLATE("Multi paste")); else // fPasteMI->SetLabel(m->GetString(PASTE, "Paste")); - fPasteMI->SetLabel("Paste"); + fPasteMI->SetLabel(B_TRANSLATE("Paste")); bool enableMenu = fPropertyObject; if (fPropertyM->IsEnabled() != enableMenu) diff --git a/src/apps/icon-o-matic/gui/IconObjectListView.cpp b/src/apps/icon-o-matic/gui/IconObjectListView.cpp index 00879b124e..92dc31b0ac 100644 --- a/src/apps/icon-o-matic/gui/IconObjectListView.cpp +++ b/src/apps/icon-o-matic/gui/IconObjectListView.cpp @@ -12,6 +12,9 @@ #include #include +#include +#include + #include "CommandStack.h" #include "CommonPropertyIDs.h" #include "IconObject.h" @@ -21,6 +24,11 @@ #include "Selection.h" #include "SetPropertiesCommand.h" + +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "Icon-O-Matic-PropertiesList" + + using std::nothrow; // constructor @@ -51,9 +59,12 @@ IconObjectListView::Draw(BRect updateRect) return; // display helpful messages - const char* message1 = "Click on an object in"; - const char* message2 = "any of the other lists to"; - const char* message3 = "edit it's properties here."; + const char* message1 = B_TRANSLATE_WITH_CONTEXT( + "Click on an object in", "Empty property list - 1st line"); + const char* message2 = B_TRANSLATE_WITH_CONTEXT( + "any of the other lists to", "Empty property list - 2nd line"); + const char* message3 = B_TRANSLATE_WITH_CONTEXT( + "edit it's properties here.", "Empty property list - 3rd line"); SetHighColor(tint_color(LowColor(), B_DARKEN_2_TINT)); font_height fh; diff --git a/src/apps/icon-o-matic/gui/PathListView.cpp b/src/apps/icon-o-matic/gui/PathListView.cpp index 4a45187269..abd83e9081 100644 --- a/src/apps/icon-o-matic/gui/PathListView.cpp +++ b/src/apps/icon-o-matic/gui/PathListView.cpp @@ -12,7 +12,9 @@ #include #include +#include #include +#include #include #include #include @@ -34,6 +36,11 @@ #include "Util.h" #include "VectorPath.h" + +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "Icon-O-Matic-PathsList" + + using std::nothrow; static const float kMarkWidth = 14.0; @@ -728,20 +735,26 @@ PathListView::SetMenu(BMenu* menu) if (fMenu == NULL) return; - fAddMI = new BMenuItem("Add", new BMessage(MSG_ADD)); - fAddRectMI = new BMenuItem("Add rect", new BMessage(MSG_ADD_RECT)); - fAddCircleMI = new BMenuItem("Add circle"/*B_UTF8_ELLIPSIS*/, + fAddMI = new BMenuItem(B_TRANSLATE("Add"), + new BMessage(MSG_ADD)); + fAddRectMI = new BMenuItem(B_TRANSLATE("Add rect"), + new BMessage(MSG_ADD_RECT)); + fAddCircleMI = new BMenuItem(B_TRANSLATE("Add circle"/*B_UTF8_ELLIPSIS*/), new BMessage(MSG_ADD_CIRCLE)); // fAddArcMI = new BMenuItem("Add arc"B_UTF8_ELLIPSIS, // new BMessage(MSG_ADD_ARC)); - fDuplicateMI = new BMenuItem("Duplicate", new BMessage(MSG_DUPLICATE)); - fReverseMI = new BMenuItem("Reverse", new BMessage(MSG_REVERSE)); - fCleanUpMI = new BMenuItem("Clean up", new BMessage(MSG_CLEAN_UP)); - fRotateIndicesRightMI = new BMenuItem("Rotate indices right", + fDuplicateMI = new BMenuItem(B_TRANSLATE("Duplicate"), + new BMessage(MSG_DUPLICATE)); + fReverseMI = new BMenuItem(B_TRANSLATE("Reverse"), + new BMessage(MSG_REVERSE)); + fCleanUpMI = new BMenuItem(B_TRANSLATE("Clean up"), + new BMessage(MSG_CLEAN_UP)); + fRotateIndicesRightMI = new BMenuItem(B_TRANSLATE("Rotate indices right"), new BMessage(MSG_ROTATE_INDICES_CCW), 'R'); - fRotateIndicesLeftMI = new BMenuItem("Rotate indices left", + fRotateIndicesLeftMI = new BMenuItem(B_TRANSLATE("Rotate indices left"), new BMessage(MSG_ROTATE_INDICES_CW), 'R', B_SHIFT_KEY); - fRemoveMI = new BMenuItem("Remove", new BMessage(MSG_REMOVE)); + fRemoveMI = new BMenuItem(B_TRANSLATE("Remove"), + new BMessage(MSG_REMOVE)); fMenu->AddItem(fAddMI); fMenu->AddItem(fAddRectMI); diff --git a/src/apps/icon-o-matic/gui/SavePanel.cpp b/src/apps/icon-o-matic/gui/SavePanel.cpp index 9f2126333c..ab6ee8c5c4 100644 --- a/src/apps/icon-o-matic/gui/SavePanel.cpp +++ b/src/apps/icon-o-matic/gui/SavePanel.cpp @@ -13,6 +13,8 @@ #include #include +#include +#include #include #include #include @@ -26,6 +28,11 @@ #include "IconEditorApp.h" #include "Panel.h" + +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "Icon-O-Matic-SavePanel" + + enum { MSG_FORMAT = 'sfpf', MSG_SETTINGS = 'sfps', @@ -88,10 +95,12 @@ SavePanel::SavePanel(const char* name, be_plain_font->GetHeight(&fh); rect.bottom = rect.top + fh.ascent + fh.descent + 5.0; - fFormatMF = new BMenuField(rect, "format popup", "Format", fFormatM, true, - B_FOLLOW_LEFT | B_FOLLOW_BOTTOM, - B_WILL_DRAW | B_NAVIGABLE); - fFormatMF->SetDivider(be_plain_font->StringWidth("Format") + 7); + fFormatMF = new BMenuField(rect, "format popup", B_TRANSLATE("Format"), + fFormatM, true, + B_FOLLOW_LEFT | B_FOLLOW_BOTTOM, + B_WILL_DRAW | B_NAVIGABLE); + fFormatMF->SetDivider(be_plain_font->StringWidth( + B_TRANSLATE("Format")) + 7); fFormatMF->MenuBar()->ResizeToPreferred(); fFormatMF->ResizeToPreferred(); @@ -120,9 +129,11 @@ SavePanel::SavePanel(const char* name, // Build the "Settings" button relative to the format menu rect = cancel->Frame(); rect.OffsetTo(fFormatMF->Frame().right + 5.0, rect.top); - fSettingsB = new BButton(rect, "settings", "Settings"B_UTF8_ELLIPSIS, + fSettingsB = new BButton(rect, "settings", + B_TRANSLATE("Settings"B_UTF8_ELLIPSIS), new BMessage(MSG_SETTINGS), - B_FOLLOW_LEFT | B_FOLLOW_BOTTOM, B_WILL_DRAW | B_NAVIGABLE); + B_FOLLOW_LEFT | B_FOLLOW_BOTTOM, + B_WILL_DRAW | B_NAVIGABLE); fSettingsB->ResizeToPreferred(); background->AddChild(fSettingsB); fSettingsB->SetTarget(this); @@ -195,7 +206,7 @@ SavePanel::SetExportMode(bool exportMode) fFormatMF->SetEnabled(true); SetExportMode(fExportMode); _EnableSettings(); - helper << "Export Icon"; + helper << B_TRANSLATE_WITH_CONTEXT("Export Icon", "Dialog title"); } else { fExportMode = ExportMode(); // does not overwrite fExportMode in case we already were @@ -204,7 +215,7 @@ SavePanel::SetExportMode(bool exportMode) fFormatMF->SetEnabled(false); fSettingsB->SetEnabled(false); - helper << "Save Icon"; + helper << B_TRANSLATE_WITH_CONTEXT("Save Icon", "Dialog title"); } window->Unlock(); @@ -372,51 +383,53 @@ SavePanel::_ExportSettings() void SavePanel::_BuildMenu() { - fFormatM = new BPopUpMenu("Format"); + fFormatM = new BPopUpMenu(B_TRANSLATE("Format")); - fNativeMI = new SaveItem("Icon-O-Matic", new BMessage(MSG_FORMAT), - EXPORT_MODE_MESSAGE); + fNativeMI = new SaveItem("Icon-O-Matic", + new BMessage(MSG_FORMAT), EXPORT_MODE_MESSAGE); fFormatM->AddItem(fNativeMI); fNativeMI->SetEnabled(false); fFormatM->AddSeparatorItem(); - fHVIFMI = new SaveItem("HVIF", new BMessage(MSG_FORMAT), - EXPORT_MODE_FLAT_ICON); + fHVIFMI = new SaveItem("HVIF", + new BMessage(MSG_FORMAT), EXPORT_MODE_FLAT_ICON); fFormatM->AddItem(fHVIFMI); - fRDefMI = new SaveItem("HVIF RDef", new BMessage(MSG_FORMAT), - EXPORT_MODE_ICON_RDEF); + fRDefMI = new SaveItem("HVIF RDef", + new BMessage(MSG_FORMAT), EXPORT_MODE_ICON_RDEF); fFormatM->AddItem(fRDefMI); - fSourceMI = new SaveItem("HVIF Source Code", new BMessage(MSG_FORMAT), - EXPORT_MODE_ICON_SOURCE); + fSourceMI = new SaveItem(B_TRANSLATE("HVIF Source Code"), + new BMessage(MSG_FORMAT), EXPORT_MODE_ICON_SOURCE); fFormatM->AddItem(fSourceMI); fFormatM->AddSeparatorItem(); - fSVGMI = new SaveItem("SVG", new BMessage(MSG_FORMAT), - EXPORT_MODE_SVG); + fSVGMI = new SaveItem("SVG", + new BMessage(MSG_FORMAT), EXPORT_MODE_SVG); + fFormatM->AddItem(fSVGMI); fFormatM->AddSeparatorItem(); - fBitmapMI = new SaveItem("PNG", new BMessage(MSG_FORMAT), - EXPORT_MODE_BITMAP); + fBitmapMI = new SaveItem("PNG", + new BMessage(MSG_FORMAT), EXPORT_MODE_BITMAP); fFormatM->AddItem(fBitmapMI); - fBitmapSetMI = new SaveItem("PNG Set", new BMessage(MSG_FORMAT), - EXPORT_MODE_BITMAP_SET); + fBitmapSetMI = new SaveItem(B_TRANSLATE("PNG Set"), + new BMessage(MSG_FORMAT), EXPORT_MODE_BITMAP_SET); fFormatM->AddItem(fBitmapSetMI); fFormatM->AddSeparatorItem(); - fIconAttrMI = new SaveItem("BEOS:ICON Attribute", new BMessage(MSG_FORMAT), - EXPORT_MODE_ICON_ATTR); + fIconAttrMI = new SaveItem(B_TRANSLATE("BEOS:ICON Attribute"), + new BMessage(MSG_FORMAT), EXPORT_MODE_ICON_ATTR); fFormatM->AddItem(fIconAttrMI); - fIconMimeAttrMI = new SaveItem("META:ICON Attribute", new BMessage(MSG_FORMAT), - EXPORT_MODE_ICON_MIME_ATTR); + fIconMimeAttrMI = new SaveItem(B_TRANSLATE("META:ICON Attribute"), + new BMessage(MSG_FORMAT), EXPORT_MODE_ICON_MIME_ATTR); + fFormatM->AddItem(fIconMimeAttrMI); diff --git a/src/apps/icon-o-matic/gui/ShapeListView.cpp b/src/apps/icon-o-matic/gui/ShapeListView.cpp index b14f810a12..e4d81d5e76 100644 --- a/src/apps/icon-o-matic/gui/ShapeListView.cpp +++ b/src/apps/icon-o-matic/gui/ShapeListView.cpp @@ -12,7 +12,9 @@ #include #include +#include #include +#include #include #include #include @@ -32,6 +34,11 @@ #include "Shape.h" #include "Util.h" + +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "Icon-O-Matic-ShapesList" + + using std::nothrow; class ShapeListItem : public SimpleItem, @@ -423,28 +430,31 @@ ShapeListView::SetMenu(BMenu* menu) return; BMessage* message = new BMessage(MSG_ADD_SHAPE); - fAddEmptyMI = new BMenuItem("Add empty", message); + fAddEmptyMI = new BMenuItem(B_TRANSLATE("Add empty"), message); message = new BMessage(MSG_ADD_SHAPE); message->AddBool("path", true); - fAddWidthPathMI = new BMenuItem("Add with path", message); + fAddWidthPathMI = new BMenuItem(B_TRANSLATE("Add with path"), message); message = new BMessage(MSG_ADD_SHAPE); message->AddBool("style", true); - fAddWidthStyleMI = new BMenuItem("Add with style", message); + fAddWidthStyleMI = new BMenuItem(B_TRANSLATE("Add with style"), message); message = new BMessage(MSG_ADD_SHAPE); message->AddBool("path", true); message->AddBool("style", true); - fAddWidthPathAndStyleMI = new BMenuItem("Add with path & style", message); + fAddWidthPathAndStyleMI = new BMenuItem( + B_TRANSLATE("Add with path & style"), message); - fDuplicateMI = new BMenuItem("Duplicate", new BMessage(MSG_DUPLICATE)); - fResetTransformationMI = new BMenuItem("Reset transformation", + fDuplicateMI = new BMenuItem(B_TRANSLATE("Duplicate"), + new BMessage(MSG_DUPLICATE)); + fResetTransformationMI = new BMenuItem(B_TRANSLATE("Reset transformation"), new BMessage(MSG_RESET_TRANSFORMATION)); - fFreezeTransformationMI = new BMenuItem("Freeze transformation", + fFreezeTransformationMI = new BMenuItem( + B_TRANSLATE("Freeze transformation"), new BMessage(MSG_FREEZE_TRANSFORMATION)); - fRemoveMI = new BMenuItem("Remove", new BMessage(MSG_REMOVE)); + fRemoveMI = new BMenuItem(B_TRANSLATE("Remove"), new BMessage(MSG_REMOVE)); fMenu->AddItem(fAddEmptyMI); diff --git a/src/apps/icon-o-matic/gui/StyleListView.cpp b/src/apps/icon-o-matic/gui/StyleListView.cpp index 4c84b157d5..d479ff2f05 100644 --- a/src/apps/icon-o-matic/gui/StyleListView.cpp +++ b/src/apps/icon-o-matic/gui/StyleListView.cpp @@ -12,7 +12,9 @@ #include #include +#include #include +#include #include #include #include @@ -34,6 +36,11 @@ #include "Selection.h" #include "Util.h" + +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "Icon-O-Matic-StylesList" + + using std::nothrow; static const float kMarkWidth = 14.0; @@ -592,21 +599,22 @@ StyleListView::SetMenu(BMenu* menu) if (fMenu == NULL) return; - fAddMI = new BMenuItem("Add", new BMessage(MSG_ADD)); + fAddMI = new BMenuItem(B_TRANSLATE("Add"), new BMessage(MSG_ADD)); fMenu->AddItem(fAddMI); fMenu->AddSeparatorItem(); - fDuplicateMI = new BMenuItem("Duplicate", new BMessage(MSG_DUPLICATE)); + fDuplicateMI = new BMenuItem(B_TRANSLATE("Duplicate"), + new BMessage(MSG_DUPLICATE)); fMenu->AddItem(fDuplicateMI); - fResetTransformationMI = new BMenuItem("Reset transformation", + fResetTransformationMI = new BMenuItem(B_TRANSLATE("Reset transformation"), new BMessage(MSG_RESET_TRANSFORMATION)); fMenu->AddItem(fResetTransformationMI); fMenu->AddSeparatorItem(); - fRemoveMI = new BMenuItem("Remove", new BMessage(MSG_REMOVE)); + fRemoveMI = new BMenuItem(B_TRANSLATE("Remove"), new BMessage(MSG_REMOVE)); fMenu->AddItem(fRemoveMI); fMenu->SetTargetForItems(this); diff --git a/src/apps/icon-o-matic/gui/StyleView.cpp b/src/apps/icon-o-matic/gui/StyleView.cpp index 08704a5820..6c790438bf 100644 --- a/src/apps/icon-o-matic/gui/StyleView.cpp +++ b/src/apps/icon-o-matic/gui/StyleView.cpp @@ -15,6 +15,8 @@ # include "GroupLayout.h" # include "SpaceLayoutItem.h" #endif +#include +#include #include #include #include @@ -32,6 +34,10 @@ #include "Style.h" +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "Icon-O-Matic-StyleTypes" + + using std::nothrow; enum { @@ -65,26 +71,26 @@ StyleView::StyleView(BRect frame) SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); // style type - BMenu* menu = new BPopUpMenu(""); + BMenu* menu = new BPopUpMenu(B_TRANSLATE("")); BMessage* message = new BMessage(MSG_SET_STYLE_TYPE); message->AddInt32("type", STYLE_TYPE_COLOR); - menu->AddItem(new BMenuItem("Color", message)); + menu->AddItem(new BMenuItem(B_TRANSLATE("Color"), message)); message = new BMessage(MSG_SET_STYLE_TYPE); message->AddInt32("type", STYLE_TYPE_GRADIENT); - menu->AddItem(new BMenuItem("Gradient", message)); + menu->AddItem(new BMenuItem(B_TRANSLATE("Gradient"), message)); #ifdef __HAIKU__ BGridLayout* layout = new BGridLayout(5, 5); SetLayout(layout); - fStyleType = new BMenuField( "Style type", menu, NULL); + fStyleType = new BMenuField(B_TRANSLATE("Style type"), menu, NULL); #else frame.OffsetTo(B_ORIGIN); frame.InsetBy(5, 5); frame.bottom = frame.top + 15; - fStyleType = new BMenuField(frame, "style type", "Style type", + fStyleType = new BMenuField(frame, "style type", B_TRANSLATE("Style type"), menu, true); AddChild(fStyleType); @@ -98,22 +104,22 @@ StyleView::StyleView(BRect frame) #endif // __HAIKU__ // gradient type - menu = new BPopUpMenu(""); + menu = new BPopUpMenu(B_TRANSLATE("")); message = new BMessage(MSG_SET_GRADIENT_TYPE); message->AddInt32("type", GRADIENT_LINEAR); - menu->AddItem(new BMenuItem("Linear", message)); + menu->AddItem(new BMenuItem(B_TRANSLATE("Linear"), message)); message = new BMessage(MSG_SET_GRADIENT_TYPE); message->AddInt32("type", GRADIENT_CIRCULAR); - menu->AddItem(new BMenuItem("Radial", message)); + menu->AddItem(new BMenuItem(B_TRANSLATE("Radial"), message)); message = new BMessage(MSG_SET_GRADIENT_TYPE); message->AddInt32("type", GRADIENT_DIAMOND); - menu->AddItem(new BMenuItem("Diamond", message)); + menu->AddItem(new BMenuItem(B_TRANSLATE("Diamond"), message)); message = new BMessage(MSG_SET_GRADIENT_TYPE); message->AddInt32("type", GRADIENT_CONIC); - menu->AddItem(new BMenuItem("Conic", message)); + menu->AddItem(new BMenuItem(B_TRANSLATE("Conic"), message)); #if __HAIKU__ - fGradientType = new BMenuField("Gradient type", menu, NULL); + fGradientType = new BMenuField(B_TRANSLATE("Gradient type"), menu, NULL); fGradientControl = new GradientControl(new BMessage(MSG_SET_COLOR), this); layout->AddItem(BSpaceLayoutItem::CreateVerticalStrut(3), 0, 0, 4); @@ -132,8 +138,8 @@ StyleView::StyleView(BRect frame) #else // !__HAIKU__ frame.OffsetBy(0, fStyleType->Frame().Height() + 6); - fGradientType = new BMenuField(frame, "gradient type", "Gradient type", - menu, true); + fGradientType = new BMenuField(frame, "gradient type", + B_TRANSLATE("Gradient type"), menu, true); AddChild(fGradientType); fGradientType->MenuBar()->GetPreferredSize(&width, &height); diff --git a/src/apps/icon-o-matic/gui/TransformerListView.cpp b/src/apps/icon-o-matic/gui/TransformerListView.cpp index 52afd24198..e74e891b83 100644 --- a/src/apps/icon-o-matic/gui/TransformerListView.cpp +++ b/src/apps/icon-o-matic/gui/TransformerListView.cpp @@ -12,7 +12,9 @@ #include #include +#include #include +#include #include #include #include @@ -28,6 +30,11 @@ #include "Observer.h" #include "Selection.h" + +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "Icon-O-Matic-TransformersList" + + using std::nothrow; class TransformerItem : public SimpleItem, @@ -128,8 +135,10 @@ TransformerListView::Draw(BRect updateRect) return; // display helpful messages - const char* message1 = "Click on a shape above"; - const char* message2 = "to attach transformers."; + const char* message1 = B_TRANSLATE_WITH_CONTEXT("Click on a shape above", + "Empty transformers list - 1st line"); + const char* message2 = B_TRANSLATE_WITH_CONTEXT("to attach transformers.", + "Empty transformers list - 2nd line"); SetHighColor(tint_color(LowColor(), B_DARKEN_2_TINT)); font_height fh; @@ -370,14 +379,15 @@ TransformerListView::SetMenu(BMenu* menu) if (fMenu == NULL) return; - BMenu* addMenu = new BMenu("Add"); + BMenu* addMenu = new BMenu(B_TRANSLATE("Add")); int32 cookie = 0; uint32 type; BString name; while (TransformerFactory::NextType(&cookie, &type, &name)) { // TODO: Disable the "Transformation" and "Perspective" transformers // since they are not very useful or even implemented at all. - if (name == "Transformation" || name == "Perspective") + if (name == B_TRANSLATE("Transformation") + || name == B_TRANSLATE("Perspective")) continue; // End of TODO. BMessage* message = new BMessage(MSG_ADD_TRANSFORMER); diff --git a/src/apps/icon-o-matic/import_export/Exporter.cpp b/src/apps/icon-o-matic/import_export/Exporter.cpp index a31ebee109..2cd7fc2e6a 100644 --- a/src/apps/icon-o-matic/import_export/Exporter.cpp +++ b/src/apps/icon-o-matic/import_export/Exporter.cpp @@ -13,7 +13,9 @@ #include #include +#include #include +#include #include #include #include @@ -24,6 +26,11 @@ #include "Document.h" #include "Icon.h" + +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "Icon-O-Matic-Exporter" + + using std::nothrow; // constructor @@ -93,10 +100,12 @@ Exporter::_ExportThread() status_t ret = _Export(fClonedIcon, &fRef); if (ret < B_OK) { // inform user of failure at this point - BString helper("Saving your document failed!"); - helper << "\n\n" << "Error: " << strerror(ret); - BAlert* alert = new BAlert("bad news", helper.String(), - "Bleep!", NULL, NULL); + BString helper(B_TRANSLATE("Saving your document failed!")); + helper << "\n\n" << B_TRANSLATE("Error: ") << strerror(ret); + BAlert* alert = new BAlert(B_TRANSLATE("bad news"), helper.String(), + B_TRANSLATE_WITH_CONTEXT("Bleep!", + "Exporter - Continue in error dialog"), + NULL, NULL); // launch alert asynchronously alert->Go(NULL); } else { diff --git a/src/apps/icon-o-matic/import_export/styled_text/StyledTextImporter.cpp b/src/apps/icon-o-matic/import_export/styled_text/StyledTextImporter.cpp index 37ac3a65ae..71dd087cc2 100644 --- a/src/apps/icon-o-matic/import_export/styled_text/StyledTextImporter.cpp +++ b/src/apps/icon-o-matic/import_export/styled_text/StyledTextImporter.cpp @@ -15,9 +15,11 @@ #include #include #include +#include #include #include #include +#include #include #include #include @@ -32,9 +34,13 @@ #include "StyleContainer.h" #include "VectorPath.h" + +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "Icon-O-Matic-StyledTextImport" //#define CALLED() printf("%s()\n", __FUNCTION__); #define CALLED() do {} while (0) + using std::nothrow; class ShapeIterator : public BShapeIterator { @@ -247,9 +253,11 @@ StyledTextImporter::_Import(Icon* icon, const char *text, text_run_array *runs) BString str(text); if (str.Length() > 50) { - BAlert* alert = new BAlert("too big", - "The text you are trying to import is quite long, are you sure?", - "Yes", "No", NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT); + BAlert* alert = new BAlert(B_TRANSLATE("too big"), + B_TRANSLATE("The text you are trying to import is quite long," + "are you sure?"), + B_TRANSLATE("Yes"), B_TRANSLATE("No"), NULL, + B_WIDTH_AS_USUAL, B_WARNING_ALERT); if (alert->Go()) return B_CANCELED; } @@ -365,7 +373,8 @@ StyledTextImporter::_AddStyle(Icon *icon, text_run *run) return B_NO_MEMORY; } char name[30]; - sprintf(name, "Color (#%02x%02x%02x)", color.red, color.green, color.blue); + sprintf(name, B_TRANSLATE("Color (#%02x%02x%02x)"), + color.red, color.green, color.blue); style->SetName(name); bool found = false; diff --git a/src/apps/icon-o-matic/import_export/svg/SVGExporter.cpp b/src/apps/icon-o-matic/import_export/svg/SVGExporter.cpp index f37be14cf9..d221318819 100644 --- a/src/apps/icon-o-matic/import_export/svg/SVGExporter.cpp +++ b/src/apps/icon-o-matic/import_export/svg/SVGExporter.cpp @@ -9,8 +9,10 @@ #include #include +#include #include #include +#include #include #include "support.h" @@ -24,6 +26,11 @@ #include "SVGExporter.h" + +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "Icon-O-Matic-SVGExport" + + // write_line static status_t write_line(BPositionIO* stream, BString& string) @@ -148,14 +155,15 @@ SVGExporter::SetOriginalEntry(const entry_ref* ref) bool SVGExporter::_DisplayWarning() const { - BAlert* alert = new BAlert("warning", - "Icon-O-Matic might not have " + BAlert* alert = new BAlert(B_TRANSLATE("warning"), + B_TRANSLATE("Icon-O-Matic might not have " "interpreted all data from the SVG " "when it was loaded. " "By overwriting the original " "file, this information would now " - "be lost.", - "Cancel", "Overwrite"); + "be lost."), + B_TRANSLATE("Cancel"), + B_TRANSLATE("Overwrite")); return alert->Go() == 1; } diff --git a/src/apps/icon-o-matic/import_export/svg/SVGImporter.cpp b/src/apps/icon-o-matic/import_export/svg/SVGImporter.cpp index 9eb0196591..d70503cf2e 100644 --- a/src/apps/icon-o-matic/import_export/svg/SVGImporter.cpp +++ b/src/apps/icon-o-matic/import_export/svg/SVGImporter.cpp @@ -9,13 +9,20 @@ #include "SVGImporter.h" #include +#include #include #include +#include #include #include "DocumentBuilder.h" #include "SVGParser.h" + +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "Icon-O-Matic-SVGImport" + + // constructor SVGImporter::SVGImporter() { @@ -67,11 +74,11 @@ SVGImporter::Import(Icon* icon, const entry_ref* ref) ret = builder.GetIcon(icon, this, ref->name); } catch(agg::svg::exception& e) { char error[1024]; - sprintf(error, "Failed to open the file '%s' as " + sprintf(error, B_TRANSLATE("Failed to open the file '%s' as " "an SVG document.\n\n" - "Error: %s", ref->name, e.msg()); - BAlert* alert = new BAlert("load error", - error, "OK", NULL, NULL, + "Error: %s"), ref->name, e.msg()); + BAlert* alert = new BAlert(B_TRANSLATE("load error"), + error, B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT); alert->Go(NULL); ret = B_ERROR; diff --git a/src/apps/icon-o-matic/shape/PathManipulator.cpp b/src/apps/icon-o-matic/shape/PathManipulator.cpp index 67c1274187..0bda294226 100644 --- a/src/apps/icon-o-matic/shape/PathManipulator.cpp +++ b/src/apps/icon-o-matic/shape/PathManipulator.cpp @@ -8,7 +8,9 @@ #include #include +#include #include +#include #include #include #include @@ -34,11 +36,15 @@ #include "SplitPointsCommand.h" #include "TransformPointsBox.h" + +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "Icon-O-Matic-PathManipulator" #define POINT_EXTEND 3.0 #define CONTROL_POINT_EXTEND 2.0 #define INSERT_DIST_THRESHOLD 7.0 #define MOVE_THRESHOLD 9.0 + enum { UNDEFINED, @@ -768,29 +774,29 @@ PathManipulator::ShowContextMenu(BPoint where) if (fCurrentPathPoint < 0) { message = new BMessage(B_SELECT_ALL); - item = new BMenuItem("Select All", message, 'A'); + item = new BMenuItem(B_TRANSLATE("Select All"), message, 'A'); menu->AddItem(item); menu->AddSeparatorItem(); } message = new BMessage(MSG_TRANSFORM); - item = new BMenuItem("Transform", message, 'T'); + item = new BMenuItem(B_TRANSLATE("Transform"), message, 'T'); item->SetEnabled(hasSelection); menu->AddItem(item); message = new BMessage(MSG_SPLIT_POINTS); - item = new BMenuItem("Split", message); + item = new BMenuItem(B_TRANSLATE("Split"), message); item->SetEnabled(hasSelection); menu->AddItem(item); message = new BMessage(MSG_FLIP_POINTS); - item = new BMenuItem("Flip", message); + item = new BMenuItem(B_TRANSLATE("Flip"), message); item->SetEnabled(hasSelection); menu->AddItem(item); message = new BMessage(MSG_REMOVE_POINTS); - item = new BMenuItem("Remove", message); + item = new BMenuItem(B_TRANSLATE("Remove"), message); item->SetEnabled(hasSelection); menu->AddItem(item); diff --git a/src/apps/icon-o-matic/shape/commands/AddPathsCommand.cpp b/src/apps/icon-o-matic/shape/commands/AddPathsCommand.cpp index 95d78c49a1..fea4322fd4 100644 --- a/src/apps/icon-o-matic/shape/commands/AddPathsCommand.cpp +++ b/src/apps/icon-o-matic/shape/commands/AddPathsCommand.cpp @@ -12,9 +12,17 @@ #include #include +#include +#include + #include "PathContainer.h" #include "VectorPath.h" + +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "Icon-O-Matic-AddPathsCmd" + + using std::nothrow; // constructor @@ -101,13 +109,13 @@ AddPathsCommand::GetName(BString& name) { if (fOwnsPaths) { if (fCount > 1) - name << "Add Paths"; + name << B_TRANSLATE("Add Paths"); else - name << "Add Path"; + name << B_TRANSLATE("Add Path"); } else { if (fCount > 1) - name << "Assign Paths"; + name << B_TRANSLATE("Assign Paths"); else - name << "Assign Path"; + name << B_TRANSLATE("Assign Path"); } } diff --git a/src/apps/icon-o-matic/shape/commands/AddPointCommand.cpp b/src/apps/icon-o-matic/shape/commands/AddPointCommand.cpp index fae59e4711..f5abe57034 100644 --- a/src/apps/icon-o-matic/shape/commands/AddPointCommand.cpp +++ b/src/apps/icon-o-matic/shape/commands/AddPointCommand.cpp @@ -10,8 +10,16 @@ #include +#include +#include + #include "VectorPath.h" + +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "Icon-O-Matic-AddPointCmd" + + // constructor AddPointCommand::AddPointCommand(VectorPath* path, int32 index, @@ -96,5 +104,5 @@ void AddPointCommand::GetName(BString& name) { // name << _GetString(ADD_CONTROL_POINT, "Add Control Point"); - name << "Add Control Point"; + name << B_TRANSLATE("Add Control Point"); } diff --git a/src/apps/icon-o-matic/shape/commands/AddShapesCommand.cpp b/src/apps/icon-o-matic/shape/commands/AddShapesCommand.cpp index 89090fda99..a5e0316903 100644 --- a/src/apps/icon-o-matic/shape/commands/AddShapesCommand.cpp +++ b/src/apps/icon-o-matic/shape/commands/AddShapesCommand.cpp @@ -12,10 +12,18 @@ #include #include +#include +#include + #include "Selection.h" #include "ShapeContainer.h" #include "Shape.h" + +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "Icon-O-Matic-AddShapesCmd" + + using std::nothrow; // constructor @@ -99,7 +107,7 @@ void AddShapesCommand::GetName(BString& name) { if (fCount > 1) - name << "Add Shapes"; + name << B_TRANSLATE("Add Shapes"); else - name << "Add Shape"; + name << B_TRANSLATE("Add Shape"); } diff --git a/src/apps/icon-o-matic/shape/commands/AddTransformersCommand.cpp b/src/apps/icon-o-matic/shape/commands/AddTransformersCommand.cpp index 0a6e9f809d..5c9bafed61 100644 --- a/src/apps/icon-o-matic/shape/commands/AddTransformersCommand.cpp +++ b/src/apps/icon-o-matic/shape/commands/AddTransformersCommand.cpp @@ -12,9 +12,17 @@ #include #include +#include +#include + #include "ShapeContainer.h" #include "Shape.h" + +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "Icon-O-Matic-AddTransformersCmd" + + using std::nothrow; // constructor @@ -97,7 +105,7 @@ void AddTransformersCommand::GetName(BString& name) { if (fCount > 1) - name << "Add Transformers"; + name << B_TRANSLATE("Add Transformers"); else - name << "Add Transformer"; + name << B_TRANSLATE("Add Transformer"); } diff --git a/src/apps/icon-o-matic/shape/commands/ChangePointCommand.cpp b/src/apps/icon-o-matic/shape/commands/ChangePointCommand.cpp index e684ca8425..d2e882e158 100644 --- a/src/apps/icon-o-matic/shape/commands/ChangePointCommand.cpp +++ b/src/apps/icon-o-matic/shape/commands/ChangePointCommand.cpp @@ -11,8 +11,16 @@ #include #include +#include +#include + #include "VectorPath.h" + +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "Icon-O-Matic-ChangePointCmd" + + using std::nothrow; // constructor @@ -118,5 +126,5 @@ void ChangePointCommand::GetName(BString& name) { // name << _GetString(MODIFY_CONTROL_POINT, "Modify Control Point"); - name << "Modify Control Point"; + name << B_TRANSLATE("Modify Control Point"); } diff --git a/src/apps/icon-o-matic/shape/commands/CleanUpPathCommand.cpp b/src/apps/icon-o-matic/shape/commands/CleanUpPathCommand.cpp index 49e0f77630..1d26cdcbee 100644 --- a/src/apps/icon-o-matic/shape/commands/CleanUpPathCommand.cpp +++ b/src/apps/icon-o-matic/shape/commands/CleanUpPathCommand.cpp @@ -10,8 +10,16 @@ #include +#include +#include + #include "VectorPath.h" + +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "Icon-O-Matic-CleanUpPathCmd" + + // constructor CleanUpPathCommand::CleanUpPathCommand(VectorPath* path) : PathCommand(path), @@ -48,5 +56,5 @@ CleanUpPathCommand::Undo() void CleanUpPathCommand::GetName(BString& name) { - name << "Clean Up Path"; + name << B_TRANSLATE("Clean Up Path"); } diff --git a/src/apps/icon-o-matic/shape/commands/FlipPointsCommand.cpp b/src/apps/icon-o-matic/shape/commands/FlipPointsCommand.cpp index 5df15d94fc..783bb5140d 100644 --- a/src/apps/icon-o-matic/shape/commands/FlipPointsCommand.cpp +++ b/src/apps/icon-o-matic/shape/commands/FlipPointsCommand.cpp @@ -11,8 +11,16 @@ #include #include +#include +#include + #include "VectorPath.h" + +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "Icon-O-Matic-FlipPointsCmd" + + using std::nothrow; // constructor @@ -104,8 +112,8 @@ void FlipPointsCommand::GetName(BString& name) { if (fCount > 1) - name << "Flip Control Points"; + name << B_TRANSLATE("Flip Control Points"); else - name << "Flip Control Point"; + name << B_TRANSLATE("Flip Control Point"); } diff --git a/src/apps/icon-o-matic/shape/commands/FreezeTransformationCommand.cpp b/src/apps/icon-o-matic/shape/commands/FreezeTransformationCommand.cpp index 526c9f4580..09c15555c4 100644 --- a/src/apps/icon-o-matic/shape/commands/FreezeTransformationCommand.cpp +++ b/src/apps/icon-o-matic/shape/commands/FreezeTransformationCommand.cpp @@ -12,11 +12,19 @@ #include #include +#include +#include + #include "GradientTransformable.h" #include "Shape.h" #include "Style.h" #include "VectorPath.h" + +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "Icon-O-Matic-FreezeTransformationCmd" + + using std::nothrow; // constructor @@ -111,9 +119,9 @@ void FreezeTransformationCommand::GetName(BString& name) { if (fCount > 1) - name << "Freeze Shapes"; + name << B_TRANSLATE("Freeze Shapes"); else - name << "Freeze Shape"; + name << B_TRANSLATE("Freeze Shape"); } // #pragma mark - diff --git a/src/apps/icon-o-matic/shape/commands/InsertPointCommand.cpp b/src/apps/icon-o-matic/shape/commands/InsertPointCommand.cpp index 9bce776f38..ad73e09e0c 100644 --- a/src/apps/icon-o-matic/shape/commands/InsertPointCommand.cpp +++ b/src/apps/icon-o-matic/shape/commands/InsertPointCommand.cpp @@ -11,8 +11,16 @@ #include #include +#include +#include + #include "VectorPath.h" + +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "Icon-O-Matic-InsertPointCmd" + + using std::nothrow; // constructor @@ -123,6 +131,6 @@ void InsertPointCommand::GetName(BString& name) { // name << _GetString(INSERT_CONTROL_POINT, "Insert Control Point"); - name << "Insert Control Point"; + name << B_TRANSLATE("Insert Control Point"); } diff --git a/src/apps/icon-o-matic/shape/commands/MovePathsCommand.cpp b/src/apps/icon-o-matic/shape/commands/MovePathsCommand.cpp index 2e6470d70c..cff1b6ce11 100644 --- a/src/apps/icon-o-matic/shape/commands/MovePathsCommand.cpp +++ b/src/apps/icon-o-matic/shape/commands/MovePathsCommand.cpp @@ -11,9 +11,17 @@ #include #include +#include +#include + #include "PathContainer.h" #include "VectorPath.h" + +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "Icon-O-Matic-MovePathsCmd" + + using std::nothrow; // constructor @@ -147,7 +155,7 @@ void MovePathsCommand::GetName(BString& name) { if (fCount > 1) - name << "Move Paths"; + name << B_TRANSLATE("Move Paths"); else - name << "Move Path"; + name << B_TRANSLATE("Move Path"); } diff --git a/src/apps/icon-o-matic/shape/commands/MoveShapesCommand.cpp b/src/apps/icon-o-matic/shape/commands/MoveShapesCommand.cpp index c347a354f5..b928a7c4e0 100644 --- a/src/apps/icon-o-matic/shape/commands/MoveShapesCommand.cpp +++ b/src/apps/icon-o-matic/shape/commands/MoveShapesCommand.cpp @@ -11,9 +11,17 @@ #include #include +#include +#include + #include "ShapeContainer.h" #include "Shape.h" + +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "Icon-O-Matic-MoveShapesCommand" + + using std::nothrow; // constructor @@ -151,7 +159,7 @@ MoveShapesCommand::GetName(BString& name) // else // name << _GetString(MOVE_MODIFIER, "Move Shape"); if (fCount > 1) - name << "Move Shapes"; + name << B_TRANSLATE("Move Shapes"); else - name << "Move Shape"; + name << B_TRANSLATE("Move Shape"); } diff --git a/src/apps/icon-o-matic/shape/commands/MoveTransformersCommand.cpp b/src/apps/icon-o-matic/shape/commands/MoveTransformersCommand.cpp index fe5fadc8b0..5936dea31e 100644 --- a/src/apps/icon-o-matic/shape/commands/MoveTransformersCommand.cpp +++ b/src/apps/icon-o-matic/shape/commands/MoveTransformersCommand.cpp @@ -11,9 +11,17 @@ #include #include +#include +#include + #include "Shape.h" #include "Transformer.h" + +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "Icon-O-Matic-MoveTransformersCmd" + + using std::nothrow; // constructor @@ -155,7 +163,7 @@ MoveTransformersCommand::GetName(BString& name) // else // name << _GetString(MOVE_TRANSFORMER, "Move Transformer"); if (fCount > 1) - name << "Move Transformers"; + name << B_TRANSLATE("Move Transformers"); else - name << "Move Transformer"; + name << B_TRANSLATE("Move Transformer"); } diff --git a/src/apps/icon-o-matic/shape/commands/NudgePointsCommand.cpp b/src/apps/icon-o-matic/shape/commands/NudgePointsCommand.cpp index 4e65ef97a6..ecd8a57adf 100644 --- a/src/apps/icon-o-matic/shape/commands/NudgePointsCommand.cpp +++ b/src/apps/icon-o-matic/shape/commands/NudgePointsCommand.cpp @@ -11,8 +11,16 @@ #include #include +#include +#include + #include "VectorPath.h" + +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "Icon-O-Matic-NudgePointsCommand" + + using std::nothrow; // constructor @@ -25,7 +33,8 @@ NudgePointsCommand::NudgePointsCommand(VectorPath* path, 0.0, 1.0, 1.0, - count > 1 ? "Nudge Control Points" : "Nudge Control Point", + count > 1 ? B_TRANSLATE("Nudge Control Points") : + B_TRANSLATE("Nudge Control Point"), // count > 1 ? NUDGE_CONTROL_POINTS : NUDGE_CONTROL_POINT), -1), fPath(path), diff --git a/src/apps/icon-o-matic/shape/commands/PathCommand.cpp b/src/apps/icon-o-matic/shape/commands/PathCommand.cpp index 3368049adc..966ede26dd 100644 --- a/src/apps/icon-o-matic/shape/commands/PathCommand.cpp +++ b/src/apps/icon-o-matic/shape/commands/PathCommand.cpp @@ -10,8 +10,16 @@ #include +#include +#include + #include "VectorPath.h" + +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "Icon-O-Matic-PathCmd" + + // constructor PathCommand::PathCommand(VectorPath* path) : fPath(path) @@ -35,7 +43,7 @@ void PathCommand::GetName(BString& name) { - name << (""); + name << B_TRANSLATE(""); } // _Select diff --git a/src/apps/icon-o-matic/shape/commands/RemovePathsCommand.cpp b/src/apps/icon-o-matic/shape/commands/RemovePathsCommand.cpp index c0bfd600c1..34d70f8440 100644 --- a/src/apps/icon-o-matic/shape/commands/RemovePathsCommand.cpp +++ b/src/apps/icon-o-matic/shape/commands/RemovePathsCommand.cpp @@ -11,10 +11,18 @@ #include #include +#include +#include + #include "PathContainer.h" #include "Shape.h" #include "VectorPath.h" + +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "Icon-O-Matic-RemovePathsCmd" + + using std::nothrow; // constructor @@ -122,7 +130,7 @@ void RemovePathsCommand::GetName(BString& name) { if (fCount > 1) - name << "Remove Paths"; + name << B_TRANSLATE("Remove Paths"); else - name << "Remove Path"; + name << B_TRANSLATE("Remove Path"); } diff --git a/src/apps/icon-o-matic/shape/commands/RemovePointsCommand.cpp b/src/apps/icon-o-matic/shape/commands/RemovePointsCommand.cpp index c75bcf8ba6..dace3ebd3b 100644 --- a/src/apps/icon-o-matic/shape/commands/RemovePointsCommand.cpp +++ b/src/apps/icon-o-matic/shape/commands/RemovePointsCommand.cpp @@ -11,8 +11,16 @@ #include #include +#include +#include + #include "VectorPath.h" + +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "Icon-O-Matic-RemovePointsCmd" + + using std::nothrow; // constructor @@ -158,9 +166,9 @@ RemovePointsCommand::GetName(BString& name) // else // name << _GetString(REMOVE_CONTROL_POINT, "Remove Control Point"); if (fCount > 1) - name << "Remove Control Points"; + name << B_TRANSLATE("Remove Control Points"); else - name << "Remove Control Point"; + name << B_TRANSLATE("Remove Control Point"); } // _Init diff --git a/src/apps/icon-o-matic/shape/commands/RemoveShapesCommand.cpp b/src/apps/icon-o-matic/shape/commands/RemoveShapesCommand.cpp index fc54a89ef4..166c375609 100644 --- a/src/apps/icon-o-matic/shape/commands/RemoveShapesCommand.cpp +++ b/src/apps/icon-o-matic/shape/commands/RemoveShapesCommand.cpp @@ -12,9 +12,17 @@ #include #include +#include +#include + #include "ShapeContainer.h" #include "Shape.h" + +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "Icon-O-Matic-RemoveShapesCmd" + + using std::nothrow; // constructor @@ -99,7 +107,7 @@ RemoveShapesCommand::GetName(BString& name) // else // name << _GetString(MOVE_MODIFIER, "Move Shape"); if (fCount > 1) - name << "Remove Shapes"; + name << B_TRANSLATE("Remove Shapes"); else - name << "Remove Shape"; + name << B_TRANSLATE("Remove Shape"); } diff --git a/src/apps/icon-o-matic/shape/commands/RemoveTransformersCommand.cpp b/src/apps/icon-o-matic/shape/commands/RemoveTransformersCommand.cpp index 2feb381d44..5aaf936204 100644 --- a/src/apps/icon-o-matic/shape/commands/RemoveTransformersCommand.cpp +++ b/src/apps/icon-o-matic/shape/commands/RemoveTransformersCommand.cpp @@ -12,9 +12,17 @@ #include #include +#include +#include + #include "ShapeContainer.h" #include "Shape.h" + +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "Icon-O-Matic-RemoveTransformersCmd" + + using std::nothrow; // constructor @@ -101,7 +109,7 @@ RemoveTransformersCommand::GetName(BString& name) // else // name << _GetString(MOVE_TRANSFORMER, "Move Transformer"); if (fCount > 1) - name << "Remove Transformers"; + name << B_TRANSLATE("Remove Transformers"); else - name << "Remove Transformer"; + name << B_TRANSLATE("Remove Transformer"); } diff --git a/src/apps/icon-o-matic/shape/commands/ReversePathCommand.cpp b/src/apps/icon-o-matic/shape/commands/ReversePathCommand.cpp index 24a4084ec8..9e94f543ae 100644 --- a/src/apps/icon-o-matic/shape/commands/ReversePathCommand.cpp +++ b/src/apps/icon-o-matic/shape/commands/ReversePathCommand.cpp @@ -10,8 +10,16 @@ #include +#include +#include + #include "VectorPath.h" + +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "Icon-O-Matic-ReversePathCmd" + + // constructor ReversePathCommand::ReversePathCommand(VectorPath* path) : PathCommand(path) @@ -43,5 +51,5 @@ ReversePathCommand::Undo() void ReversePathCommand::GetName(BString& name) { - name <<"Reverse Path"; + name << B_TRANSLATE("Reverse Path"); } diff --git a/src/apps/icon-o-matic/shape/commands/RotatePathIndicesCommand.cpp b/src/apps/icon-o-matic/shape/commands/RotatePathIndicesCommand.cpp index fafb5c5381..866fe12268 100644 --- a/src/apps/icon-o-matic/shape/commands/RotatePathIndicesCommand.cpp +++ b/src/apps/icon-o-matic/shape/commands/RotatePathIndicesCommand.cpp @@ -7,9 +7,16 @@ #include +#include +#include + #include "VectorPath.h" +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "Icon-O-Matic-RotatePathIndiciesCmd" + + RotatePathIndicesCommand::RotatePathIndicesCommand(VectorPath* path, bool clockWise) : @@ -51,7 +58,7 @@ RotatePathIndicesCommand::Undo() void RotatePathIndicesCommand::GetName(BString& name) { - name << "Rotate Path Indices"; + name << B_TRANSLATE("Rotate Path Indices"); } diff --git a/src/apps/icon-o-matic/shape/commands/SplitPointsCommand.cpp b/src/apps/icon-o-matic/shape/commands/SplitPointsCommand.cpp index 888c8833d1..80cbbfef70 100644 --- a/src/apps/icon-o-matic/shape/commands/SplitPointsCommand.cpp +++ b/src/apps/icon-o-matic/shape/commands/SplitPointsCommand.cpp @@ -11,8 +11,16 @@ #include #include +#include +#include + #include "VectorPath.h" + +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "Icon-O-Matic-SplitPointsCmd" + + using std::nothrow; // constructor @@ -147,8 +155,8 @@ void SplitPointsCommand::GetName(BString& name) { if (fCount > 1) - name << "Split Control Points"; + name << B_TRANSLATE("Split Control Points"); else - name << "Split Control Point"; + name << B_TRANSLATE("Split Control Point"); } diff --git a/src/apps/icon-o-matic/shape/commands/UnassignPathCommand.cpp b/src/apps/icon-o-matic/shape/commands/UnassignPathCommand.cpp index 3a3085db53..8a37d251ae 100644 --- a/src/apps/icon-o-matic/shape/commands/UnassignPathCommand.cpp +++ b/src/apps/icon-o-matic/shape/commands/UnassignPathCommand.cpp @@ -8,10 +8,18 @@ #include "UnassignPathCommand.h" +#include +#include + #include "PathContainer.h" #include "Shape.h" #include "VectorPath.h" + +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "Icon-O-Matic-UnassignPathCmd" + + // constructor UnassignPathCommand::UnassignPathCommand(Shape* shape, VectorPath* path) @@ -62,5 +70,5 @@ UnassignPathCommand::Undo() void UnassignPathCommand::GetName(BString& name) { - name << "Unassign Path"; + name << B_TRANSLATE("Unassign Path"); } diff --git a/src/apps/icon-o-matic/style/AddStylesCommand.cpp b/src/apps/icon-o-matic/style/AddStylesCommand.cpp index 4074623cb5..8e541d3287 100644 --- a/src/apps/icon-o-matic/style/AddStylesCommand.cpp +++ b/src/apps/icon-o-matic/style/AddStylesCommand.cpp @@ -12,9 +12,17 @@ #include #include +#include +#include + #include "StyleContainer.h" #include "Style.h" + +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "Icon-O-Matic-AddStylesCmd" + + using std::nothrow; // constructor @@ -93,7 +101,7 @@ void AddStylesCommand::GetName(BString& name) { if (fCount > 1) - name << "Add Styles"; + name << B_TRANSLATE("Add Styles"); else - name << "Add Style"; + name << B_TRANSLATE("Add Style"); } diff --git a/src/apps/icon-o-matic/style/AssignStyleCommand.cpp b/src/apps/icon-o-matic/style/AssignStyleCommand.cpp index 13c86c4c0c..aa6c9239b4 100644 --- a/src/apps/icon-o-matic/style/AssignStyleCommand.cpp +++ b/src/apps/icon-o-matic/style/AssignStyleCommand.cpp @@ -8,9 +8,17 @@ #include "AssignStyleCommand.h" +#include +#include + #include "Shape.h" #include "Style.h" + +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "Icon-O-Matic-AssignStyleCmd" + + // constructor AssignStyleCommand::AssignStyleCommand(Shape* shape, Style* style) @@ -63,7 +71,7 @@ AssignStyleCommand::Undo() void AssignStyleCommand::GetName(BString& name) { - name << "Assign Style"; + name << B_TRANSLATE("Assign Style"); if (fNewStyle) name << " \"" << fNewStyle->Name() << "\""; } diff --git a/src/apps/icon-o-matic/style/MoveStylesCommand.cpp b/src/apps/icon-o-matic/style/MoveStylesCommand.cpp index dbc7af2bd5..dd5c9ab898 100644 --- a/src/apps/icon-o-matic/style/MoveStylesCommand.cpp +++ b/src/apps/icon-o-matic/style/MoveStylesCommand.cpp @@ -11,9 +11,17 @@ #include #include +#include +#include + #include "StyleContainer.h" #include "Style.h" + +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "Icon-O-Matic-MoveStylesCmd" + + using std::nothrow; // constructor @@ -147,7 +155,7 @@ void MoveStylesCommand::GetName(BString& name) { if (fCount > 1) - name << "Move Styles"; + name << B_TRANSLATE("Move Styles"); else - name << "Move Style"; + name << B_TRANSLATE("Move Style"); } diff --git a/src/apps/icon-o-matic/style/RemoveStylesCommand.cpp b/src/apps/icon-o-matic/style/RemoveStylesCommand.cpp index ed0003a32c..6d84e8493e 100644 --- a/src/apps/icon-o-matic/style/RemoveStylesCommand.cpp +++ b/src/apps/icon-o-matic/style/RemoveStylesCommand.cpp @@ -11,10 +11,18 @@ #include #include +#include +#include + #include "StyleContainer.h" #include "Shape.h" #include "Style.h" + +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "Icon-O-Matic-RemoveStylesCmd" + + using std::nothrow; // constructor @@ -132,7 +140,7 @@ void RemoveStylesCommand::GetName(BString& name) { if (fCount > 1) - name << "Remove Styles"; + name << B_TRANSLATE("Remove Styles"); else - name << "Remove Style"; + name << B_TRANSLATE("Remove Style"); } diff --git a/src/apps/icon-o-matic/style/SetColorCommand.cpp b/src/apps/icon-o-matic/style/SetColorCommand.cpp index 614e6728b5..eefa71e22a 100644 --- a/src/apps/icon-o-matic/style/SetColorCommand.cpp +++ b/src/apps/icon-o-matic/style/SetColorCommand.cpp @@ -11,9 +11,17 @@ #include #include +#include +#include + #include "GradientTransformable.h" #include "Style.h" + +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "Icon-O-Matic-SetColorCmd" + + using std::nothrow; // constructor @@ -66,7 +74,7 @@ SetColorCommand::Undo() void SetColorCommand::GetName(BString& name) { - name << "Change Color"; + name << B_TRANSLATE("Change Color"); } // CombineWithNext diff --git a/src/apps/icon-o-matic/style/SetGradientCommand.cpp b/src/apps/icon-o-matic/style/SetGradientCommand.cpp index e9f2570797..20266453b8 100644 --- a/src/apps/icon-o-matic/style/SetGradientCommand.cpp +++ b/src/apps/icon-o-matic/style/SetGradientCommand.cpp @@ -11,9 +11,17 @@ #include #include +#include +#include + #include "GradientTransformable.h" #include "Style.h" + +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "Icon-O-Matic-SetGradientCmd" + + using std::nothrow; // constructor @@ -93,7 +101,7 @@ SetGradientCommand::Undo() void SetGradientCommand::GetName(BString& name) { - name << _GetString(/*EDIT_GRADIENT*/0, "Edit Gradient"); + name << B_TRANSLATE("Edit Gradient"); } // CombineWithNext diff --git a/src/apps/icon-o-matic/transformable/ResetTransformationCommand.cpp b/src/apps/icon-o-matic/transformable/ResetTransformationCommand.cpp index 5ea95a4a7d..a5899c0aae 100644 --- a/src/apps/icon-o-matic/transformable/ResetTransformationCommand.cpp +++ b/src/apps/icon-o-matic/transformable/ResetTransformationCommand.cpp @@ -11,8 +11,16 @@ #include #include +#include +#include + #include "ChannelTransform.h" + +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "Icon-O-Matic-ResetTransformationCmd" + + using std::nothrow; // constructor @@ -82,7 +90,7 @@ void ResetTransformationCommand::GetName(BString& name) { if (fCount > 1) - name << "Reset Transformations"; + name << B_TRANSLATE("Reset Transformations"); else - name << "Reset Transformation"; + name << B_TRANSLATE("Reset Transformation"); } diff --git a/src/apps/icon-o-matic/transformable/TransformBoxStates.cpp b/src/apps/icon-o-matic/transformable/TransformBoxStates.cpp index bfa023e9b3..6da9b60be5 100644 --- a/src/apps/icon-o-matic/transformable/TransformBoxStates.cpp +++ b/src/apps/icon-o-matic/transformable/TransformBoxStates.cpp @@ -11,8 +11,10 @@ #include #include +#include #include #include +#include #include #include "cursors.h" @@ -21,6 +23,10 @@ #include "TransformBox.h" +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "Icon-O-Matic-TransformationBoxStates" + + // constructor DragState::DragState(TransformBox* parent) : @@ -42,7 +48,7 @@ DragState::SetOrigin(BPoint origin) const char* DragState::ActionName() const { - return "Transformation"; + return B_TRANSLATE("Transformation"); } @@ -288,7 +294,7 @@ DragCornerState::UpdateViewCursor(BView* view, BPoint current) const const char* DragCornerState::ActionName() const { - return "Scale"; + return B_TRANSLATE("Scale"); } @@ -456,7 +462,7 @@ DragSideState::UpdateViewCursor(BView* view, BPoint current) const const char* DragSideState::ActionName() const { - return "Scale"; + return B_TRANSLATE("Scale"); } @@ -508,7 +514,7 @@ DragBoxState::UpdateViewCursor(BView* view, BPoint current) const const char* DragBoxState::ActionName() const { - return "Move"; + return B_TRANSLATE("Move"); } @@ -597,7 +603,7 @@ RotateBoxState::UpdateViewCursor(BView* view, BPoint current) const const char* RotateBoxState::ActionName() const { - return "Rotate"; + return B_TRANSLATE("Rotate"); } @@ -643,7 +649,7 @@ OffsetCenterState::UpdateViewCursor(BView* view, BPoint current) const const char* OffsetCenterState::ActionName() const { - return "Move Pivot"; + return B_TRANSLATE("Move Pivot"); }