Patch by Dziadek: localize IconOMatic

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40025 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Adrien Destugues
2010-12-29 10:41:46 +00:00
parent 54526b1534
commit 518852fca7
49 changed files with 717 additions and 225 deletions
+26 -10
View File
@@ -13,12 +13,14 @@
#include <string.h> #include <string.h>
#include <Alert.h> #include <Alert.h>
#include <Catalog.h>
#include <Directory.h> #include <Directory.h>
#include <Entry.h> #include <Entry.h>
#include <File.h> #include <File.h>
#include <FilePanel.h> #include <FilePanel.h>
#include <fs_attr.h> #include <fs_attr.h>
#include <IconEditorProtocol.h> #include <IconEditorProtocol.h>
#include <Locale.h>
#include <Message.h> #include <Message.h>
#include <Mime.h> #include <Mime.h>
@@ -49,6 +51,11 @@
#include "SVGExporter.h" #include "SVGExporter.h"
#include "SVGImporter.h" #include "SVGImporter.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Icon-O-Matic-Main"
using std::nothrow; using std::nothrow;
static const char* kAppSig = "application/x-vnd.haiku-icon_o_matic"; 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()) if (fDocument->IsEmpty() || fDocument->CommandStack()->IsSaved())
return true; return true;
BAlert* alert = new BAlert("save", "Save changes to current icon?", BAlert* alert = new BAlert("save",
"Discard", "Cancel", "Save"); B_TRANSLATE("Save changes to current icon?"), B_TRANSLATE("Discard"),
B_TRANSLATE("Cancel"), B_TRANSLATE("Save"));
int32 choice = alert->Go(); int32 choice = alert->Go();
switch (choice) { switch (choice) {
case 0: case 0:
@@ -437,10 +445,14 @@ IconEditorApp::_Open(const entry_ref& ref, bool append)
if (ret < B_OK) { if (ret < B_OK) {
// inform user of failure at this point // inform user of failure at this point
BString helper("Opening the document failed!"); BString helper(B_TRANSLATE("Opening the document failed!"));
helper << "\n\n" << "Error: " << strerror(ret); helper << "\n\n" << B_TRANSLATE("Error: ") << strerror(ret);
BAlert* alert = new BAlert("bad news", helper.String(), BAlert* alert = new BAlert(
"Bummer", NULL, NULL); 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 // launch alert asynchronously
alert->Go(NULL); alert->Go(NULL);
@@ -520,10 +532,14 @@ IconEditorApp::_Open(const BMessenger& externalObserver, const uint8* data,
if (ret < B_OK) { if (ret < B_OK) {
// inform user of failure at this point // inform user of failure at this point
BString helper("Opening the icon failed!"); BString helper(B_TRANSLATE("Opening the icon failed!"));
helper << "\n\n" << "Error: " << strerror(ret); helper << "\n\n" << B_TRANSLATE("Error: ") << strerror(ret);
BAlert* alert = new BAlert("bad news", helper.String(), BAlert* alert = new BAlert(
"Bummer", NULL, NULL); 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 // launch alert asynchronously
alert->Go(NULL); alert->Go(NULL);
+55 -1
View File
@@ -299,7 +299,61 @@ Application Icon-O-Matic :
MainWindow.cpp MainWindow.cpp
Util.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 : 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
;
+64 -29
View File
@@ -18,6 +18,8 @@
#include <Message.h> #include <Message.h>
#include <Screen.h> #include <Screen.h>
#include <ScrollView.h> #include <ScrollView.h>
#include <Catalog.h>
#include <Locale.h>
#include "support_ui.h" #include "support_ui.h"
@@ -61,6 +63,10 @@
#include "StyledTextImporter.h" #include "StyledTextImporter.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Icon-O-Matic-Main"
using std::nothrow; using std::nothrow;
enum { enum {
@@ -130,7 +136,9 @@ MainWindow::MessageReceived(BMessage* message)
if (len != sizeof(rgb_color)) if (len != sizeof(rgb_color))
continue; continue;
char name[30]; 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); color->red, color->green, color->blue);
Style* style = new (nothrow) Style(*color); Style* style = new (nothrow) Style(*color);
style->SetName(name); style->SetName(name);
@@ -259,19 +267,25 @@ MainWindow::MessageReceived(BMessage* message)
commands[1] = pathCommand; commands[1] = pathCommand;
commands[2] = shapeCommand; commands[2] = shapeCommand;
command = new CompoundCommand(commands, 3, 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) { } else if (styleCommand) {
Command** commands = new Command*[2]; Command** commands = new Command*[2];
commands[0] = styleCommand; commands[0] = styleCommand;
commands[1] = shapeCommand; commands[1] = shapeCommand;
command = new CompoundCommand(commands, 2, 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 { } else {
Command** commands = new Command*[2]; Command** commands = new Command*[2];
commands[0] = pathCommand; commands[0] = pathCommand;
commands[1] = shapeCommand; commands[1] = shapeCommand;
command = new CompoundCommand(commands, 2, 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 { } else {
command = shapeCommand; command = shapeCommand;
@@ -426,20 +440,22 @@ MainWindow::ObjectChanged(const Observable* object)
if (object == fDocument->CommandStack()) { if (object == fDocument->CommandStack()) {
// relable Undo item and update enabled status // relable Undo item and update enabled status
BString label("Undo"); BString label(B_TRANSLATE("Undo"));
fUndoMI->SetEnabled(fDocument->CommandStack()->GetUndoName(label)); fUndoMI->SetEnabled(fDocument->CommandStack()->GetUndoName(label));
if (fUndoMI->IsEnabled()) if (fUndoMI->IsEnabled())
fUndoMI->SetLabel(label.String()); fUndoMI->SetLabel(label.String());
else else
fUndoMI->SetLabel("<nothing to undo>"); fUndoMI->SetLabel(B_TRANSLATE_WITH_CONTEXT("<nothing to undo>",
"Icon-O-Matic-Menu-Edit"));
// relable Redo item and update enabled status // relable Redo item and update enabled status
label.SetTo("Redo"); label.SetTo(B_TRANSLATE("Redo"));
fRedoMI->SetEnabled(fDocument->CommandStack()->GetRedoName(label)); fRedoMI->SetEnabled(fDocument->CommandStack()->GetRedoName(label));
if (fRedoMI->IsEnabled()) if (fRedoMI->IsEnabled())
fRedoMI->SetLabel(label.String()); fRedoMI->SetLabel(label.String());
else else
fRedoMI->SetLabel("<nothing to redo>"); fRedoMI->SetLabel(B_TRANSLATE_WITH_CONTEXT("<nothing to redo>",
"Icon-O-Matic-Menu-Edit"));
} }
Unlock(); Unlock();
@@ -769,52 +785,66 @@ MainWindow::_CreateGUI(BRect bounds)
swatchGroupView->MinSize().height)); swatchGroupView->MinSize().height));
} }
BMenuBar* BMenuBar*
MainWindow::_CreateMenuBar(BRect frame) MainWindow::_CreateMenuBar(BRect frame)
{ {
BMenuBar* menuBar = new BMenuBar(frame, "main menu"); BMenuBar* menuBar = new BMenuBar(frame, "main menu");
BMenu* fileMenu = new BMenu("File");
BMenu* editMenu = new BMenu("Edit"); #undef B_TRANSLATE_CONTEXT
BMenu* settingsMenu = new BMenu("Options"); #define B_TRANSLATE_CONTEXT "Icon-O-Matic-Menus"
fPathMenu = new BMenu("Path");
fStyleMenu = new BMenu("Style");
fShapeMenu = new BMenu("Shape"); BMenu* fileMenu = new BMenu(B_TRANSLATE("File"));
fTransformerMenu = new BMenu("Transformer"); BMenu* editMenu = new BMenu(B_TRANSLATE("Edit"));
fPropertyMenu = new BMenu("Properties"); BMenu* settingsMenu = new BMenu(B_TRANSLATE("Options"));
fSwatchMenu = new BMenu("Swatches"); 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(fileMenu);
menuBar->AddItem(editMenu); menuBar->AddItem(editMenu);
menuBar->AddItem(settingsMenu); menuBar->AddItem(settingsMenu);
// File // 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')); 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')); 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)); new BMessage(MSG_APPEND), 'O', B_SHIFT_KEY));
fileMenu->AddSeparatorItem(); fileMenu->AddSeparatorItem();
fileMenu->AddItem(new BMenuItem("Save", fileMenu->AddItem(new BMenuItem(B_TRANSLATE("Save"),
new BMessage(MSG_SAVE), 'S')); 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)); new BMessage(MSG_SAVE_AS), 'S', B_SHIFT_KEY));
fileMenu->AddSeparatorItem(); fileMenu->AddSeparatorItem();
fileMenu->AddItem(new BMenuItem("Export", fileMenu->AddItem(new BMenuItem(B_TRANSLATE("Export"),
new BMessage(MSG_EXPORT), 'P')); 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)); new BMessage(MSG_EXPORT_AS), 'P', B_SHIFT_KEY));
fileMenu->AddSeparatorItem(); fileMenu->AddSeparatorItem();
fileMenu->AddItem(new BMenuItem("Quit", fileMenu->AddItem(new BMenuItem(B_TRANSLATE("Quit"),
new BMessage(B_QUIT_REQUESTED), 'Q')); new BMessage(B_QUIT_REQUESTED), 'Q'));
fileMenu->SetTargetForItems(be_app); fileMenu->SetTargetForItems(be_app);
// Edit // Edit
fUndoMI = new BMenuItem("<nothing to undo>", #undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Icon-O-Matic-Menu-Edit"
fUndoMI = new BMenuItem(B_TRANSLATE("<nothing to undo>"),
new BMessage(MSG_UNDO), 'Z'); new BMessage(MSG_UNDO), 'Z');
fRedoMI = new BMenuItem("<nothing to redo>", fRedoMI = new BMenuItem(B_TRANSLATE("<nothing to redo>"),
new BMessage(MSG_REDO), 'Z', B_SHIFT_KEY); new BMessage(MSG_REDO), 'Z', B_SHIFT_KEY);
fUndoMI->SetEnabled(false); fUndoMI->SetEnabled(false);
@@ -823,8 +853,13 @@ MainWindow::_CreateMenuBar(BRect frame)
editMenu->AddItem(fUndoMI); editMenu->AddItem(fUndoMI);
editMenu->AddItem(fRedoMI); editMenu->AddItem(fRedoMI);
// Settings // 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); BMessage* message = new BMessage(MSG_MOUSE_FILTER_MODE);
message->AddInt32("mode", SNAPPING_OFF); message->AddInt32("mode", SNAPPING_OFF);
filterModeMenu->AddItem(new BMenuItem("Off", message, '4')); filterModeMenu->AddItem(new BMenuItem("Off", message, '4'));
@@ -10,11 +10,19 @@
#include <stdio.h> #include <stdio.h>
#include <Catalog.h>
#include <Locale.h>
#include "CommonPropertyIDs.h" #include "CommonPropertyIDs.h"
#include "IconObject.h" #include "IconObject.h"
#include "Property.h" #include "Property.h"
#include "PropertyObject.h" #include "PropertyObject.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Icon-O-Matic-Properties"
// constructor // constructor
SetPropertiesCommand::SetPropertiesCommand(IconObject** objects, SetPropertiesCommand::SetPropertiesCommand(IconObject** objects,
int32 objectCount, int32 objectCount,
@@ -75,15 +83,17 @@ SetPropertiesCommand::GetName(BString& name)
{ {
if (fOldProperties->CountProperties() > 1) { if (fOldProperties->CountProperties() > 1) {
if (fObjectCount > 1) if (fObjectCount > 1)
name << "Multi Paste Properties"; name << B_TRANSLATE("Multi Paste Properties");
else else
name << "Paste Properties"; name << B_TRANSLATE("Paste Properties");
} else { } else {
BString property = name_for_id( BString property = name_for_id(
fOldProperties->PropertyAt(0)->Identifier()); fOldProperties->PropertyAt(0)->Identifier());
if (fObjectCount > 1) if (fObjectCount > 1)
name << "Multi Set " << property; name << B_TRANSLATE_WITH_CONTEXT("Multi Set ",
"Multi Set (property name)") << property;
else else
name << "Set " << property; name << B_TRANSLATE_WITH_CONTEXT("Set ", "Set (property name)")
<< property;
} }
} }
@@ -9,6 +9,8 @@
#include <stdio.h> #include <stdio.h>
#include <Application.h> #include <Application.h>
#include <Catalog.h>
#include <Locale.h>
#if LIB_LAYOUT #if LIB_LAYOUT
# include <MBorder.h> # include <MBorder.h>
@@ -25,6 +27,11 @@
#include "ColorPickerView.h" #include "ColorPickerView.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Icon-O-Matic-ColorPicker"
enum { enum {
MSG_CANCEL = 'cncl', MSG_CANCEL = 'cncl',
MSG_DONE = 'done', MSG_DONE = 'done',
@@ -43,12 +50,13 @@ ColorPickerPanel::ColorPickerPanel(BRect frame, rgb_color color,
fMessage(message), fMessage(message),
fTarget(target) fTarget(target)
{ {
SetTitle("Pick a color"); SetTitle(B_TRANSLATE("Pick a color"));
fColorPickerView = new ColorPickerView("color picker", color, mode); fColorPickerView = new ColorPickerView("color picker", color, mode);
#if LIB_LAYOUT #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 // interface layout
BView* topView = new VGroup ( BView* topView = new VGroup (
@@ -57,7 +65,8 @@ ColorPickerPanel::ColorPickerPanel(BRect frame, rgb_color color,
M_RAISED_BORDER, 5, "buttons", M_RAISED_BORDER, 5, "buttons",
new HGroup ( new HGroup (
new Space(minimax(0.0, 0.0, 10000.0, 10000.0, 5.0)), 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)), new Space(minimax(5.0, 0.0, 10.0, 10000.0, 1.0)),
defaultButton, defaultButton,
new Space(minimax(2.0, 0.0, 2.0, 10000.0, 0.0)), 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 #else // LIB_LAYOUT
frame = BRect(0, 0, 40, 15); frame = BRect(0, 0, 40, 15);
BButton* defaultButton = new BButton(frame, "ok button", "OK", BButton* defaultButton = new BButton(frame, "ok button",
new BMessage(MSG_DONE), B_TRANSLATE("OK"), new BMessage(MSG_DONE),
B_FOLLOW_RIGHT | B_FOLLOW_TOP); B_FOLLOW_RIGHT | B_FOLLOW_TOP);
defaultButton->ResizeToPreferred(); defaultButton->ResizeToPreferred();
BButton* cancelButton = new BButton(frame, "cancel button", "Cancel", BButton* cancelButton = new BButton(frame, "cancel button",
new BMessage(MSG_CANCEL), B_TRANSLATE("Cancel"), new BMessage(MSG_CANCEL),
B_FOLLOW_RIGHT | B_FOLLOW_TOP); B_FOLLOW_RIGHT | B_FOLLOW_TOP);
cancelButton->ResizeToPreferred(); cancelButton->ResizeToPreferred();
frame.bottom = frame.top + (defaultButton->Frame().Height() + 16); frame.bottom = frame.top + (defaultButton->Frame().Height() + 16);
@@ -12,6 +12,14 @@
#include <debugger.h> #include <debugger.h>
#include <Catalog.h>
#include <Locale.h>
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Icon-O-Matic-PropertyNames"
// name_for_id // name_for_id
const char* const char*
name_for_id(int32 id) name_for_id(int32 id)
@@ -19,75 +27,75 @@ name_for_id(int32 id)
const char* name = NULL; const char* name = NULL;
switch (id) { switch (id) {
case PROPERTY_NAME: case PROPERTY_NAME:
name = "Name"; name = B_TRANSLATE("Name");
break; break;
case PROPERTY_OPACITY: case PROPERTY_OPACITY:
name = "Opacity"; name = B_TRANSLATE("Opacity");
break; break;
case PROPERTY_COLOR: case PROPERTY_COLOR:
name = "Color"; name = B_TRANSLATE("Color");
break; break;
case PROPERTY_WIDTH: case PROPERTY_WIDTH:
name = "Width"; name = B_TRANSLATE("Width");
break; break;
case PROPERTY_HEIGHT: case PROPERTY_HEIGHT:
name = "Height"; name = B_TRANSLATE("Height");
break; break;
case PROPERTY_CAP_MODE: case PROPERTY_CAP_MODE:
name = "Caps"; name = B_TRANSLATE("Caps");
break; break;
case PROPERTY_JOIN_MODE: case PROPERTY_JOIN_MODE:
name = "Joins"; name = B_TRANSLATE("Joins");
break; break;
case PROPERTY_MITER_LIMIT: case PROPERTY_MITER_LIMIT:
name = "Miter Limit"; name = B_TRANSLATE("Miter Limit");
break; break;
case PROPERTY_STROKE_SHORTEN: case PROPERTY_STROKE_SHORTEN:
name = "Shorten"; name = B_TRANSLATE("Shorten");
break; break;
case PROPERTY_CLOSED: case PROPERTY_CLOSED:
name = "Closed"; name = B_TRANSLATE("Closed");
break; break;
case PROPERTY_PATH: case PROPERTY_PATH:
name = "Path"; name = B_TRANSLATE("Path");
break; break;
case PROPERTY_HINTING: case PROPERTY_HINTING:
name = "Rounding"; name = B_TRANSLATE("Rounding");
break; break;
case PROPERTY_MIN_VISIBILITY_SCALE: case PROPERTY_MIN_VISIBILITY_SCALE:
name = "Min LOD"; name = B_TRANSLATE("Min LOD");
break; break;
case PROPERTY_MAX_VISIBILITY_SCALE: case PROPERTY_MAX_VISIBILITY_SCALE:
name = "Max LOD"; name = B_TRANSLATE("Max LOD");
break; break;
case PROPERTY_TRANSLATION_X: case PROPERTY_TRANSLATION_X:
name = "Translation X"; name = B_TRANSLATE("Translation X");
break; break;
case PROPERTY_TRANSLATION_Y: case PROPERTY_TRANSLATION_Y:
name = "Translation Y"; name = B_TRANSLATE("Translation Y");
break; break;
case PROPERTY_ROTATION: case PROPERTY_ROTATION:
name = "Rotation"; name = B_TRANSLATE("Rotation");
break; break;
case PROPERTY_SCALE_X: case PROPERTY_SCALE_X:
name = "Scale X"; name = B_TRANSLATE("Scale X");
break; break;
case PROPERTY_SCALE_Y: case PROPERTY_SCALE_Y:
name = "Scale Y"; name = B_TRANSLATE("Scale Y");
break; break;
case PROPERTY_DETECT_ORIENTATION: case PROPERTY_DETECT_ORIENTATION:
name = "Detect Orient."; name = B_TRANSLATE("Detect Orient.");
break; break;
default: default:
name = "<unkown property>"; name = B_TRANSLATE("<unkown property>");
break; break;
} }
return name; return name;
@@ -11,10 +11,12 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <Catalog.h>
#include <Clipboard.h> #include <Clipboard.h>
#ifdef __HAIKU__ #ifdef __HAIKU__
# include <LayoutUtils.h> # include <LayoutUtils.h>
#endif #endif
#include <Locale.h>
#include <Menu.h> #include <Menu.h>
#include <MenuItem.h> #include <MenuItem.h>
#include <Message.h> #include <Message.h>
@@ -29,6 +31,11 @@
#include "Scroller.h" #include "Scroller.h"
#include "ScrollView.h" #include "ScrollView.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Icon-O-Matic-Properties"
enum { enum {
MSG_COPY_PROPERTIES = 'cppr', MSG_COPY_PROPERTIES = 'cppr',
MSG_PASTE_PROPERTIES = 'pspr', MSG_PASTE_PROPERTIES = 'pspr',
@@ -315,12 +322,15 @@ PropertyListView::SetMenu(BMenu* menu)
if (!fPropertyM) if (!fPropertyM)
return; return;
fSelectM = new BMenu("Select"); fSelectM = new BMenu(B_TRANSLATE("Select"));
fSelectAllMI = new BMenuItem("All", new BMessage(MSG_SELECT_ALL)); fSelectAllMI = new BMenuItem(B_TRANSLATE("All"),
new BMessage(MSG_SELECT_ALL));
fSelectM->AddItem(fSelectAllMI); 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); 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->AddItem(fInvertSelectionMI);
fSelectM->SetTargetForItems(this); fSelectM->SetTargetForItems(this);
@@ -328,9 +338,11 @@ PropertyListView::SetMenu(BMenu* menu)
fPropertyM->AddSeparatorItem(); 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); 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->AddItem(fPasteMI);
fPropertyM->SetTargetForItems(this); fPropertyM->SetTargetForItems(this);
@@ -728,10 +740,10 @@ PropertyListView::_CheckMenuStatus()
// LanguageManager* m = LanguageManager::Default(); // LanguageManager* m = LanguageManager::Default();
if (IsEditingMultipleObjects()) if (IsEditingMultipleObjects())
// fPasteMI->SetLabel(m->GetString(MULTI_PASTE, "Multi paste")); // fPasteMI->SetLabel(m->GetString(MULTI_PASTE, "Multi paste"));
fPasteMI->SetLabel("Multi paste"); fPasteMI->SetLabel(B_TRANSLATE("Multi paste"));
else else
// fPasteMI->SetLabel(m->GetString(PASTE, "Paste")); // fPasteMI->SetLabel(m->GetString(PASTE, "Paste"));
fPasteMI->SetLabel("Paste"); fPasteMI->SetLabel(B_TRANSLATE("Paste"));
bool enableMenu = fPropertyObject; bool enableMenu = fPropertyObject;
if (fPropertyM->IsEnabled() != enableMenu) if (fPropertyM->IsEnabled() != enableMenu)
@@ -12,6 +12,9 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <Catalog.h>
#include <Locale.h>
#include "CommandStack.h" #include "CommandStack.h"
#include "CommonPropertyIDs.h" #include "CommonPropertyIDs.h"
#include "IconObject.h" #include "IconObject.h"
@@ -21,6 +24,11 @@
#include "Selection.h" #include "Selection.h"
#include "SetPropertiesCommand.h" #include "SetPropertiesCommand.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Icon-O-Matic-PropertiesList"
using std::nothrow; using std::nothrow;
// constructor // constructor
@@ -51,9 +59,12 @@ IconObjectListView::Draw(BRect updateRect)
return; return;
// display helpful messages // display helpful messages
const char* message1 = "Click on an object in"; const char* message1 = B_TRANSLATE_WITH_CONTEXT(
const char* message2 = "any of the other lists to"; "Click on an object in", "Empty property list - 1st line");
const char* message3 = "edit it's properties here."; 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)); SetHighColor(tint_color(LowColor(), B_DARKEN_2_TINT));
font_height fh; font_height fh;
+22 -9
View File
@@ -12,7 +12,9 @@
#include <stdio.h> #include <stdio.h>
#include <Application.h> #include <Application.h>
#include <Catalog.h>
#include <ListItem.h> #include <ListItem.h>
#include <Locale.h>
#include <Menu.h> #include <Menu.h>
#include <MenuItem.h> #include <MenuItem.h>
#include <Message.h> #include <Message.h>
@@ -34,6 +36,11 @@
#include "Util.h" #include "Util.h"
#include "VectorPath.h" #include "VectorPath.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Icon-O-Matic-PathsList"
using std::nothrow; using std::nothrow;
static const float kMarkWidth = 14.0; static const float kMarkWidth = 14.0;
@@ -728,20 +735,26 @@ PathListView::SetMenu(BMenu* menu)
if (fMenu == NULL) if (fMenu == NULL)
return; return;
fAddMI = new BMenuItem("Add", new BMessage(MSG_ADD)); fAddMI = new BMenuItem(B_TRANSLATE("Add"),
fAddRectMI = new BMenuItem("Add rect", new BMessage(MSG_ADD_RECT)); new BMessage(MSG_ADD));
fAddCircleMI = new BMenuItem("Add circle"/*B_UTF8_ELLIPSIS*/, 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)); new BMessage(MSG_ADD_CIRCLE));
// fAddArcMI = new BMenuItem("Add arc"B_UTF8_ELLIPSIS, // fAddArcMI = new BMenuItem("Add arc"B_UTF8_ELLIPSIS,
// new BMessage(MSG_ADD_ARC)); // new BMessage(MSG_ADD_ARC));
fDuplicateMI = new BMenuItem("Duplicate", new BMessage(MSG_DUPLICATE)); fDuplicateMI = new BMenuItem(B_TRANSLATE("Duplicate"),
fReverseMI = new BMenuItem("Reverse", new BMessage(MSG_REVERSE)); new BMessage(MSG_DUPLICATE));
fCleanUpMI = new BMenuItem("Clean up", new BMessage(MSG_CLEAN_UP)); fReverseMI = new BMenuItem(B_TRANSLATE("Reverse"),
fRotateIndicesRightMI = new BMenuItem("Rotate indices right", 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'); 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); 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(fAddMI);
fMenu->AddItem(fAddRectMI); fMenu->AddItem(fAddRectMI);
+40 -27
View File
@@ -13,6 +13,8 @@
#include <Alert.h> #include <Alert.h>
#include <Button.h> #include <Button.h>
#include <Catalog.h>
#include <Locale.h>
#include <MenuBar.h> #include <MenuBar.h>
#include <MenuField.h> #include <MenuField.h>
#include <PopUpMenu.h> #include <PopUpMenu.h>
@@ -26,6 +28,11 @@
#include "IconEditorApp.h" #include "IconEditorApp.h"
#include "Panel.h" #include "Panel.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Icon-O-Matic-SavePanel"
enum { enum {
MSG_FORMAT = 'sfpf', MSG_FORMAT = 'sfpf',
MSG_SETTINGS = 'sfps', MSG_SETTINGS = 'sfps',
@@ -88,10 +95,12 @@ SavePanel::SavePanel(const char* name,
be_plain_font->GetHeight(&fh); be_plain_font->GetHeight(&fh);
rect.bottom = rect.top + fh.ascent + fh.descent + 5.0; rect.bottom = rect.top + fh.ascent + fh.descent + 5.0;
fFormatMF = new BMenuField(rect, "format popup", "Format", fFormatM, true, fFormatMF = new BMenuField(rect, "format popup", B_TRANSLATE("Format"),
B_FOLLOW_LEFT | B_FOLLOW_BOTTOM, fFormatM, true,
B_WILL_DRAW | B_NAVIGABLE); B_FOLLOW_LEFT | B_FOLLOW_BOTTOM,
fFormatMF->SetDivider(be_plain_font->StringWidth("Format") + 7); B_WILL_DRAW | B_NAVIGABLE);
fFormatMF->SetDivider(be_plain_font->StringWidth(
B_TRANSLATE("Format")) + 7);
fFormatMF->MenuBar()->ResizeToPreferred(); fFormatMF->MenuBar()->ResizeToPreferred();
fFormatMF->ResizeToPreferred(); fFormatMF->ResizeToPreferred();
@@ -120,9 +129,11 @@ SavePanel::SavePanel(const char* name,
// Build the "Settings" button relative to the format menu // Build the "Settings" button relative to the format menu
rect = cancel->Frame(); rect = cancel->Frame();
rect.OffsetTo(fFormatMF->Frame().right + 5.0, rect.top); 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), 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(); fSettingsB->ResizeToPreferred();
background->AddChild(fSettingsB); background->AddChild(fSettingsB);
fSettingsB->SetTarget(this); fSettingsB->SetTarget(this);
@@ -195,7 +206,7 @@ SavePanel::SetExportMode(bool exportMode)
fFormatMF->SetEnabled(true); fFormatMF->SetEnabled(true);
SetExportMode(fExportMode); SetExportMode(fExportMode);
_EnableSettings(); _EnableSettings();
helper << "Export Icon"; helper << B_TRANSLATE_WITH_CONTEXT("Export Icon", "Dialog title");
} else { } else {
fExportMode = ExportMode(); fExportMode = ExportMode();
// does not overwrite fExportMode in case we already were // does not overwrite fExportMode in case we already were
@@ -204,7 +215,7 @@ SavePanel::SetExportMode(bool exportMode)
fFormatMF->SetEnabled(false); fFormatMF->SetEnabled(false);
fSettingsB->SetEnabled(false); fSettingsB->SetEnabled(false);
helper << "Save Icon"; helper << B_TRANSLATE_WITH_CONTEXT("Save Icon", "Dialog title");
} }
window->Unlock(); window->Unlock();
@@ -372,51 +383,53 @@ SavePanel::_ExportSettings()
void void
SavePanel::_BuildMenu() SavePanel::_BuildMenu()
{ {
fFormatM = new BPopUpMenu("Format"); fFormatM = new BPopUpMenu(B_TRANSLATE("Format"));
fNativeMI = new SaveItem("Icon-O-Matic", new BMessage(MSG_FORMAT), fNativeMI = new SaveItem("Icon-O-Matic",
EXPORT_MODE_MESSAGE); new BMessage(MSG_FORMAT), EXPORT_MODE_MESSAGE);
fFormatM->AddItem(fNativeMI); fFormatM->AddItem(fNativeMI);
fNativeMI->SetEnabled(false); fNativeMI->SetEnabled(false);
fFormatM->AddSeparatorItem(); fFormatM->AddSeparatorItem();
fHVIFMI = new SaveItem("HVIF", new BMessage(MSG_FORMAT), fHVIFMI = new SaveItem("HVIF",
EXPORT_MODE_FLAT_ICON); new BMessage(MSG_FORMAT), EXPORT_MODE_FLAT_ICON);
fFormatM->AddItem(fHVIFMI); fFormatM->AddItem(fHVIFMI);
fRDefMI = new SaveItem("HVIF RDef", new BMessage(MSG_FORMAT), fRDefMI = new SaveItem("HVIF RDef",
EXPORT_MODE_ICON_RDEF); new BMessage(MSG_FORMAT), EXPORT_MODE_ICON_RDEF);
fFormatM->AddItem(fRDefMI); fFormatM->AddItem(fRDefMI);
fSourceMI = new SaveItem("HVIF Source Code", new BMessage(MSG_FORMAT), fSourceMI = new SaveItem(B_TRANSLATE("HVIF Source Code"),
EXPORT_MODE_ICON_SOURCE); new BMessage(MSG_FORMAT), EXPORT_MODE_ICON_SOURCE);
fFormatM->AddItem(fSourceMI); fFormatM->AddItem(fSourceMI);
fFormatM->AddSeparatorItem(); fFormatM->AddSeparatorItem();
fSVGMI = new SaveItem("SVG", new BMessage(MSG_FORMAT), fSVGMI = new SaveItem("SVG",
EXPORT_MODE_SVG); new BMessage(MSG_FORMAT), EXPORT_MODE_SVG);
fFormatM->AddItem(fSVGMI); fFormatM->AddItem(fSVGMI);
fFormatM->AddSeparatorItem(); fFormatM->AddSeparatorItem();
fBitmapMI = new SaveItem("PNG", new BMessage(MSG_FORMAT), fBitmapMI = new SaveItem("PNG",
EXPORT_MODE_BITMAP); new BMessage(MSG_FORMAT), EXPORT_MODE_BITMAP);
fFormatM->AddItem(fBitmapMI); fFormatM->AddItem(fBitmapMI);
fBitmapSetMI = new SaveItem("PNG Set", new BMessage(MSG_FORMAT), fBitmapSetMI = new SaveItem(B_TRANSLATE("PNG Set"),
EXPORT_MODE_BITMAP_SET); new BMessage(MSG_FORMAT), EXPORT_MODE_BITMAP_SET);
fFormatM->AddItem(fBitmapSetMI); fFormatM->AddItem(fBitmapSetMI);
fFormatM->AddSeparatorItem(); fFormatM->AddSeparatorItem();
fIconAttrMI = new SaveItem("BEOS:ICON Attribute", new BMessage(MSG_FORMAT), fIconAttrMI = new SaveItem(B_TRANSLATE("BEOS:ICON Attribute"),
EXPORT_MODE_ICON_ATTR); new BMessage(MSG_FORMAT), EXPORT_MODE_ICON_ATTR);
fFormatM->AddItem(fIconAttrMI); fFormatM->AddItem(fIconAttrMI);
fIconMimeAttrMI = new SaveItem("META:ICON Attribute", new BMessage(MSG_FORMAT), fIconMimeAttrMI = new SaveItem(B_TRANSLATE("META:ICON Attribute"),
EXPORT_MODE_ICON_MIME_ATTR); new BMessage(MSG_FORMAT), EXPORT_MODE_ICON_MIME_ATTR);
fFormatM->AddItem(fIconMimeAttrMI); fFormatM->AddItem(fIconMimeAttrMI);
+18 -8
View File
@@ -12,7 +12,9 @@
#include <stdio.h> #include <stdio.h>
#include <Application.h> #include <Application.h>
#include <Catalog.h>
#include <ListItem.h> #include <ListItem.h>
#include <Locale.h>
#include <Menu.h> #include <Menu.h>
#include <MenuItem.h> #include <MenuItem.h>
#include <Message.h> #include <Message.h>
@@ -32,6 +34,11 @@
#include "Shape.h" #include "Shape.h"
#include "Util.h" #include "Util.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Icon-O-Matic-ShapesList"
using std::nothrow; using std::nothrow;
class ShapeListItem : public SimpleItem, class ShapeListItem : public SimpleItem,
@@ -423,28 +430,31 @@ ShapeListView::SetMenu(BMenu* menu)
return; return;
BMessage* message = new BMessage(MSG_ADD_SHAPE); 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 = new BMessage(MSG_ADD_SHAPE);
message->AddBool("path", true); 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 = new BMessage(MSG_ADD_SHAPE);
message->AddBool("style", true); 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 = new BMessage(MSG_ADD_SHAPE);
message->AddBool("path", true); message->AddBool("path", true);
message->AddBool("style", 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)); fDuplicateMI = new BMenuItem(B_TRANSLATE("Duplicate"),
fResetTransformationMI = new BMenuItem("Reset transformation", new BMessage(MSG_DUPLICATE));
fResetTransformationMI = new BMenuItem(B_TRANSLATE("Reset transformation"),
new BMessage(MSG_RESET_TRANSFORMATION)); new BMessage(MSG_RESET_TRANSFORMATION));
fFreezeTransformationMI = new BMenuItem("Freeze transformation", fFreezeTransformationMI = new BMenuItem(
B_TRANSLATE("Freeze transformation"),
new BMessage(MSG_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); fMenu->AddItem(fAddEmptyMI);
+12 -4
View File
@@ -12,7 +12,9 @@
#include <stdio.h> #include <stdio.h>
#include <Application.h> #include <Application.h>
#include <Catalog.h>
#include <ListItem.h> #include <ListItem.h>
#include <Locale.h>
#include <Menu.h> #include <Menu.h>
#include <MenuItem.h> #include <MenuItem.h>
#include <Message.h> #include <Message.h>
@@ -34,6 +36,11 @@
#include "Selection.h" #include "Selection.h"
#include "Util.h" #include "Util.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Icon-O-Matic-StylesList"
using std::nothrow; using std::nothrow;
static const float kMarkWidth = 14.0; static const float kMarkWidth = 14.0;
@@ -592,21 +599,22 @@ StyleListView::SetMenu(BMenu* menu)
if (fMenu == NULL) if (fMenu == NULL)
return; return;
fAddMI = new BMenuItem("Add", new BMessage(MSG_ADD)); fAddMI = new BMenuItem(B_TRANSLATE("Add"), new BMessage(MSG_ADD));
fMenu->AddItem(fAddMI); fMenu->AddItem(fAddMI);
fMenu->AddSeparatorItem(); fMenu->AddSeparatorItem();
fDuplicateMI = new BMenuItem("Duplicate", new BMessage(MSG_DUPLICATE)); fDuplicateMI = new BMenuItem(B_TRANSLATE("Duplicate"),
new BMessage(MSG_DUPLICATE));
fMenu->AddItem(fDuplicateMI); fMenu->AddItem(fDuplicateMI);
fResetTransformationMI = new BMenuItem("Reset transformation", fResetTransformationMI = new BMenuItem(B_TRANSLATE("Reset transformation"),
new BMessage(MSG_RESET_TRANSFORMATION)); new BMessage(MSG_RESET_TRANSFORMATION));
fMenu->AddItem(fResetTransformationMI); fMenu->AddItem(fResetTransformationMI);
fMenu->AddSeparatorItem(); fMenu->AddSeparatorItem();
fRemoveMI = new BMenuItem("Remove", new BMessage(MSG_REMOVE)); fRemoveMI = new BMenuItem(B_TRANSLATE("Remove"), new BMessage(MSG_REMOVE));
fMenu->AddItem(fRemoveMI); fMenu->AddItem(fRemoveMI);
fMenu->SetTargetForItems(this); fMenu->SetTargetForItems(this);
+19 -13
View File
@@ -15,6 +15,8 @@
# include "GroupLayout.h" # include "GroupLayout.h"
# include "SpaceLayoutItem.h" # include "SpaceLayoutItem.h"
#endif #endif
#include <Catalog.h>
#include <Locale.h>
#include <Menu.h> #include <Menu.h>
#include <MenuBar.h> #include <MenuBar.h>
#include <MenuField.h> #include <MenuField.h>
@@ -32,6 +34,10 @@
#include "Style.h" #include "Style.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Icon-O-Matic-StyleTypes"
using std::nothrow; using std::nothrow;
enum { enum {
@@ -65,26 +71,26 @@ StyleView::StyleView(BRect frame)
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
// style type // style type
BMenu* menu = new BPopUpMenu("<unavailable>"); BMenu* menu = new BPopUpMenu(B_TRANSLATE("<unavailable>"));
BMessage* message = new BMessage(MSG_SET_STYLE_TYPE); BMessage* message = new BMessage(MSG_SET_STYLE_TYPE);
message->AddInt32("type", STYLE_TYPE_COLOR); 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 = new BMessage(MSG_SET_STYLE_TYPE);
message->AddInt32("type", STYLE_TYPE_GRADIENT); message->AddInt32("type", STYLE_TYPE_GRADIENT);
menu->AddItem(new BMenuItem("Gradient", message)); menu->AddItem(new BMenuItem(B_TRANSLATE("Gradient"), message));
#ifdef __HAIKU__ #ifdef __HAIKU__
BGridLayout* layout = new BGridLayout(5, 5); BGridLayout* layout = new BGridLayout(5, 5);
SetLayout(layout); SetLayout(layout);
fStyleType = new BMenuField( "Style type", menu, NULL); fStyleType = new BMenuField(B_TRANSLATE("Style type"), menu, NULL);
#else #else
frame.OffsetTo(B_ORIGIN); frame.OffsetTo(B_ORIGIN);
frame.InsetBy(5, 5); frame.InsetBy(5, 5);
frame.bottom = frame.top + 15; 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); menu, true);
AddChild(fStyleType); AddChild(fStyleType);
@@ -98,22 +104,22 @@ StyleView::StyleView(BRect frame)
#endif // __HAIKU__ #endif // __HAIKU__
// gradient type // gradient type
menu = new BPopUpMenu("<unavailable>"); menu = new BPopUpMenu(B_TRANSLATE("<unavailable>"));
message = new BMessage(MSG_SET_GRADIENT_TYPE); message = new BMessage(MSG_SET_GRADIENT_TYPE);
message->AddInt32("type", GRADIENT_LINEAR); 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 = new BMessage(MSG_SET_GRADIENT_TYPE);
message->AddInt32("type", GRADIENT_CIRCULAR); 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 = new BMessage(MSG_SET_GRADIENT_TYPE);
message->AddInt32("type", GRADIENT_DIAMOND); 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 = new BMessage(MSG_SET_GRADIENT_TYPE);
message->AddInt32("type", GRADIENT_CONIC); message->AddInt32("type", GRADIENT_CONIC);
menu->AddItem(new BMenuItem("Conic", message)); menu->AddItem(new BMenuItem(B_TRANSLATE("Conic"), message));
#if __HAIKU__ #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); fGradientControl = new GradientControl(new BMessage(MSG_SET_COLOR), this);
layout->AddItem(BSpaceLayoutItem::CreateVerticalStrut(3), 0, 0, 4); layout->AddItem(BSpaceLayoutItem::CreateVerticalStrut(3), 0, 0, 4);
@@ -132,8 +138,8 @@ StyleView::StyleView(BRect frame)
#else // !__HAIKU__ #else // !__HAIKU__
frame.OffsetBy(0, fStyleType->Frame().Height() + 6); frame.OffsetBy(0, fStyleType->Frame().Height() + 6);
fGradientType = new BMenuField(frame, "gradient type", "Gradient type", fGradientType = new BMenuField(frame, "gradient type",
menu, true); B_TRANSLATE("Gradient type"), menu, true);
AddChild(fGradientType); AddChild(fGradientType);
fGradientType->MenuBar()->GetPreferredSize(&width, &height); fGradientType->MenuBar()->GetPreferredSize(&width, &height);
@@ -12,7 +12,9 @@
#include <stdio.h> #include <stdio.h>
#include <Application.h> #include <Application.h>
#include <Catalog.h>
#include <ListItem.h> #include <ListItem.h>
#include <Locale.h>
#include <Menu.h> #include <Menu.h>
#include <MenuItem.h> #include <MenuItem.h>
#include <Mime.h> #include <Mime.h>
@@ -28,6 +30,11 @@
#include "Observer.h" #include "Observer.h"
#include "Selection.h" #include "Selection.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Icon-O-Matic-TransformersList"
using std::nothrow; using std::nothrow;
class TransformerItem : public SimpleItem, class TransformerItem : public SimpleItem,
@@ -128,8 +135,10 @@ TransformerListView::Draw(BRect updateRect)
return; return;
// display helpful messages // display helpful messages
const char* message1 = "Click on a shape above"; const char* message1 = B_TRANSLATE_WITH_CONTEXT("Click on a shape above",
const char* message2 = "to attach transformers."; "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)); SetHighColor(tint_color(LowColor(), B_DARKEN_2_TINT));
font_height fh; font_height fh;
@@ -370,14 +379,15 @@ TransformerListView::SetMenu(BMenu* menu)
if (fMenu == NULL) if (fMenu == NULL)
return; return;
BMenu* addMenu = new BMenu("Add"); BMenu* addMenu = new BMenu(B_TRANSLATE("Add"));
int32 cookie = 0; int32 cookie = 0;
uint32 type; uint32 type;
BString name; BString name;
while (TransformerFactory::NextType(&cookie, &type, &name)) { while (TransformerFactory::NextType(&cookie, &type, &name)) {
// TODO: Disable the "Transformation" and "Perspective" transformers // TODO: Disable the "Transformation" and "Perspective" transformers
// since they are not very useful or even implemented at all. // 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; continue;
// End of TODO. // End of TODO.
BMessage* message = new BMessage(MSG_ADD_TRANSFORMER); BMessage* message = new BMessage(MSG_ADD_TRANSFORMER);
@@ -13,7 +13,9 @@
#include <stdio.h> #include <stdio.h>
#include <Alert.h> #include <Alert.h>
#include <Catalog.h>
#include <File.h> #include <File.h>
#include <Locale.h>
#include <Node.h> #include <Node.h>
#include <NodeInfo.h> #include <NodeInfo.h>
#include <Path.h> #include <Path.h>
@@ -24,6 +26,11 @@
#include "Document.h" #include "Document.h"
#include "Icon.h" #include "Icon.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Icon-O-Matic-Exporter"
using std::nothrow; using std::nothrow;
// constructor // constructor
@@ -93,10 +100,12 @@ Exporter::_ExportThread()
status_t ret = _Export(fClonedIcon, &fRef); status_t ret = _Export(fClonedIcon, &fRef);
if (ret < B_OK) { if (ret < B_OK) {
// inform user of failure at this point // inform user of failure at this point
BString helper("Saving your document failed!"); BString helper(B_TRANSLATE("Saving your document failed!"));
helper << "\n\n" << "Error: " << strerror(ret); helper << "\n\n" << B_TRANSLATE("Error: ") << strerror(ret);
BAlert* alert = new BAlert("bad news", helper.String(), BAlert* alert = new BAlert(B_TRANSLATE("bad news"), helper.String(),
"Bleep!", NULL, NULL); B_TRANSLATE_WITH_CONTEXT("Bleep!",
"Exporter - Continue in error dialog"),
NULL, NULL);
// launch alert asynchronously // launch alert asynchronously
alert->Go(NULL); alert->Go(NULL);
} else { } else {
@@ -15,9 +15,11 @@
#include <Alert.h> #include <Alert.h>
#include <Archivable.h> #include <Archivable.h>
#include <ByteOrder.h> #include <ByteOrder.h>
#include <Catalog.h>
#include <DataIO.h> #include <DataIO.h>
#include <File.h> #include <File.h>
#include <List.h> #include <List.h>
#include <Locale.h>
#include <Message.h> #include <Message.h>
#include <NodeInfo.h> #include <NodeInfo.h>
#include <Shape.h> #include <Shape.h>
@@ -32,9 +34,13 @@
#include "StyleContainer.h" #include "StyleContainer.h"
#include "VectorPath.h" #include "VectorPath.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Icon-O-Matic-StyledTextImport"
//#define CALLED() printf("%s()\n", __FUNCTION__); //#define CALLED() printf("%s()\n", __FUNCTION__);
#define CALLED() do {} while (0) #define CALLED() do {} while (0)
using std::nothrow; using std::nothrow;
class ShapeIterator : public BShapeIterator { class ShapeIterator : public BShapeIterator {
@@ -247,9 +253,11 @@ StyledTextImporter::_Import(Icon* icon, const char *text, text_run_array *runs)
BString str(text); BString str(text);
if (str.Length() > 50) { if (str.Length() > 50) {
BAlert* alert = new BAlert("too big", BAlert* alert = new BAlert(B_TRANSLATE("too big"),
"The text you are trying to import is quite long, are you sure?", B_TRANSLATE("The text you are trying to import is quite long,"
"Yes", "No", NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT); "are you sure?"),
B_TRANSLATE("Yes"), B_TRANSLATE("No"), NULL,
B_WIDTH_AS_USUAL, B_WARNING_ALERT);
if (alert->Go()) if (alert->Go())
return B_CANCELED; return B_CANCELED;
} }
@@ -365,7 +373,8 @@ StyledTextImporter::_AddStyle(Icon *icon, text_run *run)
return B_NO_MEMORY; return B_NO_MEMORY;
} }
char name[30]; 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); style->SetName(name);
bool found = false; bool found = false;
@@ -9,8 +9,10 @@
#include <stdio.h> #include <stdio.h>
#include <Alert.h> #include <Alert.h>
#include <Catalog.h>
#include <DataIO.h> #include <DataIO.h>
#include <File.h> #include <File.h>
#include <Locale.h>
#include <String.h> #include <String.h>
#include "support.h" #include "support.h"
@@ -24,6 +26,11 @@
#include "SVGExporter.h" #include "SVGExporter.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Icon-O-Matic-SVGExport"
// write_line // write_line
static status_t static status_t
write_line(BPositionIO* stream, BString& string) write_line(BPositionIO* stream, BString& string)
@@ -148,14 +155,15 @@ SVGExporter::SetOriginalEntry(const entry_ref* ref)
bool bool
SVGExporter::_DisplayWarning() const SVGExporter::_DisplayWarning() const
{ {
BAlert* alert = new BAlert("warning", BAlert* alert = new BAlert(B_TRANSLATE("warning"),
"Icon-O-Matic might not have " B_TRANSLATE("Icon-O-Matic might not have "
"interpreted all data from the SVG " "interpreted all data from the SVG "
"when it was loaded. " "when it was loaded. "
"By overwriting the original " "By overwriting the original "
"file, this information would now " "file, this information would now "
"be lost.", "be lost."),
"Cancel", "Overwrite"); B_TRANSLATE("Cancel"),
B_TRANSLATE("Overwrite"));
return alert->Go() == 1; return alert->Go() == 1;
} }
@@ -9,13 +9,20 @@
#include "SVGImporter.h" #include "SVGImporter.h"
#include <Alert.h> #include <Alert.h>
#include <Catalog.h>
#include <Entry.h> #include <Entry.h>
#include <File.h> #include <File.h>
#include <Locale.h>
#include <Path.h> #include <Path.h>
#include "DocumentBuilder.h" #include "DocumentBuilder.h"
#include "SVGParser.h" #include "SVGParser.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Icon-O-Matic-SVGImport"
// constructor // constructor
SVGImporter::SVGImporter() SVGImporter::SVGImporter()
{ {
@@ -67,11 +74,11 @@ SVGImporter::Import(Icon* icon, const entry_ref* ref)
ret = builder.GetIcon(icon, this, ref->name); ret = builder.GetIcon(icon, this, ref->name);
} catch(agg::svg::exception& e) { } catch(agg::svg::exception& e) {
char error[1024]; 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" "an SVG document.\n\n"
"Error: %s", ref->name, e.msg()); "Error: %s"), ref->name, e.msg());
BAlert* alert = new BAlert("load error", BAlert* alert = new BAlert(B_TRANSLATE("load error"),
error, "OK", NULL, NULL, error, B_TRANSLATE("OK"), NULL, NULL,
B_WIDTH_AS_USUAL, B_WARNING_ALERT); B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->Go(NULL); alert->Go(NULL);
ret = B_ERROR; ret = B_ERROR;
@@ -8,7 +8,9 @@
#include <float.h> #include <float.h>
#include <stdio.h> #include <stdio.h>
#include <Catalog.h>
#include <Cursor.h> #include <Cursor.h>
#include <Locale.h>
#include <Message.h> #include <Message.h>
#include <MenuItem.h> #include <MenuItem.h>
#include <PopUpMenu.h> #include <PopUpMenu.h>
@@ -34,11 +36,15 @@
#include "SplitPointsCommand.h" #include "SplitPointsCommand.h"
#include "TransformPointsBox.h" #include "TransformPointsBox.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Icon-O-Matic-PathManipulator"
#define POINT_EXTEND 3.0 #define POINT_EXTEND 3.0
#define CONTROL_POINT_EXTEND 2.0 #define CONTROL_POINT_EXTEND 2.0
#define INSERT_DIST_THRESHOLD 7.0 #define INSERT_DIST_THRESHOLD 7.0
#define MOVE_THRESHOLD 9.0 #define MOVE_THRESHOLD 9.0
enum { enum {
UNDEFINED, UNDEFINED,
@@ -768,29 +774,29 @@ PathManipulator::ShowContextMenu(BPoint where)
if (fCurrentPathPoint < 0) { if (fCurrentPathPoint < 0) {
message = new BMessage(B_SELECT_ALL); 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->AddItem(item);
menu->AddSeparatorItem(); menu->AddSeparatorItem();
} }
message = new BMessage(MSG_TRANSFORM); message = new BMessage(MSG_TRANSFORM);
item = new BMenuItem("Transform", message, 'T'); item = new BMenuItem(B_TRANSLATE("Transform"), message, 'T');
item->SetEnabled(hasSelection); item->SetEnabled(hasSelection);
menu->AddItem(item); menu->AddItem(item);
message = new BMessage(MSG_SPLIT_POINTS); message = new BMessage(MSG_SPLIT_POINTS);
item = new BMenuItem("Split", message); item = new BMenuItem(B_TRANSLATE("Split"), message);
item->SetEnabled(hasSelection); item->SetEnabled(hasSelection);
menu->AddItem(item); menu->AddItem(item);
message = new BMessage(MSG_FLIP_POINTS); message = new BMessage(MSG_FLIP_POINTS);
item = new BMenuItem("Flip", message); item = new BMenuItem(B_TRANSLATE("Flip"), message);
item->SetEnabled(hasSelection); item->SetEnabled(hasSelection);
menu->AddItem(item); menu->AddItem(item);
message = new BMessage(MSG_REMOVE_POINTS); message = new BMessage(MSG_REMOVE_POINTS);
item = new BMenuItem("Remove", message); item = new BMenuItem(B_TRANSLATE("Remove"), message);
item->SetEnabled(hasSelection); item->SetEnabled(hasSelection);
menu->AddItem(item); menu->AddItem(item);
@@ -12,9 +12,17 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <Catalog.h>
#include <Locale.h>
#include "PathContainer.h" #include "PathContainer.h"
#include "VectorPath.h" #include "VectorPath.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Icon-O-Matic-AddPathsCmd"
using std::nothrow; using std::nothrow;
// constructor // constructor
@@ -101,13 +109,13 @@ AddPathsCommand::GetName(BString& name)
{ {
if (fOwnsPaths) { if (fOwnsPaths) {
if (fCount > 1) if (fCount > 1)
name << "Add Paths"; name << B_TRANSLATE("Add Paths");
else else
name << "Add Path"; name << B_TRANSLATE("Add Path");
} else { } else {
if (fCount > 1) if (fCount > 1)
name << "Assign Paths"; name << B_TRANSLATE("Assign Paths");
else else
name << "Assign Path"; name << B_TRANSLATE("Assign Path");
} }
} }
@@ -10,8 +10,16 @@
#include <stdio.h> #include <stdio.h>
#include <Catalog.h>
#include <Locale.h>
#include "VectorPath.h" #include "VectorPath.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Icon-O-Matic-AddPointCmd"
// constructor // constructor
AddPointCommand::AddPointCommand(VectorPath* path, AddPointCommand::AddPointCommand(VectorPath* path,
int32 index, int32 index,
@@ -96,5 +104,5 @@ void
AddPointCommand::GetName(BString& name) AddPointCommand::GetName(BString& name)
{ {
// name << _GetString(ADD_CONTROL_POINT, "Add Control Point"); // name << _GetString(ADD_CONTROL_POINT, "Add Control Point");
name << "Add Control Point"; name << B_TRANSLATE("Add Control Point");
} }
@@ -12,10 +12,18 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <Catalog.h>
#include <Locale.h>
#include "Selection.h" #include "Selection.h"
#include "ShapeContainer.h" #include "ShapeContainer.h"
#include "Shape.h" #include "Shape.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Icon-O-Matic-AddShapesCmd"
using std::nothrow; using std::nothrow;
// constructor // constructor
@@ -99,7 +107,7 @@ void
AddShapesCommand::GetName(BString& name) AddShapesCommand::GetName(BString& name)
{ {
if (fCount > 1) if (fCount > 1)
name << "Add Shapes"; name << B_TRANSLATE("Add Shapes");
else else
name << "Add Shape"; name << B_TRANSLATE("Add Shape");
} }
@@ -12,9 +12,17 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <Catalog.h>
#include <Locale.h>
#include "ShapeContainer.h" #include "ShapeContainer.h"
#include "Shape.h" #include "Shape.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Icon-O-Matic-AddTransformersCmd"
using std::nothrow; using std::nothrow;
// constructor // constructor
@@ -97,7 +105,7 @@ void
AddTransformersCommand::GetName(BString& name) AddTransformersCommand::GetName(BString& name)
{ {
if (fCount > 1) if (fCount > 1)
name << "Add Transformers"; name << B_TRANSLATE("Add Transformers");
else else
name << "Add Transformer"; name << B_TRANSLATE("Add Transformer");
} }
@@ -11,8 +11,16 @@
#include <new> #include <new>
#include <stdio.h> #include <stdio.h>
#include <Catalog.h>
#include <Locale.h>
#include "VectorPath.h" #include "VectorPath.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Icon-O-Matic-ChangePointCmd"
using std::nothrow; using std::nothrow;
// constructor // constructor
@@ -118,5 +126,5 @@ void
ChangePointCommand::GetName(BString& name) ChangePointCommand::GetName(BString& name)
{ {
// name << _GetString(MODIFY_CONTROL_POINT, "Modify Control Point"); // name << _GetString(MODIFY_CONTROL_POINT, "Modify Control Point");
name << "Modify Control Point"; name << B_TRANSLATE("Modify Control Point");
} }
@@ -10,8 +10,16 @@
#include <stdio.h> #include <stdio.h>
#include <Catalog.h>
#include <Locale.h>
#include "VectorPath.h" #include "VectorPath.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Icon-O-Matic-CleanUpPathCmd"
// constructor // constructor
CleanUpPathCommand::CleanUpPathCommand(VectorPath* path) CleanUpPathCommand::CleanUpPathCommand(VectorPath* path)
: PathCommand(path), : PathCommand(path),
@@ -48,5 +56,5 @@ CleanUpPathCommand::Undo()
void void
CleanUpPathCommand::GetName(BString& name) CleanUpPathCommand::GetName(BString& name)
{ {
name << "Clean Up Path"; name << B_TRANSLATE("Clean Up Path");
} }
@@ -11,8 +11,16 @@
#include <new> #include <new>
#include <stdio.h> #include <stdio.h>
#include <Catalog.h>
#include <Locale.h>
#include "VectorPath.h" #include "VectorPath.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Icon-O-Matic-FlipPointsCmd"
using std::nothrow; using std::nothrow;
// constructor // constructor
@@ -104,8 +112,8 @@ void
FlipPointsCommand::GetName(BString& name) FlipPointsCommand::GetName(BString& name)
{ {
if (fCount > 1) if (fCount > 1)
name << "Flip Control Points"; name << B_TRANSLATE("Flip Control Points");
else else
name << "Flip Control Point"; name << B_TRANSLATE("Flip Control Point");
} }
@@ -12,11 +12,19 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <Catalog.h>
#include <Locale.h>
#include "GradientTransformable.h" #include "GradientTransformable.h"
#include "Shape.h" #include "Shape.h"
#include "Style.h" #include "Style.h"
#include "VectorPath.h" #include "VectorPath.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Icon-O-Matic-FreezeTransformationCmd"
using std::nothrow; using std::nothrow;
// constructor // constructor
@@ -111,9 +119,9 @@ void
FreezeTransformationCommand::GetName(BString& name) FreezeTransformationCommand::GetName(BString& name)
{ {
if (fCount > 1) if (fCount > 1)
name << "Freeze Shapes"; name << B_TRANSLATE("Freeze Shapes");
else else
name << "Freeze Shape"; name << B_TRANSLATE("Freeze Shape");
} }
// #pragma mark - // #pragma mark -
@@ -11,8 +11,16 @@
#include <new> #include <new>
#include <stdio.h> #include <stdio.h>
#include <Catalog.h>
#include <Locale.h>
#include "VectorPath.h" #include "VectorPath.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Icon-O-Matic-InsertPointCmd"
using std::nothrow; using std::nothrow;
// constructor // constructor
@@ -123,6 +131,6 @@ void
InsertPointCommand::GetName(BString& name) InsertPointCommand::GetName(BString& name)
{ {
// name << _GetString(INSERT_CONTROL_POINT, "Insert Control Point"); // name << _GetString(INSERT_CONTROL_POINT, "Insert Control Point");
name << "Insert Control Point"; name << B_TRANSLATE("Insert Control Point");
} }
@@ -11,9 +11,17 @@
#include <new> #include <new>
#include <stdio.h> #include <stdio.h>
#include <Catalog.h>
#include <Locale.h>
#include "PathContainer.h" #include "PathContainer.h"
#include "VectorPath.h" #include "VectorPath.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Icon-O-Matic-MovePathsCmd"
using std::nothrow; using std::nothrow;
// constructor // constructor
@@ -147,7 +155,7 @@ void
MovePathsCommand::GetName(BString& name) MovePathsCommand::GetName(BString& name)
{ {
if (fCount > 1) if (fCount > 1)
name << "Move Paths"; name << B_TRANSLATE("Move Paths");
else else
name << "Move Path"; name << B_TRANSLATE("Move Path");
} }
@@ -11,9 +11,17 @@
#include <new> #include <new>
#include <stdio.h> #include <stdio.h>
#include <Catalog.h>
#include <Locale.h>
#include "ShapeContainer.h" #include "ShapeContainer.h"
#include "Shape.h" #include "Shape.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Icon-O-Matic-MoveShapesCommand"
using std::nothrow; using std::nothrow;
// constructor // constructor
@@ -151,7 +159,7 @@ MoveShapesCommand::GetName(BString& name)
// else // else
// name << _GetString(MOVE_MODIFIER, "Move Shape"); // name << _GetString(MOVE_MODIFIER, "Move Shape");
if (fCount > 1) if (fCount > 1)
name << "Move Shapes"; name << B_TRANSLATE("Move Shapes");
else else
name << "Move Shape"; name << B_TRANSLATE("Move Shape");
} }
@@ -11,9 +11,17 @@
#include <new> #include <new>
#include <stdio.h> #include <stdio.h>
#include <Catalog.h>
#include <Locale.h>
#include "Shape.h" #include "Shape.h"
#include "Transformer.h" #include "Transformer.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Icon-O-Matic-MoveTransformersCmd"
using std::nothrow; using std::nothrow;
// constructor // constructor
@@ -155,7 +163,7 @@ MoveTransformersCommand::GetName(BString& name)
// else // else
// name << _GetString(MOVE_TRANSFORMER, "Move Transformer"); // name << _GetString(MOVE_TRANSFORMER, "Move Transformer");
if (fCount > 1) if (fCount > 1)
name << "Move Transformers"; name << B_TRANSLATE("Move Transformers");
else else
name << "Move Transformer"; name << B_TRANSLATE("Move Transformer");
} }
@@ -11,8 +11,16 @@
#include <new> #include <new>
#include <stdio.h> #include <stdio.h>
#include <Catalog.h>
#include <Locale.h>
#include "VectorPath.h" #include "VectorPath.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Icon-O-Matic-NudgePointsCommand"
using std::nothrow; using std::nothrow;
// constructor // constructor
@@ -25,7 +33,8 @@ NudgePointsCommand::NudgePointsCommand(VectorPath* path,
0.0, 0.0,
1.0, 1.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), // count > 1 ? NUDGE_CONTROL_POINTS : NUDGE_CONTROL_POINT),
-1), -1),
fPath(path), fPath(path),
@@ -10,8 +10,16 @@
#include <stdio.h> #include <stdio.h>
#include <Catalog.h>
#include <Locale.h>
#include "VectorPath.h" #include "VectorPath.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Icon-O-Matic-PathCmd"
// constructor // constructor
PathCommand::PathCommand(VectorPath* path) PathCommand::PathCommand(VectorPath* path)
: fPath(path) : fPath(path)
@@ -35,7 +43,7 @@ void
PathCommand::GetName(BString& name) PathCommand::GetName(BString& name)
{ {
name << ("<modify path>"); name << B_TRANSLATE("<modify path>");
} }
// _Select // _Select
@@ -11,10 +11,18 @@
#include <new> #include <new>
#include <stdio.h> #include <stdio.h>
#include <Catalog.h>
#include <Locale.h>
#include "PathContainer.h" #include "PathContainer.h"
#include "Shape.h" #include "Shape.h"
#include "VectorPath.h" #include "VectorPath.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Icon-O-Matic-RemovePathsCmd"
using std::nothrow; using std::nothrow;
// constructor // constructor
@@ -122,7 +130,7 @@ void
RemovePathsCommand::GetName(BString& name) RemovePathsCommand::GetName(BString& name)
{ {
if (fCount > 1) if (fCount > 1)
name << "Remove Paths"; name << B_TRANSLATE("Remove Paths");
else else
name << "Remove Path"; name << B_TRANSLATE("Remove Path");
} }
@@ -11,8 +11,16 @@
#include <new> #include <new>
#include <stdio.h> #include <stdio.h>
#include <Catalog.h>
#include <Locale.h>
#include "VectorPath.h" #include "VectorPath.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Icon-O-Matic-RemovePointsCmd"
using std::nothrow; using std::nothrow;
// constructor // constructor
@@ -158,9 +166,9 @@ RemovePointsCommand::GetName(BString& name)
// else // else
// name << _GetString(REMOVE_CONTROL_POINT, "Remove Control Point"); // name << _GetString(REMOVE_CONTROL_POINT, "Remove Control Point");
if (fCount > 1) if (fCount > 1)
name << "Remove Control Points"; name << B_TRANSLATE("Remove Control Points");
else else
name << "Remove Control Point"; name << B_TRANSLATE("Remove Control Point");
} }
// _Init // _Init
@@ -12,9 +12,17 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <Catalog.h>
#include <Locale.h>
#include "ShapeContainer.h" #include "ShapeContainer.h"
#include "Shape.h" #include "Shape.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Icon-O-Matic-RemoveShapesCmd"
using std::nothrow; using std::nothrow;
// constructor // constructor
@@ -99,7 +107,7 @@ RemoveShapesCommand::GetName(BString& name)
// else // else
// name << _GetString(MOVE_MODIFIER, "Move Shape"); // name << _GetString(MOVE_MODIFIER, "Move Shape");
if (fCount > 1) if (fCount > 1)
name << "Remove Shapes"; name << B_TRANSLATE("Remove Shapes");
else else
name << "Remove Shape"; name << B_TRANSLATE("Remove Shape");
} }
@@ -12,9 +12,17 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <Catalog.h>
#include <Locale.h>
#include "ShapeContainer.h" #include "ShapeContainer.h"
#include "Shape.h" #include "Shape.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Icon-O-Matic-RemoveTransformersCmd"
using std::nothrow; using std::nothrow;
// constructor // constructor
@@ -101,7 +109,7 @@ RemoveTransformersCommand::GetName(BString& name)
// else // else
// name << _GetString(MOVE_TRANSFORMER, "Move Transformer"); // name << _GetString(MOVE_TRANSFORMER, "Move Transformer");
if (fCount > 1) if (fCount > 1)
name << "Remove Transformers"; name << B_TRANSLATE("Remove Transformers");
else else
name << "Remove Transformer"; name << B_TRANSLATE("Remove Transformer");
} }
@@ -10,8 +10,16 @@
#include <stdio.h> #include <stdio.h>
#include <Catalog.h>
#include <Locale.h>
#include "VectorPath.h" #include "VectorPath.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Icon-O-Matic-ReversePathCmd"
// constructor // constructor
ReversePathCommand::ReversePathCommand(VectorPath* path) ReversePathCommand::ReversePathCommand(VectorPath* path)
: PathCommand(path) : PathCommand(path)
@@ -43,5 +51,5 @@ ReversePathCommand::Undo()
void void
ReversePathCommand::GetName(BString& name) ReversePathCommand::GetName(BString& name)
{ {
name <<"Reverse Path"; name << B_TRANSLATE("Reverse Path");
} }
@@ -7,9 +7,16 @@
#include <stdio.h> #include <stdio.h>
#include <Catalog.h>
#include <Locale.h>
#include "VectorPath.h" #include "VectorPath.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Icon-O-Matic-RotatePathIndiciesCmd"
RotatePathIndicesCommand::RotatePathIndicesCommand(VectorPath* path, RotatePathIndicesCommand::RotatePathIndicesCommand(VectorPath* path,
bool clockWise) bool clockWise)
: :
@@ -51,7 +58,7 @@ RotatePathIndicesCommand::Undo()
void void
RotatePathIndicesCommand::GetName(BString& name) RotatePathIndicesCommand::GetName(BString& name)
{ {
name << "Rotate Path Indices"; name << B_TRANSLATE("Rotate Path Indices");
} }
@@ -11,8 +11,16 @@
#include <new> #include <new>
#include <stdio.h> #include <stdio.h>
#include <Catalog.h>
#include <Locale.h>
#include "VectorPath.h" #include "VectorPath.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Icon-O-Matic-SplitPointsCmd"
using std::nothrow; using std::nothrow;
// constructor // constructor
@@ -147,8 +155,8 @@ void
SplitPointsCommand::GetName(BString& name) SplitPointsCommand::GetName(BString& name)
{ {
if (fCount > 1) if (fCount > 1)
name << "Split Control Points"; name << B_TRANSLATE("Split Control Points");
else else
name << "Split Control Point"; name << B_TRANSLATE("Split Control Point");
} }
@@ -8,10 +8,18 @@
#include "UnassignPathCommand.h" #include "UnassignPathCommand.h"
#include <Catalog.h>
#include <Locale.h>
#include "PathContainer.h" #include "PathContainer.h"
#include "Shape.h" #include "Shape.h"
#include "VectorPath.h" #include "VectorPath.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Icon-O-Matic-UnassignPathCmd"
// constructor // constructor
UnassignPathCommand::UnassignPathCommand(Shape* shape, UnassignPathCommand::UnassignPathCommand(Shape* shape,
VectorPath* path) VectorPath* path)
@@ -62,5 +70,5 @@ UnassignPathCommand::Undo()
void void
UnassignPathCommand::GetName(BString& name) UnassignPathCommand::GetName(BString& name)
{ {
name << "Unassign Path"; name << B_TRANSLATE("Unassign Path");
} }
@@ -12,9 +12,17 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <Catalog.h>
#include <Locale.h>
#include "StyleContainer.h" #include "StyleContainer.h"
#include "Style.h" #include "Style.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Icon-O-Matic-AddStylesCmd"
using std::nothrow; using std::nothrow;
// constructor // constructor
@@ -93,7 +101,7 @@ void
AddStylesCommand::GetName(BString& name) AddStylesCommand::GetName(BString& name)
{ {
if (fCount > 1) if (fCount > 1)
name << "Add Styles"; name << B_TRANSLATE("Add Styles");
else else
name << "Add Style"; name << B_TRANSLATE("Add Style");
} }
@@ -8,9 +8,17 @@
#include "AssignStyleCommand.h" #include "AssignStyleCommand.h"
#include <Catalog.h>
#include <Locale.h>
#include "Shape.h" #include "Shape.h"
#include "Style.h" #include "Style.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Icon-O-Matic-AssignStyleCmd"
// constructor // constructor
AssignStyleCommand::AssignStyleCommand(Shape* shape, AssignStyleCommand::AssignStyleCommand(Shape* shape,
Style* style) Style* style)
@@ -63,7 +71,7 @@ AssignStyleCommand::Undo()
void void
AssignStyleCommand::GetName(BString& name) AssignStyleCommand::GetName(BString& name)
{ {
name << "Assign Style"; name << B_TRANSLATE("Assign Style");
if (fNewStyle) if (fNewStyle)
name << " \"" << fNewStyle->Name() << "\""; name << " \"" << fNewStyle->Name() << "\"";
} }
@@ -11,9 +11,17 @@
#include <new> #include <new>
#include <stdio.h> #include <stdio.h>
#include <Catalog.h>
#include <Locale.h>
#include "StyleContainer.h" #include "StyleContainer.h"
#include "Style.h" #include "Style.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Icon-O-Matic-MoveStylesCmd"
using std::nothrow; using std::nothrow;
// constructor // constructor
@@ -147,7 +155,7 @@ void
MoveStylesCommand::GetName(BString& name) MoveStylesCommand::GetName(BString& name)
{ {
if (fCount > 1) if (fCount > 1)
name << "Move Styles"; name << B_TRANSLATE("Move Styles");
else else
name << "Move Style"; name << B_TRANSLATE("Move Style");
} }
@@ -11,10 +11,18 @@
#include <new> #include <new>
#include <stdio.h> #include <stdio.h>
#include <Catalog.h>
#include <Locale.h>
#include "StyleContainer.h" #include "StyleContainer.h"
#include "Shape.h" #include "Shape.h"
#include "Style.h" #include "Style.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Icon-O-Matic-RemoveStylesCmd"
using std::nothrow; using std::nothrow;
// constructor // constructor
@@ -132,7 +140,7 @@ void
RemoveStylesCommand::GetName(BString& name) RemoveStylesCommand::GetName(BString& name)
{ {
if (fCount > 1) if (fCount > 1)
name << "Remove Styles"; name << B_TRANSLATE("Remove Styles");
else else
name << "Remove Style"; name << B_TRANSLATE("Remove Style");
} }
@@ -11,9 +11,17 @@
#include <new> #include <new>
#include <stdio.h> #include <stdio.h>
#include <Catalog.h>
#include <Locale.h>
#include "GradientTransformable.h" #include "GradientTransformable.h"
#include "Style.h" #include "Style.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Icon-O-Matic-SetColorCmd"
using std::nothrow; using std::nothrow;
// constructor // constructor
@@ -66,7 +74,7 @@ SetColorCommand::Undo()
void void
SetColorCommand::GetName(BString& name) SetColorCommand::GetName(BString& name)
{ {
name << "Change Color"; name << B_TRANSLATE("Change Color");
} }
// CombineWithNext // CombineWithNext
@@ -11,9 +11,17 @@
#include <new> #include <new>
#include <stdio.h> #include <stdio.h>
#include <Catalog.h>
#include <Locale.h>
#include "GradientTransformable.h" #include "GradientTransformable.h"
#include "Style.h" #include "Style.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Icon-O-Matic-SetGradientCmd"
using std::nothrow; using std::nothrow;
// constructor // constructor
@@ -93,7 +101,7 @@ SetGradientCommand::Undo()
void void
SetGradientCommand::GetName(BString& name) SetGradientCommand::GetName(BString& name)
{ {
name << _GetString(/*EDIT_GRADIENT*/0, "Edit Gradient"); name << B_TRANSLATE("Edit Gradient");
} }
// CombineWithNext // CombineWithNext
@@ -11,8 +11,16 @@
#include <new> #include <new>
#include <stdio.h> #include <stdio.h>
#include <Catalog.h>
#include <Locale.h>
#include "ChannelTransform.h" #include "ChannelTransform.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Icon-O-Matic-ResetTransformationCmd"
using std::nothrow; using std::nothrow;
// constructor // constructor
@@ -82,7 +90,7 @@ void
ResetTransformationCommand::GetName(BString& name) ResetTransformationCommand::GetName(BString& name)
{ {
if (fCount > 1) if (fCount > 1)
name << "Reset Transformations"; name << B_TRANSLATE("Reset Transformations");
else else
name << "Reset Transformation"; name << B_TRANSLATE("Reset Transformation");
} }
@@ -11,8 +11,10 @@
#include <math.h> #include <math.h>
#include <stdio.h> #include <stdio.h>
#include <Catalog.h>
#include <Cursor.h> #include <Cursor.h>
#include <InterfaceDefs.h> #include <InterfaceDefs.h>
#include <Locale.h>
#include <View.h> #include <View.h>
#include "cursors.h" #include "cursors.h"
@@ -21,6 +23,10 @@
#include "TransformBox.h" #include "TransformBox.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Icon-O-Matic-TransformationBoxStates"
// constructor // constructor
DragState::DragState(TransformBox* parent) DragState::DragState(TransformBox* parent)
: :
@@ -42,7 +48,7 @@ DragState::SetOrigin(BPoint origin)
const char* const char*
DragState::ActionName() const DragState::ActionName() const
{ {
return "Transformation"; return B_TRANSLATE("Transformation");
} }
@@ -288,7 +294,7 @@ DragCornerState::UpdateViewCursor(BView* view, BPoint current) const
const char* const char*
DragCornerState::ActionName() const DragCornerState::ActionName() const
{ {
return "Scale"; return B_TRANSLATE("Scale");
} }
@@ -456,7 +462,7 @@ DragSideState::UpdateViewCursor(BView* view, BPoint current) const
const char* const char*
DragSideState::ActionName() const DragSideState::ActionName() const
{ {
return "Scale"; return B_TRANSLATE("Scale");
} }
@@ -508,7 +514,7 @@ DragBoxState::UpdateViewCursor(BView* view, BPoint current) const
const char* const char*
DragBoxState::ActionName() const DragBoxState::ActionName() const
{ {
return "Move"; return B_TRANSLATE("Move");
} }
@@ -597,7 +603,7 @@ RotateBoxState::UpdateViewCursor(BView* view, BPoint current) const
const char* const char*
RotateBoxState::ActionName() const RotateBoxState::ActionName() const
{ {
return "Rotate"; return B_TRANSLATE("Rotate");
} }
@@ -643,7 +649,7 @@ OffsetCenterState::UpdateViewCursor(BView* view, BPoint current) const
const char* const char*
OffsetCenterState::ActionName() const OffsetCenterState::ActionName() const
{ {
return "Move Pivot"; return B_TRANSLATE("Move Pivot");
} }