index ea927f7f9a4ab93caffef66cc95fa4aab4c52e8e..27dd8413a25a7f22b5e4abd43a0705a580f1d7e7 100644 (file)
#include "sp-flowtext.h"
#include "sp-use.h"
#include "sp-rect.h"
+#include "box3d.h"
#include "sp-ellipse.h"
#include "sp-star.h"
#include "sp-anchor.h"
type2term(GType type)
{
if (type == SP_TYPE_ANCHOR)
- { return _("Link"); }
+ //TRANSLATORS: only translate "string" in "context|string".
+ // For more details, see http://developer.gnome.org/doc/API/2.0/glib/glib-I18N.html#Q-:CAPS
+ // "Link" means internet link (anchor)
+ { return Q_("web|Link"); }
if (type == SP_TYPE_CIRCLE)
{ return _("Circle"); }
if (type == SP_TYPE_ELLIPSE)
{ return _("Polyline"); }
if (type == SP_TYPE_RECT)
{ return _("Rectangle"); }
+ if (type == SP_TYPE_BOX3D)
+ { return _("3D Box"); }
if (type == SP_TYPE_TEXT)
{ return _("Text"); }
if (type == SP_TYPE_USE)
- { return _("Clone"); }
+ // TRANSLATORS: only translate "string" in "context|string".
+ // For more details, see http://developer.gnome.org/doc/API/2.0/glib/glib-I18N.html#Q-:CAPS
+ // "Clone" is a noun, type of object
+ { return Q_("object|Clone"); }
if (type == SP_TYPE_ARC)
{ return _("Ellipse"); }
if (type == SP_TYPE_OFFSET)
SelectionDescriber::SelectionDescriber(Inkscape::Selection *selection, MessageStack *stack)
: _context(stack)
{
- selection->connectChanged(sigc::mem_fun(*this, &SelectionDescriber::_updateMessageFromSelection));
+ _selection_changed_connection = new sigc::connection (
+ selection->connectChanged(
+ sigc::mem_fun(*this, &SelectionDescriber::_updateMessageFromSelection)));
+ _selection_modified_connection = new sigc::connection (
+ selection->connectModified(
+ sigc::mem_fun(*this, &SelectionDescriber::_selectionModified)));
+ _updateMessageFromSelection(selection);
+}
+
+SelectionDescriber::~SelectionDescriber()
+{
+ _selection_changed_connection->disconnect();
+ _selection_modified_connection->disconnect();
+ delete _selection_changed_connection;
+ delete _selection_modified_connection;
+}
+
+void SelectionDescriber::_selectionModified(Inkscape::Selection *selection, guint /*flags*/)
+{
_updateMessageFromSelection(selection);
}
@@ -145,10 +172,10 @@ void SelectionDescriber::_updateMessageFromSelection(Inkscape::Selection *select
else
in_phrase = g_strdup_printf(_(" in group %s (%s)"), parent_name, layer_name);
} else {
- in_phrase = g_strdup_printf(_(" in <b>%i</b> parents (%s)"), num_parents, layer_name);
+ in_phrase = g_strdup_printf(ngettext(" in <b>%i</b> parents (%s)", " in <b>%i</b> parents (%s)", num_parents), num_parents, layer_name);
}
} else {
- in_phrase = g_strdup_printf(_(" in <b>%i</b> layers"), num_layers);
+ in_phrase = g_strdup_printf(ngettext(" in <b>%i</b> layers", " in <b>%i</b> layers", num_layers), num_layers);
}
g_free (layer_name);
g_free (parent_name);