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 <Alert.h>
#include <Catalog.h>
#include <Directory.h>
#include <Entry.h>
#include <File.h>
#include <FilePanel.h>
#include <fs_attr.h>
#include <IconEditorProtocol.h>
#include <Locale.h>
#include <Message.h>
#include <Mime.h>
@@ -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);
+55 -1
View File
@@ -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
;
+64 -29
View File
@@ -18,6 +18,8 @@
#include <Message.h>
#include <Screen.h>
#include <ScrollView.h>
#include <Catalog.h>
#include <Locale.h>
#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("<nothing to undo>");
fUndoMI->SetLabel(B_TRANSLATE_WITH_CONTEXT("<nothing to undo>",
"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("<nothing to redo>");
fRedoMI->SetLabel(B_TRANSLATE_WITH_CONTEXT("<nothing to redo>",
"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("<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');
fRedoMI = new BMenuItem("<nothing to redo>",
fRedoMI = new BMenuItem(B_TRANSLATE("<nothing to redo>"),
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'));
@@ -10,11 +10,19 @@
#include <stdio.h>
#include <Catalog.h>
#include <Locale.h>
#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;
}
}
@@ -9,6 +9,8 @@
#include <stdio.h>
#include <Application.h>
#include <Catalog.h>
#include <Locale.h>
#if LIB_LAYOUT
# include <MBorder.h>
@@ -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);
@@ -12,6 +12,14 @@
#include <debugger.h>
#include <Catalog.h>
#include <Locale.h>
#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 = "<unkown property>";
name = B_TRANSLATE("<unkown property>");
break;
}
return name;
@@ -11,10 +11,12 @@
#include <stdio.h>
#include <string.h>
#include <Catalog.h>
#include <Clipboard.h>
#ifdef __HAIKU__
# include <LayoutUtils.h>
#endif
#include <Locale.h>
#include <Menu.h>
#include <MenuItem.h>
#include <Message.h>
@@ -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)
@@ -12,6 +12,9 @@
#include <stdio.h>
#include <string.h>
#include <Catalog.h>
#include <Locale.h>
#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;
+22 -9
View File
@@ -12,7 +12,9 @@
#include <stdio.h>
#include <Application.h>
#include <Catalog.h>
#include <ListItem.h>
#include <Locale.h>
#include <Menu.h>
#include <MenuItem.h>
#include <Message.h>
@@ -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);
+40 -27
View File
@@ -13,6 +13,8 @@
#include <Alert.h>
#include <Button.h>
#include <Catalog.h>
#include <Locale.h>
#include <MenuBar.h>
#include <MenuField.h>
#include <PopUpMenu.h>
@@ -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);
+18 -8
View File
@@ -12,7 +12,9 @@
#include <stdio.h>
#include <Application.h>
#include <Catalog.h>
#include <ListItem.h>
#include <Locale.h>
#include <Menu.h>
#include <MenuItem.h>
#include <Message.h>
@@ -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);
+12 -4
View File
@@ -12,7 +12,9 @@
#include <stdio.h>
#include <Application.h>
#include <Catalog.h>
#include <ListItem.h>
#include <Locale.h>
#include <Menu.h>
#include <MenuItem.h>
#include <Message.h>
@@ -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);
+19 -13
View File
@@ -15,6 +15,8 @@
# include "GroupLayout.h"
# include "SpaceLayoutItem.h"
#endif
#include <Catalog.h>
#include <Locale.h>
#include <Menu.h>
#include <MenuBar.h>
#include <MenuField.h>
@@ -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("<unavailable>");
BMenu* menu = new BPopUpMenu(B_TRANSLATE("<unavailable>"));
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("<unavailable>");
menu = new BPopUpMenu(B_TRANSLATE("<unavailable>"));
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);
@@ -12,7 +12,9 @@
#include <stdio.h>
#include <Application.h>
#include <Catalog.h>
#include <ListItem.h>
#include <Locale.h>
#include <Menu.h>
#include <MenuItem.h>
#include <Mime.h>
@@ -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);
@@ -13,7 +13,9 @@
#include <stdio.h>
#include <Alert.h>
#include <Catalog.h>
#include <File.h>
#include <Locale.h>
#include <Node.h>
#include <NodeInfo.h>
#include <Path.h>
@@ -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 {
@@ -15,9 +15,11 @@
#include <Alert.h>
#include <Archivable.h>
#include <ByteOrder.h>
#include <Catalog.h>
#include <DataIO.h>
#include <File.h>
#include <List.h>
#include <Locale.h>
#include <Message.h>
#include <NodeInfo.h>
#include <Shape.h>
@@ -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;
@@ -9,8 +9,10 @@
#include <stdio.h>
#include <Alert.h>
#include <Catalog.h>
#include <DataIO.h>
#include <File.h>
#include <Locale.h>
#include <String.h>
#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;
}
@@ -9,13 +9,20 @@
#include "SVGImporter.h"
#include <Alert.h>
#include <Catalog.h>
#include <Entry.h>
#include <File.h>
#include <Locale.h>
#include <Path.h>
#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;
@@ -8,7 +8,9 @@
#include <float.h>
#include <stdio.h>
#include <Catalog.h>
#include <Cursor.h>
#include <Locale.h>
#include <Message.h>
#include <MenuItem.h>
#include <PopUpMenu.h>
@@ -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);
@@ -12,9 +12,17 @@
#include <stdio.h>
#include <string.h>
#include <Catalog.h>
#include <Locale.h>
#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");
}
}
@@ -10,8 +10,16 @@
#include <stdio.h>
#include <Catalog.h>
#include <Locale.h>
#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");
}
@@ -12,10 +12,18 @@
#include <stdio.h>
#include <string.h>
#include <Catalog.h>
#include <Locale.h>
#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");
}
@@ -12,9 +12,17 @@
#include <stdio.h>
#include <string.h>
#include <Catalog.h>
#include <Locale.h>
#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");
}
@@ -11,8 +11,16 @@
#include <new>
#include <stdio.h>
#include <Catalog.h>
#include <Locale.h>
#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");
}
@@ -10,8 +10,16 @@
#include <stdio.h>
#include <Catalog.h>
#include <Locale.h>
#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");
}
@@ -11,8 +11,16 @@
#include <new>
#include <stdio.h>
#include <Catalog.h>
#include <Locale.h>
#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");
}
@@ -12,11 +12,19 @@
#include <stdio.h>
#include <string.h>
#include <Catalog.h>
#include <Locale.h>
#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 -
@@ -11,8 +11,16 @@
#include <new>
#include <stdio.h>
#include <Catalog.h>
#include <Locale.h>
#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");
}
@@ -11,9 +11,17 @@
#include <new>
#include <stdio.h>
#include <Catalog.h>
#include <Locale.h>
#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");
}
@@ -11,9 +11,17 @@
#include <new>
#include <stdio.h>
#include <Catalog.h>
#include <Locale.h>
#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");
}
@@ -11,9 +11,17 @@
#include <new>
#include <stdio.h>
#include <Catalog.h>
#include <Locale.h>
#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");
}
@@ -11,8 +11,16 @@
#include <new>
#include <stdio.h>
#include <Catalog.h>
#include <Locale.h>
#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),
@@ -10,8 +10,16 @@
#include <stdio.h>
#include <Catalog.h>
#include <Locale.h>
#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 << ("<modify path>");
name << B_TRANSLATE("<modify path>");
}
// _Select
@@ -11,10 +11,18 @@
#include <new>
#include <stdio.h>
#include <Catalog.h>
#include <Locale.h>
#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");
}
@@ -11,8 +11,16 @@
#include <new>
#include <stdio.h>
#include <Catalog.h>
#include <Locale.h>
#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
@@ -12,9 +12,17 @@
#include <stdio.h>
#include <string.h>
#include <Catalog.h>
#include <Locale.h>
#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");
}
@@ -12,9 +12,17 @@
#include <stdio.h>
#include <string.h>
#include <Catalog.h>
#include <Locale.h>
#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");
}
@@ -10,8 +10,16 @@
#include <stdio.h>
#include <Catalog.h>
#include <Locale.h>
#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");
}
@@ -7,9 +7,16 @@
#include <stdio.h>
#include <Catalog.h>
#include <Locale.h>
#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");
}
@@ -11,8 +11,16 @@
#include <new>
#include <stdio.h>
#include <Catalog.h>
#include <Locale.h>
#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");
}
@@ -8,10 +8,18 @@
#include "UnassignPathCommand.h"
#include <Catalog.h>
#include <Locale.h>
#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");
}
@@ -12,9 +12,17 @@
#include <stdio.h>
#include <string.h>
#include <Catalog.h>
#include <Locale.h>
#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");
}
@@ -8,9 +8,17 @@
#include "AssignStyleCommand.h"
#include <Catalog.h>
#include <Locale.h>
#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() << "\"";
}
@@ -11,9 +11,17 @@
#include <new>
#include <stdio.h>
#include <Catalog.h>
#include <Locale.h>
#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");
}
@@ -11,10 +11,18 @@
#include <new>
#include <stdio.h>
#include <Catalog.h>
#include <Locale.h>
#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");
}
@@ -11,9 +11,17 @@
#include <new>
#include <stdio.h>
#include <Catalog.h>
#include <Locale.h>
#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
@@ -11,9 +11,17 @@
#include <new>
#include <stdio.h>
#include <Catalog.h>
#include <Locale.h>
#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
@@ -11,8 +11,16 @@
#include <new>
#include <stdio.h>
#include <Catalog.h>
#include <Locale.h>
#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");
}
@@ -11,8 +11,10 @@
#include <math.h>
#include <stdio.h>
#include <Catalog.h>
#include <Cursor.h>
#include <InterfaceDefs.h>
#include <Locale.h>
#include <View.h>
#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");
}