From b1c9fe34b114946b9a9c05708453913da5a4fa78 Mon Sep 17 00:00:00 2001 From: Patrick Storz Date: Fri, 11 Oct 2019 20:58:06 +0200 Subject: Make all status messages in node tool translatable Expand definitions of string literals. xgettext supports literal concatenation but not defines. This fixes some questionable syntax introduced in 81fbcdf00f09f7fc00c23bcecc0b1edfcce92b5f Fixes https://gitlab.com/inkscape/inkscape/issues/441 --- src/ui/tool/node.cpp | 64 ++++++++++++++++++++++------------------------------ 1 file changed, 27 insertions(+), 37 deletions(-) (limited to 'src/ui/tool/node.cpp') diff --git a/src/ui/tool/node.cpp b/src/ui/tool/node.cpp index addc0759c..e7fc7d0e4 100644 --- a/src/ui/tool/node.cpp +++ b/src/ui/tool/node.cpp @@ -523,12 +523,6 @@ static double snap_increment_degrees() { return 180.0 / snaps; } -#define DRAG_TO_SHAPE "drag to shape the path" -#define HOVER_TO_LOCK "hover to lock" -#define MAKE_SMOOTH "Shift+S to make smooth" -#define MAKE_SYMMETRIC "Shift+Y to make symmetric" -#define META_KEYS "(more: %s)" - Glib::ustring Handle::_getTip(unsigned state) const { /* a trick to mark as BSpline if the node has no strength; @@ -615,36 +609,36 @@ Glib::ustring Handle::_getTip(unsigned state) const if (_parent->type() == NODE_CUSP) { s = format_tip(C_("Path handle tip", "%s: " - DRAG_TO_SHAPE ", " - HOVER_TO_LOCK ", " - MAKE_SMOOTH ", " - MAKE_SYMMETRIC ". " - META_KEYS), + "drag to shape the path" ", " + "hover to lock" ", " + "Shift+S to make smooth" ", " + "Shift+Y to make symmetric" ". " + "(more: %s)"), handletype, more); } else if (_parent->type() == NODE_SMOOTH) { s = format_tip(C_("Path handle tip", "%s: " - DRAG_TO_SHAPE ", " - HOVER_TO_LOCK ", " - MAKE_SYMMETRIC ". " - META_KEYS), + "drag to shape the path" ", " + "hover to lock" ", " + "Shift+Y to make symmetric" ". " + "(more: %s)"), handletype, more); } else if (_parent->type() == NODE_AUTO) { s = format_tip(C_("Path handle tip", "%s: " "drag to make smooth, " - HOVER_TO_LOCK ", " - MAKE_SYMMETRIC ". " - META_KEYS), + "hover to lock" ", " + "Shift+Y to make symmetric" ". " + "(more: %s)"), handletype, more); } else if (_parent->type() == NODE_SYMMETRIC) { s = format_tip(C_("Path handle tip", "%s: " - DRAG_TO_SHAPE ". " - META_KEYS), + "drag to shape the path" ". " + "(more: %s)"), handletype, more); } else if (isBSpline) { @@ -1515,10 +1509,6 @@ Node *Node::nodeAwayFrom(Handle *h) return nullptr; } -#define CLICK_TO_SELECT "click to select only this node" -#define CLICK_TO_TOGGLE "click to toggle scale/rotation handles" -#define SHIFT_CTRL_ALT "(more: Shift, Ctrl, Alt)" - Glib::ustring Node::_getTip(unsigned state) const { bool isBSpline = _pm()._isBSpline(); @@ -1570,41 +1560,41 @@ Glib::ustring Node::_getTip(unsigned state) const if (!isBSpline) { s = format_tip(C_("Path node tip", "%s: " - DRAG_TO_SHAPE ". " - SHIFT_CTRL_ALT), + "drag to shape the path" ". " + "(more: Shift, Ctrl, Alt)"), nodetype); } else { s = format_tip(C_("Path node tip", "BSpline node (%.3g power): " - DRAG_TO_SHAPE ". " - SHIFT_CTRL_ALT), + "drag to shape the path" ". " + "(more: Shift, Ctrl, Alt)"), power); } } else { s = format_tip(C_("Path node tip", "%s: " - DRAG_TO_SHAPE ", " - CLICK_TO_TOGGLE ". " - SHIFT_CTRL_ALT), + "drag to shape the path" ", " + "click to toggle scale/rotation handles" ". " + "(more: Shift, Ctrl, Alt)"), nodetype); } } else if (!isBSpline) { s = format_tip(C_("Path node tip", "%s: " - DRAG_TO_SHAPE ", " - CLICK_TO_SELECT ". " - SHIFT_CTRL_ALT), + "drag to shape the path" ", " + "click to select only this node" ". " + "(more: Shift, Ctrl, Alt)"), nodetype); } else { s = format_tip(C_("Path node tip", "BSpline node (%.3g power): " - DRAG_TO_SHAPE ", " - CLICK_TO_SELECT ". " - SHIFT_CTRL_ALT), + "drag to shape the path" ", " + "click to select only this node" ". " + "(more: Shift, Ctrl, Alt)"), power); } } -- cgit v1.2.3