Index: cmdobj.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/scriptplugin/cmdobj.cpp,v
retrieving revision 1.11.2.10
diff -u -r1.11.2.10 cmdobj.cpp
--- cmdobj.cpp	3 Dec 2004 15:05:48 -0000	1.11.2.10
+++ cmdobj.cpp	8 Dec 2004 13:49:09 -0000
@@ -543,3 +543,18 @@
 	}
 	return styleList;
 }
+
+/*! 2004-12-08 CR
+ * Return the internal frame type number for a frame.
+ */
+PyObject* scribus_getframetype(PyObject* self, PyObject* args, PyObject* kw)
+{
+    char* frameName = "";
+    char* kwds[] = {"frame=", NULL};
+    if (!PyArg_ParseTupleAndKeywords(args, kw, "|s", kwds, &frameName))
+        return NULL;
+    PageItem *it = GetUniqueItem(QString(frameName));
+    if (it == NULL)
+        return NULL;
+    return PyInt_FromLong( (long)(it->PType) );
+}
Index: cmdobj.h
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/scriptplugin/cmdobj.h,v
retrieving revision 1.6.2.4
diff -u -r1.6.2.4 cmdobj.h
--- cmdobj.h	3 Dec 2004 15:05:48 -0000	1.6.2.4
+++ cmdobj.h	8 Dec 2004 13:49:09 -0000
@@ -185,5 +185,8 @@
 */
 PyObject *scribus_getstylenames(PyObject *self);
 
+/* Internal function not intended for general use; no docstring */
+PyObject* scribus_getframetype(PyObject* self, PyObject* args, PyObject* kw);
+
 #endif
 
Index: cmdtext.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/scriptplugin/cmdtext.cpp,v
retrieving revision 1.19.2.9
diff -u -r1.19.2.9 cmdtext.cpp
--- cmdtext.cpp	6 Dec 2004 20:03:42 -0000	1.19.2.9
+++ cmdtext.cpp	8 Dec 2004 13:49:09 -0000
@@ -11,6 +11,11 @@
 	PageItem *it = GetUniqueItem(QString(Name));
 	if (it == NULL)
 		return NULL;
+	if ((it->PType != FRAME_TEXT) && (it->PType != FRAME_PATHTEXT))
+	{
+		PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot get font size of non-text frame.","python error"));
+		return NULL;
+	}
 	if (it->HasSel)
 	{
 		for (uint b = 0; b < it->Ptext.count(); b++)
@@ -19,8 +24,6 @@
 	}
 	else
 		return PyFloat_FromDouble(static_cast<long>(it->ISize / 10.0));
-	//FIXME: How can we reach this point? Should we raise an exception instead of returning zero?
-	return PyFloat_FromDouble(0.0);
 }
 
 PyObject *scribus_getfont(PyObject *self, PyObject* args)
@@ -33,6 +36,11 @@
 	PageItem *it = GetUniqueItem(QString(Name));
 	if (it == NULL)
 		return NULL;
+	if ((it->PType != FRAME_TEXT) && (it->PType != FRAME_PATHTEXT))
+	{
+		PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot get font of non-text frame.","python error"));
+		return NULL;
+	}
 	if (it->HasSel)
 	{
 		for (uint b = 0; b < it->Ptext.count(); b++)
@@ -41,8 +49,6 @@
 	}
 	else
 		return PyString_FromString(it->IFont);
-	//FIXME: How do we reach this point? Should we be raising an exception instead of returning ""?
-	return PyString_FromString("");
 }
 
 PyObject *scribus_gettextsize(PyObject *self, PyObject* args)
@@ -53,7 +59,14 @@
 	if(!checkHaveDocument())
 		return NULL;
 	PageItem *i = GetUniqueItem(QString(Name));
-	return i != NULL ? PyInt_FromLong(static_cast<long>(i->Ptext.count())) : NULL;
+	if (i == NULL)
+		return NULL;
+	if ((i->PType != FRAME_TEXT) && (i->PType != FRAME_PATHTEXT))
+	{
+		PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot get text size of non-text frame.","python error"));
+		return NULL;
+	}
+	return PyInt_FromLong(static_cast<long>(i->Ptext.count()));
 }
 
 PyObject *scribus_getcolumns(PyObject *self, PyObject* args)
@@ -64,7 +77,14 @@
 	if(!checkHaveDocument())
 		return NULL;
 	PageItem *i = GetUniqueItem(QString(Name));
-	return i != NULL ? PyInt_FromLong(static_cast<long>(i->Cols)) : NULL;
+	if (i == NULL)
+		return NULL;
+	if (i->PType != FRAME_TEXT)
+	{
+		PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot get column count of non-text frame.","python error"));
+		return NULL;
+	}
+	return PyInt_FromLong(static_cast<long>(i->Cols));
 }
 
 PyObject *scribus_getlinespace(PyObject *self, PyObject* args)
@@ -75,7 +95,14 @@
 	if(!checkHaveDocument())
 		return NULL;
 	PageItem *i = GetUniqueItem(QString(Name));
-	return i != NULL ? PyFloat_FromDouble(static_cast<double>(i->LineSp)) : NULL;
+	if (i == NULL)
+		return NULL;
+	if (i->PType != FRAME_TEXT)
+	{
+		PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot get line space of non-text frame.","python error"));
+		return NULL;
+	}
+	return PyFloat_FromDouble(static_cast<double>(i->LineSp));
 }
 
 PyObject *scribus_getcolumngap(PyObject *self, PyObject* args)
@@ -86,7 +113,14 @@
 	if(!checkHaveDocument())
 		return NULL;
 	PageItem *i = GetUniqueItem(QString(Name));
-	return i != NULL ? PyFloat_FromDouble(static_cast<double>(i->ColGap)) : NULL;
+	if (i == NULL)
+		return NULL;
+	if (i->PType != FRAME_TEXT)
+	{
+		PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot get column gap of non-text frame.","python error"));
+		return NULL;
+	}
+	return PyFloat_FromDouble(static_cast<double>(i->ColGap));
 }
 
 PyObject *scribus_getframetext(PyObject *self, PyObject* args)
@@ -100,6 +134,11 @@
 	PageItem *it = GetUniqueItem(QString(Name));
 	if (it == NULL)
 		return NULL;
+	if ((it->PType != FRAME_TEXT) && (it->PType != FRAME_PATHTEXT))
+	{
+		PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot get text of non-text frame.","python error"));
+		return NULL;
+	}
 	for (uint a = 0; a < it->Ptext.count(); a++)
 	{
 		if (it->HasSel)
@@ -112,7 +151,6 @@
 			text += it->Ptext.at(a)->ch;
 		}
 	}
-	//qDebug(text);		disabled by cr 2004-11-11
 	return PyString_FromString(text);
 }
 
@@ -127,6 +165,11 @@
 	PageItem *it = GetUniqueItem(QString(Name));
 	if (it == NULL)
 		return NULL;
+	if ((it->PType != FRAME_TEXT) && (it->PType != FRAME_PATHTEXT))
+	{
+		PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot get text of non-text frame.","python error"));
+		return NULL;
+	}
 	PageItem *is = NULL;
 	// Scan backwards to find the first frame in a linked series
 	while (it->BackBox != 0)
@@ -136,7 +179,9 @@
 		{
 			// While GetUniqueItem has already set an exception, we'll
 			// overwrite that with a more suitable one for this particular case.
-			PyErr_SetString(PyExc_RuntimeError, QString("(System Error) Broken linked frame series when scanning back"));
+			// Not making this translatable, since it shouldnt' be seen and it's more important for
+			// us to be able to understand the error if it's reported.
+			PyErr_SetString(ScribusException, QString("(System Error) Broken linked frame series when scanning back"));
 			return NULL;
 		}
 		it = is;
@@ -162,6 +207,8 @@
 		{
 			// While GetUniqueItem has already set an exception, we'll
 			// overwrite that with a more suitable one for this particular case.
+			// Not making this translatable, since it shouldnt' be seen and it's more important for
+			// us to be able to understand the error if it's reported.
 			PyErr_SetString(ScribusException, QString("(System Error) Broken linked frame series when scanning forward"));
 			return NULL;
 		}
@@ -194,6 +241,11 @@
 	PageItem *it = GetUniqueItem(QString(Name));
 	if (it == NULL)
 		return NULL;
+	if ((it->PType != FRAME_TEXT) && (it->PType != FRAME_PATHTEXT))
+	{
+		PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot set text of non-text frame.","python error"));
+		return NULL;
+	}
 	QString Daten = QString::fromUtf8(Text);
 	PyMem_Free(Text);
 	if (it->NextBox != 0)
@@ -248,11 +300,16 @@
 	PageItem *it = GetUniqueItem(QString(Name));
 	if (it == NULL)
 		return NULL;
+	if ((it->PType != FRAME_TEXT) && (it->PType != FRAME_PATHTEXT))
+	{
+		PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot insert text into non-text frame.","python error"));
+		return NULL;
+	}
 	QString Daten = QString::fromUtf8(Text);
 	PyMem_Free(Text);
 	if ((pos < 0) && (pos > static_cast<int>(it->Ptext.count())))
 	{
-		PyErr_SetString(PyExc_IndexError, QString("Insert index out of bounds"));
+		PyErr_SetString(PyExc_IndexError, QObject::tr("Insert index out of bounds","python error"));
 		return NULL;
 	}
 	for (uint a = 0; a < Daten.length(); ++a)
@@ -295,15 +352,15 @@
 		return NULL;
 	if ((alignment > 4) || (alignment < 0))
 	{
-		PyErr_SetString(PyExc_ValueError, QString("Alignment out of range. Use one of the scribus.ALIGN* constants."));
+		PyErr_SetString(PyExc_ValueError, QObject::tr("Alignment out of range. Use one of the scribus.ALIGN* constants.","python error"));
 		return NULL;
 	}
 	PageItem *i = GetUniqueItem(QString(Name));
 	if (i == NULL)
 		return NULL;
-	if (i->PType == 4)
+	if (i->PType != FRAME_TEXT)
 	{
-		PyErr_SetString(ScribusException, QString("Can't set text alignment on a non-text frame"));
+		PyErr_SetString(WrongFrameTypeError, QObject::tr("Can't set text alignment on a non-text frame","python error"));
 		return NULL;
 	}
 	int Apm = Carrier->doc->AppMode;
@@ -328,16 +385,16 @@
 		return NULL;
 	if ((size > 512) || (size < 1))
 	{
-		PyErr_SetString(ScribusException, QString("Font size out of bounds - must be 1 <= size <= 512"));
+		PyErr_SetString(PyExc_ValueError, QObject::tr("Font size out of bounds - must be 1 <= size <= 512","python error"));
 		return NULL;
 	}
 	PageItem *i = GetUniqueItem(QString(Name));
 	if (i == NULL)
 		return NULL;
 	
-	if (i->PType == 4)
+	if (i->PType != FRAME_TEXT)
 	{
-		PyErr_SetString(ScribusException, QString("Can't set text alignment on a non-text frame"));
+		PyErr_SetString(WrongFrameTypeError, QObject::tr("Can't set font size on a non-text frame","python error"));
 		return NULL;
 	}
 	int Apm = Carrier->doc->AppMode;
@@ -363,9 +420,9 @@
 	PageItem *i = GetUniqueItem(QString(Name));
 	if (i == NULL)
 		return NULL;
-	if (i->PType != 4)
+	if ((i->PType != FRAME_TEXT) && (i->PType != FRAME_PATHTEXT))
 	{
-		PyErr_SetString(ScribusException, QString("Can't set font on a non-text frame"));
+		PyErr_SetString(WrongFrameTypeError, QObject::tr("Can't set font on a non-text frame","python error"));
 		return NULL;
 	}
 	if (Carrier->Prefs.AvailFonts.find(QString(Font)))
@@ -381,7 +438,7 @@
 	}
 	else
 	{
-		PyErr_SetString(ScribusException, QString("Font not found"));
+		PyErr_SetString(PyExc_ValueError, QObject::tr("Font not found","python error"));
 		return NULL;
 	}
 	Py_INCREF(Py_None);
@@ -398,12 +455,17 @@
 		return NULL;
 	if (w < 0.1)
 	{
-		PyErr_SetString(PyExc_ValueError, QString("Line space out of bounds, must be >= 0.1"));
+		PyErr_SetString(PyExc_ValueError, QObject::tr("Line space out of bounds, must be >= 0.1","python error"));
 		return NULL;
 	}
 	PageItem *i = GetUniqueItem(QString(Name));
 	if (i == NULL)
 		return NULL;
+	if (i->PType != FRAME_TEXT)
+	{
+		PyErr_SetString(WrongFrameTypeError, QObject::tr("Can't line spacing on a non-text frame","python error"));
+		return NULL;
+	}
 	i->LineSp = w;
 	Py_INCREF(Py_None);
 	return Py_None;
@@ -419,12 +481,17 @@
 		return NULL;
 	if (w < 0.0)
 	{
-		PyErr_SetString(PyExc_ValueError, QString("Column gap out of bounds, must be positive"));
+		PyErr_SetString(PyExc_ValueError, QObject::tr("Column gap out of bounds, must be positive","python error"));
 		return NULL;
 	}
 	PageItem *i = GetUniqueItem(QString(Name));
 	if (i == NULL)
 		return NULL;
+	if (i->PType != FRAME_TEXT)
+	{
+		PyErr_SetString(WrongFrameTypeError, QObject::tr("Can't column gap on a non-text frame","python error"));
+		return NULL;
+	}
 	i->ColGap = w;
 	Py_INCREF(Py_None);
 	return Py_None;
@@ -440,12 +507,17 @@
 		return NULL;
 	if (w < 1)
 	{
-		PyErr_SetString(PyExc_ValueError, QString("Column count out of bounds, must be > 1"));
+		PyErr_SetString(PyExc_ValueError, QObject::tr("Column count out of bounds, must be > 1","python error"));
 		return NULL;
 	}
 	PageItem *i = GetUniqueItem(QString(Name));
 	if (i == NULL)
 		return NULL;
+	if (i->PType != FRAME_TEXT)
+	{
+		PyErr_SetString(WrongFrameTypeError, QObject::tr("Can't number of columns on a non-text frame","python error"));
+		return NULL;
+	}
 	i->Cols = w;
 	Py_INCREF(Py_None);
 	return Py_None;
@@ -464,7 +536,12 @@
 		return NULL;
 	if ((start < 0) || ((start + ende) > static_cast<int>(it->Ptext.count()-1)))
 	{
-		PyErr_SetString(PyExc_IndexError, QString("Selection index out of bounds"));
+		PyErr_SetString(PyExc_IndexError, QObject::tr("Selection index out of bounds","python error"));
+		return NULL;
+	}
+	if ((it->PType != FRAME_TEXT) && (it->PType != FRAME_PATHTEXT))
+	{
+		PyErr_SetString(WrongFrameTypeError, QObject::tr("Can't select text in a non-text frame","python error"));
 		return NULL;
 	}
 	/* FIXME: not sure if we should make this check or not
@@ -499,6 +576,11 @@
 	PageItem *it = GetUniqueItem(QString(Name));
 	if (it == NULL)
 		return NULL;
+	if ((it->PType != FRAME_TEXT) && (it->PType != FRAME_PATHTEXT))
+	{
+		PyErr_SetString(WrongFrameTypeError, QObject::tr("Can't delete text from a non-text frame","python error"));
+		return NULL;
+	}
 	if (it->HasSel)
 		Carrier->DeleteSel(it);
 	else
@@ -521,7 +603,12 @@
 	PageItem *it = GetUniqueItem(QString(Name));
 	if (it == NULL)
 		return NULL;
-	if ((it->PType == 4) || (it->PType == 8))
+	if ((it->PType != FRAME_TEXT) && (it->PType != FRAME_PATHTEXT))
+	{
+		PyErr_SetString(WrongFrameTypeError, QObject::tr("Can't set text fill on a non-text frame","python error"));
+		return NULL;
+	}
+	else
 	{
 		for (uint b = 0; b < it->Ptext.count(); b++)
 		{
@@ -535,11 +622,6 @@
 		}
 		it->TxtFill = QString(Color);
 	}
-	else
-	{
-		PyErr_SetString(ScribusException, QString("Wrong frame type, can't set text color"));
-		return NULL;
-	}
 	Py_INCREF(Py_None);
 	return Py_None;
 }
@@ -555,7 +637,12 @@
 	PageItem *it = GetUniqueItem(QString(Name));
 	if (it == NULL)
 		return NULL;
-	if ((it->PType == 4) || (it->PType == 8))
+	if ((it->PType != FRAME_TEXT) && (it->PType != FRAME_PATHTEXT))
+	{
+		PyErr_SetString(WrongFrameTypeError, QObject::tr("Can't set text stroke on a non-text frame","python error"));
+		return NULL;
+	}
+	else
 	{
 		for (uint b = 0; b < it->Ptext.count(); b++)
 		{
@@ -569,11 +656,6 @@
 		}
 		it->TxtStroke = QString(Color);
 	}
-	else
-	{
-		PyErr_SetString(ScribusException, QString("Wrong frame type, can't set text color"));
-		return NULL;
-	}
 	Py_INCREF(Py_None);
 	return Py_None;
 }
@@ -594,7 +676,12 @@
 	PageItem *it = GetUniqueItem(QString(Name));
 	if (it == NULL)
 		return NULL;
-	if ((it->PType == 4) || (it->PType == 8))
+	if ((it->PType != FRAME_TEXT) && (it->PType != FRAME_PATHTEXT))
+	{
+		PyErr_SetString(WrongFrameTypeError, QObject::tr("Can't set text shade on a non-text frame","python error"));
+		return NULL;
+	}
+	else
 	{
 		for (uint b = 0; b < it->Ptext.count(); ++b)
 		{
@@ -608,11 +695,6 @@
 		}
 	it->ShTxtFill = w;
 	}
-	else
-	{
-		PyErr_SetString(ScribusException, QString("Wrong frame type, can't set text shade"));
-		return NULL;
-	}
 	Py_INCREF(Py_None);
 	return Py_None;
 }
@@ -632,24 +714,29 @@
 	PageItem *toitem = GetUniqueItem(QString(name2));
 	if (toitem == NULL)
 		return NULL;
+	if ((fromitem->PType != FRAME_TEXT) || (toitem->PType != FRAME_TEXT))
+	{
+		PyErr_SetString(WrongFrameTypeError, QObject::tr("Can only link text frames","python error"));
+		return NULL;
+	}
 	if (toitem->Ptext.count())
 	{
-		PyErr_SetString(ScribusException, QString("Target frame must be empty"));
+		PyErr_SetString(ScribusException, QObject::tr("Target frame must be empty","python error"));
 		return NULL;
 	}
 	if (toitem->NextBox != 0)
 	{
-		PyErr_SetString(ScribusException, QString("Target frame links to another frame"));
+		PyErr_SetString(ScribusException, QObject::tr("Target frame links to another frame","python error"));
 		return NULL;
 	}
 	if (toitem->BackBox != 0)
 	{
-		PyErr_SetString(ScribusException, QString("Target frame is linked to by another frame"));
+		PyErr_SetString(ScribusException, QObject::tr("Target frame is linked to by another frame","python error"));
 		return NULL;
 	}
 	if (toitem == fromitem)
 	{
-		PyErr_SetString(ScribusException, QString("Source and target are the same object"));
+		PyErr_SetString(ScribusException, QObject::tr("Source and target are the same object","python error"));
 		return NULL;
 	}
 	// references to the others boxes
@@ -672,15 +759,20 @@
 	PageItem *item = GetUniqueItem(name);
 	if (item == NULL)
 		return NULL;
+	if (item->PType != FRAME_TEXT)
+	{
+		PyErr_SetString(WrongFrameTypeError, QObject::tr("Can't unlink a non-text frame","python error"));
+		return NULL;
+	}
 	// only linked
 	if (item->BackBox == 0)
 	{
-		PyErr_SetString(ScribusException, QString("Object is not a linked text frame, can't unlink."));
+		PyErr_SetString(ScribusException, QObject::tr("Object is not a linked text frame, can't unlink.","python error"));
 		return NULL;
 	}
 	if (item->NextBox == 0)
 	{
-		PyErr_SetString(ScribusException, QString("Object the last frame in a series, can't unlink."));
+		PyErr_SetString(ScribusException, QObject::tr("Object the last frame in a series, can't unlink. Unlink the previous frame instead.","python error"));
 		return NULL;
 	}
 	PageItem* nextbox = item->NextBox;
@@ -719,9 +811,9 @@
 	PageItem *item = GetUniqueItem(QString(name));
 	if (item == NULL)
 		return NULL;
-	if (item->PType == 4)
+	if (item->PType != FRAME_TEXT)
 	{
-		PyErr_SetString(ScribusException, QString("Cannot convert a non-text frame to outlines"));
+		PyErr_SetString(WrongFrameTypeError, QObject::tr("Can't convert a non-text frame to outlines","python error"));
 		return NULL;
 	}
 	Carrier->view->Deselect(true);
Index: cmdtext.h
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/scriptplugin/cmdtext.h,v
retrieving revision 1.6.2.3
diff -u -r1.6.2.3 cmdtext.h
--- cmdtext.h	3 Dec 2004 15:05:48 -0000	1.6.2.3
+++ cmdtext.h	8 Dec 2004 13:49:10 -0000
@@ -8,201 +8,264 @@
 
 /*! docstring */
 PyDoc_STRVAR(scribus_getfontsize__doc__,
-    "getFontSize([\"name\"]) -> float\n\n\
-Returns the fontsize for the textframe \"name\". If this\
-textframe has some text selected the value assigned to\
-the first character of the selection is returned.\
-If \"name\" is not given the currently selected item is used.");
+QT_TR_NOOP("getFontSize([\"name\"]) -> float\n\
+\n\
+Returns the font size in points for the text frame \"name\". If this text\n\
+frame has some text selected the value assigned to the first character of\n\
+the selection is returned.\n\
+If \"name\" is not given the currently selected item is used.\n\
+"));
 /*! Get font size */
 PyObject *scribus_getfontsize(PyObject *self, PyObject* args);
 
 /*! docstring */
 PyDoc_STRVAR(scribus_getfont__doc__,
-    "getFont([\"name\"]) -> string\n\n\
-Returns the font for the textframe \"name\". If this\
-textframe has some text selected the value assigned to the\
-first character of the selection is returned. If \"name\"\
-is not given the currently selected Item is used.");
+QT_TR_NOOP("getFont([\"name\"]) -> string\n\
+\n\
+Returns the font name for the text frame \"name\". If this text frame\n\
+has some text selected the value assigned to the first character\n\
+of the selection is returned. If \"name\" is not given the currently\n\
+selected item is used.\n\
+"));
 /*! Get font */
 PyObject *scribus_getfont(PyObject *self, PyObject* args);
 
 /*! docstring */
 PyDoc_STRVAR(scribus_gettextsize__doc__,
-    "getTextLength([\"name\"]) -> integer\n\n\
-Returns the length of the text in the textframe \"name\".\
-If \"name\" is not given the currently selected item is used.");
+QT_TR_NOOP("getTextLength([\"name\"]) -> integer\n\
+\n\
+Returns the length of the text in the text frame \"name\".\n\
+If \"name\" is not given the currently selected item is used.\n\
+"));
 /*! Get text size */
 PyObject *scribus_gettextsize(PyObject *self, PyObject* args);
 
 /*! docstring */
 PyDoc_STRVAR(scribus_getframetext__doc__,
-    "getText([\"name\"]) -> string\n\n\
-Returns the text of the textframe \"name\". If this textframe\
-has some text selected, this text is returned. If \"name\" is\
-not given the currently selected item is used.");
+QT_TR_NOOP("getText([\"name\"]) -> string\n\
+\n\
+Returns the text of the text frame \"name\". If this text frame has some text\n\
+selected, the selected text is returned. All text in the frame, not just\n\
+currently visible text, is returned. If \"name\" is not given the currently\n\
+selected item is used.\n\
+"));
 /*! Get frame text */
 PyObject *scribus_getframetext(PyObject *self, PyObject* args);
 
 /*! docstring */
 PyDoc_STRVAR(scribus_gettext__doc__,
-    "getAllText([\"name\"]) -> string\n\n\
-Returns the text of the textframe \"name\" and of all\
-textframes which are linked with this frame. If this textframe\
-has some text selected, this text is returned. If \"name\"\
-is not given the currently selected Item is used.");
+QT_TR_NOOP("getAllText([\"name\"]) -> string\n\
+\n\
+Returns the text of the text frame \"name\" and of all text frames which are\n\
+linked with this frame. If this textframe has some text selected, the selected\n\
+text is returned. If \"name\" is not given the currently selected item is\n\
+used.\n\
+"));
 /*! Get all text */
 PyObject *scribus_gettext(PyObject *self, PyObject* args);
 
 /*! docstring */
 PyDoc_STRVAR(scribus_getlinespace__doc__,
-    "getLineSpacing([\"name\"]) -> float\n\n\
-Gets the linespacing of the text frame \"name\" expressed\
-in points. If \"name\" is not given the currently selected\
-item is used.");
+QT_TR_NOOP("getLineSpacing([\"name\"]) -> float\n\
+\n\
+Returns the line spacing (\"leading\") of the text frame \"name\" expressed in\n\
+points. If \"name\" is not given the currently selected item is used.\n\
+"));
 /*! Get line space */
 PyObject *scribus_getlinespace(PyObject *self, PyObject* args);
 
 /*! docstring */
 PyDoc_STRVAR(scribus_getcolumngap__doc__,
-    "getColumnGap([\"name\"]) -> float\n\n\
-Gets the column gap of the text frame \"name\" expressed\
-in points. If \"name\" is not given the currently selected\
-item is used.");
+QT_TR_NOOP("getColumnGap([\"name\"]) -> float\n\
+\n\
+Returns the column gap size of the text frame \"name\" expressed in points. If\n\
+\"name\" is not given the currently selected item is used.\n\
+"));
 /*! Get column gap */
 PyObject *scribus_getcolumngap(PyObject *self, PyObject* args);
 
 /*! docstring */
 PyDoc_STRVAR(scribus_getcolumns__doc__,
-    "getColumns([\"name\"]) -> integer\n\n\
-Gets the number of columns of the text frame \"name\".\
-If \"name\" is not given the currently selected item is used.");
+QT_TR_NOOP("getColumns([\"name\"]) -> integer\n\
+\n\
+Gets the number of columns of the text frame \"name\". If \"name\" is not\n\
+given the currently selected item is used.\n\
+"));
 /*! Get columns */
 PyObject *scribus_getcolumns(PyObject *self, PyObject* args);
 
 /*! docstring */
 PyDoc_STRVAR(scribus_setboxtext__doc__,
-    "setText(\"text\", [\"name\"])\n\n\
-Sets the text of the text frame \"name\" to the text of the\
-string \"text\". Text must be UTF8 encoded - use e.g. unicode(text, 'iso-8859-2').\
-If \"name\" is not given the currently selected item is used.");
+QT_TR_NOOP("setText(\"text\", [\"name\"])\n\
+\n\
+Sets the text of the text frame \"name\" to the text of the string \"text\".\n\
+Text must be UTF8 encoded - use e.g. unicode(text, 'iso-8859-2'). See the FAQ\n\
+for more details. If \"name\" is not given the currently selected item is\n\
+used.\n\
+"));
 /*! Set text */
 PyObject *scribus_setboxtext(PyObject *self, PyObject* args);
 
 /*! docstring */
 PyDoc_STRVAR(scribus_inserttext__doc__,
-    "insertText(\"text\", pos, [\"name\"])\n\n\
-Inserts the text \"text\" at the position \"pos\" into the textframe.\
-Text must be UTF encoded (see setText() as reference)\
-The first character has an index of 0. \"name\" If \"name\" is not\
-given the currently selected Item is used.");
+QT_TR_NOOP("insertText(\"text\", pos, [\"name\"])\n\
+\n\
+Inserts the text \"text\" at the position \"pos\" into the text frame. Text\n\
+must be UTF encoded (see setText() as reference) The first character has an\n\
+index of 0. \"name\" If \"name\" is not given the currently selected Item is\n\
+used.\n\
+\n\
+May throw IndexError for an insertion out of bounds.\n\
+"));
 /*! Insert text */
 PyObject *scribus_inserttext(PyObject *self, PyObject* args);
 
 /*! docstring */
 PyDoc_STRVAR(scribus_setfont__doc__,
-    "setFont(\"font\", [\"name\"])\n\n\
-Sets the font of the text frame \"name\" to \"font\", if there\
-is some text selected only the selected text is changed.\
-If \"name\" is not given the currently selected item is used.");
+QT_TR_NOOP("setFont(\"font\", [\"name\"])\n\
+\n\
+Sets the font of the text frame \"name\" to \"font\". If there is some text\n\
+selected only the selected text is changed.  If \"name\" is not given the\n\
+currently selected item is used.\n\
+\n\
+May throw ValueError if the font cannot be found.\n\
+"));
 /*! Set font */
 PyObject *scribus_setfont(PyObject *self, PyObject* args);
 
 /*! docstring */
 PyDoc_STRVAR(scribus_setfontsize__doc__,
-    "setFontSize(size, [\"name\"])\n\n\
-Sets the fontsize of the text frame \"name\" to the pointsize\
-\"size\", if there is some text selected only the selected Text\
-is changed. \"size\" must be in the Range 1 to 512. If \"name\"\
-is not given the currently selected item is used.");
+QT_TR_NOOP("setFontSize(size, [\"name\"])\n\
+\n\
+Sets the font size of the text frame \"name\" to \"size\". \"size\" is treated\n\
+as a value in points. If there is some text selected only the selected text is\n\
+changed. \"size\" must be in the range 1 to 512. If \"name\" is not given the\n\
+currently selected item is used.\n\
+\n\
+May throw ValueError for a font size that's out of bounds.\n\
+"));
 /*! Set font size */
 PyObject *scribus_setfontsize(PyObject *self, PyObject* args);
 
 /*! docstring */
 PyDoc_STRVAR(scribus_setlinespace__doc__,
-    "setLineSpacing(size, [\"name\"])\n\n\
-Sets the linespacing of the text frame \"name\" to the pointsize\
-\"size\". If \"name\" is not given the currently selected item is used.");
+QT_TR_NOOP("setLineSpacing(size, [\"name\"])\n\
+\n\
+Sets the line spacing (\"leading\") of the text frame \"name\" to \"size\".\n\
+\"size\" is a value in points. If \"name\" is not given the currently selected\n\
+item is used.\n\
+\n\
+May throw ValueError if the line spacing is out of bounds.\n\
+"));
 /*! Set line space */
 PyObject *scribus_setlinespace(PyObject *self, PyObject* args);
 
 /*! docstring */
 PyDoc_STRVAR(scribus_setcolumngap__doc__,
-    "setColumnGap(size, [\"name\"])\n\n\
-Sets the column gap of the text frame \"name\" to the value \"size\".\
-If \"name\" is not given the currently selected item is used.");
+QT_TR_NOOP("setColumnGap(size, [\"name\"])\n\
+\n\
+Sets the column gap of the text frame \"name\" to the value \"size\". If\n\
+\"name\" is not given the currently selected item is used.\n\
+\n\
+May throw ValueError if the column gap is out of bounds (must be positive).\n\
+"));
 /*! Set column gap */
 PyObject *scribus_setcolumngap(PyObject *self, PyObject* args);
 
 /*! docstring */
 PyDoc_STRVAR(scribus_setcolumns__doc__,
-    "setColumns(nr, [\"name\"])\n\n\
-Sets the number of columns of the text frame \"name\"\
-to the value \"nr\". If \"name\" is not given the currently\
-selected item is used.");
+QT_TR_NOOP("setColumns(nr, [\"name\"])\n\
+\n\
+Sets the number of columns of the text frame \"name\" to the integer \"nr\".\n\
+If \"name\" is not given the currently selected item is used.\n\
+\n\
+May throw ValueError if number of columns is not at least one.\n\
+"));
 /*! Set columns */
 PyObject *scribus_setcolumns(PyObject *self, PyObject* args);
 
 /*! docstring */
 PyDoc_STRVAR(scribus_setalign__doc__,
-    "setTextAlignment(align, [\"name\"])\n\n\
-Sets the text alignment of the text frame \"name\" to the specified\
-alignment. If \"name\" is not given the currently selected item is\
-used. \"align\" can have the defined constants - see ALIGN_<type>.");
+QT_TR_NOOP("setTextAlignment(align, [\"name\"])\n\
+\n\
+Sets the text alignment of the text frame \"name\" to the specified alignment.\n\
+If \"name\" is not given the currently selected item is used. \"align\" should\n\
+be one of the ALIGN_ constants defined in this module - see dir(scribus).\n\
+\n\
+May throw ValueError for an invalid alignment constant.\n\
+"));
 /*! Set alignt */
 PyObject *scribus_setalign(PyObject *self, PyObject* args);
 
 /*! docstring */
 PyDoc_STRVAR(scribus_selecttext__doc__,
-    "selectText(start, count, [\"name\"])\n\n\
-Selects \"count\" characters text of the text frame \"name\"\
-starting from the character \"start\". Character counting starts\
-at 0. If \"count\" is zero, any text selection will be cleared.\
-If \"name\" is not given the currently selected item is used.");
+QT_TR_NOOP("selectText(start, count, [\"name\"])\n\
+\n\
+Selects \"count\" characters of text in the text frame \"name\" starting from the\n\
+character \"start\". Character counting starts at 0. If \"count\" is zero, any\n\
+text selection will be cleared.  If \"name\" is not given the currently\n\
+selected item is used.\n\
+\n\
+May throw IndexError if the selection is outside the bounds of the text.\n\
+"));
 /*! Select text */
 PyObject *scribus_selecttext(PyObject *self, PyObject* args);
 
 /*! docstring */
 PyDoc_STRVAR(scribus_deletetext__doc__,
-    "deleteText([\"name\"])\n\n\
-Deletes the text of the text frame \"name\". If there is some\
-text selected, this text will be deleted. If \"name\" is not\
-given the currently selected Item is used.");
+QT_TR_NOOP("deleteText([\"name\"])\n\
+\n\
+Deletes any text in the text frame \"name\". If there is some text selected,\n\
+only the selected text will be deleted. If \"name\" is not given the currently\n\
+selected item is used.\n\
+"));
 /*! Delete text */
 PyObject *scribus_deletetext(PyObject *self, PyObject* args);
 
 /*! docstring */
 PyDoc_STRVAR(scribus_settextfill__doc__,
-    "setTextColor(\"color\", [\"name\"])\n\n\
-Sets the text color of the object \"name\" to the color\
-\"color\", if there is some text selected only the selected\
-text is changed. If \"name\" is not given the currently\
-selected item is used.");
+QT_TR_NOOP("setTextColor(\"color\", [\"name\"])\n\
+\n\
+Sets the text color of the text frame \"name\" to the color \"color\". If there\n\
+is some text selected only the selected text is changed. If \"name\" is not\n\
+given the currently selected item is used.\n\
+"));
 /*! Set text fill */
 PyObject *scribus_settextfill(PyObject *self, PyObject* args);
 
 /*! docstring */
 PyDoc_STRVAR(scribus_settextstroke__doc__,
-    "setTextStroke(\"color\", [\"name\"])\n\n\
-Set \"color\" of the text stroke. If \"name\" is not given the currently\
-selected item is used.");
+QT_TR_NOOP("setTextStroke(\"color\", [\"name\"])\n\
+\n\
+Set \"color\" of the text stroke. If \"name\" is not given the currently\n\
+selected item is used.\n\
+"));
 /*! Set text stroke */
 PyObject *scribus_settextstroke(PyObject *self, PyObject* args);
 
 /*! docstring */
 PyDoc_STRVAR(scribus_settextshade__doc__,
-    "setTextShade(shade, [\"name\"])\n\n\
-Sets the shading of the text color of the object \"name\" to \"shade\",\
-if there is some text selected only the selected text is changed. \"shade\"\
-must be an integer value in the range from 0 (lightest) to 100 (full\
-color intensity). If \"name\" is not given the currently selected\
-item is used.");
+QT_TR_NOOP("setTextShade(shade, [\"name\"])\n\
+\n\
+Sets the shading of the text color of the object \"name\" to \"shade\". If\n\
+there is some text selected only the selected text is changed. \"shade\" must\n\
+be an integer value in the range from 0 (lightest) to 100 (full color\n\
+intensity). If \"name\" is not given the currently selected item is\n\
+used.\n\
+"));
 /*! Set text shde */
 PyObject *scribus_settextshade(PyObject *self, PyObject* args);
 
 /*! docstring */
 PyDoc_STRVAR(scribus_linktextframes__doc__,
-    "linkTextFrames(\"name1\", \"name2\")\n\n\
-Create the linked text frames. Parameters are the object names.");
+QT_TR_NOOP("linkTextFrames(\"fromname\", \"toname\")\n\
+\n\
+Link two text frames. The frame named \"fromname\" is linked to the\n\
+frame named \"toname\". The target frame must be an empty text frame\n\
+and must not link to or be linked from any other frames already.\n\
+\n\
+May throw ScribusException if linking rules are violated.\n\
+"));
 /**
  Link text frames via Scripter.
  02/22/04 (petr vanek)
@@ -212,8 +275,14 @@
 
 /*! docstring */
 PyDoc_STRVAR(scribus_unlinktextframes__doc__,
-    "linkTextFrames(\"name\")\n\n\
-Remove the specified (named) object from the text frame flow/linkage.");
+QT_TR_NOOP("unlinkTextFrames(\"name\")\n\
+\n\
+Remove the specified (named) object from the text frame flow/linkage. If the\n\
+frame was in the middle of a chain, the previous and next frames will be\n\
+connected, eg 'a->b->c' becomes 'a->c' when you unlinkTextFrames(b)'\n\
+\n\
+May throw ScribusException if linking rules are violated.\n\
+"));
 /**
  (Un)Link text frames via Scripter.
  02/22/04 (petr vanek)
@@ -223,9 +292,10 @@
 
 /*! docstring */
 PyDoc_STRVAR(scribus_tracetext__doc__,
-    "traceText([\"name\"])\n\n\
-Convert the text frame \"name\" to outlines. If \"name\" is not\
-given the currently selected item is used.");
+QT_TR_NOOP("traceText([\"name\"])\n\
+\n\
+Convert the text frame \"name\" to outlines. If \"name\" is not given the\n\
+currently selected item is used."));
 /**
  Trace text frames via Scripter.
  2004-09-07 (Craig Ringer)
Index: cmdutil.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/scriptplugin/cmdutil.cpp,v
retrieving revision 1.6.2.6
diff -u -r1.6.2.6 cmdutil.cpp
--- cmdutil.cpp	3 Dec 2004 15:05:48 -0000	1.6.2.6
+++ cmdutil.cpp	8 Dec 2004 13:49:10 -0000
@@ -137,7 +137,7 @@
 			return Carrier->view->SelItem.at(0);
 		else
 		{
-			PyErr_SetString(ScribusException, QString("Can't use empty string for object name when there is no selection"));
+			PyErr_SetString(NoValidObjectError, QString("Can't use empty string for object name when there is no selection"));
 			return NULL;
 		}
 	for (uint j = 0; j<Carrier->doc->Items.count(); j++)
@@ -145,7 +145,7 @@
 		if (name==Carrier->doc->Items.at(j)->AnName)
 			return Carrier->doc->Items.at(j);
 	} // for items
-	PyErr_SetString(ScribusException, QString("Object not found"));
+	PyErr_SetString(NoValidObjectError, QString("Object not found"));
 	return NULL;
 }
 
Index: cmdvar.h
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/scriptplugin/cmdvar.h,v
retrieving revision 1.6.2.4
diff -u -r1.6.2.4 cmdvar.h
--- cmdvar.h	3 Dec 2004 15:05:48 -0000	1.6.2.4
+++ cmdvar.h	8 Dec 2004 13:49:10 -0000
@@ -4,6 +4,14 @@
 #include <Python.h>
 #include "scribus.h"
 
+/* These will go away in 1.3, but help readability in 1.2.1 code a LOT */
+#define FRAME_IMAGE 2
+#define FRAME_TEXT 4
+#define FRAME_LINE 5
+#define FRAME_VECTOR 6
+#define FRAME_POLYLINE 7
+#define FRAME_PATHTEXT 8
+
 /* Static global Variables */
 extern ScribusApp* Carrier;
 
@@ -12,9 +20,10 @@
 extern PyObject* ScribusException;
 /*! Exception raised when no document opened - see checkHaveDocument() in cmdutil.cpp */
 extern PyObject* NoDocOpenError;
-
-/* Gross solution to compat with 1.2.1 scripts - track the 'current page' internally */
-extern int currentPage;
+/*! Exception raised when an operation is performed on a frame type that doesn't support it.*/
+extern PyObject* WrongFrameTypeError;
+/*! Exception raised by GetUniqueItem when it can't find a valid frame or a suitable selection to use. */
+extern PyObject* NoValidObjectError;
 
 #endif
 
Index: scriptplugin.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/scriptplugin/scriptplugin.cpp,v
retrieving revision 1.33.2.22
diff -u -r1.33.2.22 scriptplugin.cpp
--- scriptplugin.cpp	6 Dec 2004 20:03:42 -0000	1.33.2.22
+++ scriptplugin.cpp	8 Dec 2004 13:49:10 -0000
@@ -52,9 +52,13 @@
 #include <qtextstream.h>
 #include <cstdlib>
 
+#include <iostream>
+
 // Exceptions; visible from cmdvar.h, set up in initscribus()
 PyObject* ScribusException;
 PyObject* NoDocOpenError;
+PyObject* WrongFrameTypeError;
+PyObject* NoValidObjectError;
 
 QString Name()
 {
@@ -525,159 +529,173 @@
 	return PyString_FromString(InValue);
 }
 
+/*!
+ * Translate a docstring. Small helper function for use with the
+ * PyMethodDef struct.
+ */
+char* tr(const char* docstringConstant)
+{
+    // Alas, there's a lot of wasteful string copying going on
+    // here.
+    QString translated = QObject::tr(docstringConstant, "scripter docstring");
+    const char* trch = translated.latin1();
+    return strndup(trch, strlen(trch));
+}
+
 /* Now we're using the more pyhtonic convention for names:
 	class - ClassName
 	procedure/function/method - procedureName
 etc. */
-static PyMethodDef scribus_methods[] = {
+PyMethodDef scribus_methods[] = {
 	// 2004/10/03 pv - aliases with common Python syntax - ClassName methodName
 	// 2004-11-06 cr - move aliasing to dynamically generated wrapper functions, sort methoddef
-	{"changeColor", scribus_setcolor, METH_VARARGS, scribus_setcolor__doc__},
-	{"closeDoc", (PyCFunction)scribus_closedoc, METH_NOARGS, scribus_closedoc__doc__},
-	{"createBezierLine", scribus_bezierline, METH_VARARGS, scribus_bezierline__doc__},
-	{"createEllipse", scribus_newellipse, METH_VARARGS, scribus_newellipse__doc__},
-	{"createImage", scribus_newimage, METH_VARARGS, scribus_newimage__doc__},
-	{"createLayer", scribus_createlayer, METH_VARARGS, scribus_createlayer__doc__},
-	{"createLine", scribus_newline, METH_VARARGS, scribus_newline__doc__},
-	{"createPathText", scribus_pathtext, METH_VARARGS, scribus_pathtext__doc__},
-	{"createPolygon", scribus_polygon, METH_VARARGS, scribus_polygon__doc__},
-	{"createPolyLine", scribus_polyline, METH_VARARGS, scribus_polyline__doc__},
-	{"createRect", scribus_newrect, METH_VARARGS, scribus_newrect__doc__},
-	{"createText", scribus_newtext, METH_VARARGS, scribus_newtext__doc__},
-	{"currentPage", (PyCFunction)scribus_actualpage, METH_NOARGS, scribus_actualpage__doc__},
-	{"defineColor", scribus_newcolor, METH_VARARGS, scribus_newcolor__doc__},
-	{"deleteColor", scribus_delcolor, METH_VARARGS, scribus_delcolor__doc__},
-	{"deleteLayer", scribus_removelayer, METH_VARARGS, scribus_removelayer__doc__},
-	{"deleteObject", scribus_deleteobj, METH_VARARGS, scribus_deleteobj__doc__},
-	{"deletePage", scribus_deletepage, METH_VARARGS, scribus_deletepage__doc__},
-	{"deleteText", scribus_deletetext, METH_VARARGS, scribus_deletetext__doc__},
-	{"deselectAll", (PyCFunction)scribus_deselect, METH_NOARGS, scribus_deselect__doc__},
-	{"docChanged", scribus_docchanged, METH_VARARGS, scribus_docchanged__doc__},
-	{"fileDialog", scribus_filedia, METH_VARARGS, scribus_filedia__doc__},
-	{"getActiveLayer", (PyCFunction)scribus_getactlayer, METH_NOARGS, scribus_getactlayer__doc__},
-	{"getAllObjects", scribus_getallobj, METH_VARARGS, scribus_getallobj__doc__},
-	{"getAllStyles", (PyCFunction)scribus_getstylenames, METH_NOARGS, scribus_getstylenames__doc__},
-	{"getAllText", scribus_gettext, METH_VARARGS, scribus_gettext__doc__},
-	{"getColorNames", (PyCFunction)scribus_colornames, METH_NOARGS, scribus_colornames__doc__},
-	{"getColor", scribus_getcolor, METH_VARARGS, scribus_getcolor__doc__},
-	{"getColumnGap", scribus_getcolumngap, METH_VARARGS, scribus_getcolumngap__doc__},
-	{"getColumns", scribus_getcolumns, METH_VARARGS, scribus_getcolumns__doc__},
-	{"getCornerRadius", scribus_getcornerrad, METH_VARARGS, scribus_getcornerrad__doc__},
-	{"getFillColor", scribus_getfillcolor, METH_VARARGS, scribus_getfillcolor__doc__},
-	{"getFillShade", scribus_getfillshade, METH_VARARGS, scribus_getfillshade__doc__},
-	{"getFontNames", (PyCFunction)scribus_fontnames, METH_NOARGS, scribus_fontnames__doc__},
-	{"getFont", scribus_getfont, METH_VARARGS, scribus_getfont__doc__},
-	{"getFontSize", scribus_getfontsize, METH_VARARGS, scribus_getfontsize__doc__},
-	{"getGuiLanguage", (PyCFunction)scribus_getlanguage, METH_NOARGS, scribus_getlanguage__doc__},
-	{"getHGuides", (PyCFunction)scribus_getHguides, METH_NOARGS, scribus_getHguides__doc__},
-	{"getImageFile", scribus_getimgname, METH_VARARGS, scribus_getimgname__doc__},
-	{"getImageScale", scribus_getimgscale, METH_VARARGS, scribus_getimgscale__doc__},
-	{"getLayers", (PyCFunction)scribus_getlayers, METH_NOARGS, scribus_getlayers__doc__},
-	{"getLineCap", scribus_getlineend, METH_VARARGS, scribus_getlineend__doc__},
-	{"getLineColor", scribus_getlinecolor, METH_VARARGS, scribus_getlinecolor__doc__},
-	{"getLineJoin", scribus_getlinejoin, METH_VARARGS, scribus_getlinejoin__doc__},
-	{"getLineShade", scribus_getlineshade, METH_VARARGS, scribus_getlineshade__doc__},
-	{"getLineSpacing", scribus_getlinespace, METH_VARARGS, scribus_getlinespace__doc__},
-	{"getLineStyle", scribus_getlinestyle, METH_VARARGS, scribus_getlinestyle__doc__},
-	{"getLineWidth", scribus_getlinewidth, METH_VARARGS, scribus_getlinewidth__doc__},
-	{"getPageItems", (PyCFunction)scribus_getpageitems, METH_NOARGS, scribus_getpageitems__doc__},
-	{"getPageMargins", (PyCFunction)scribus_getpagemargins, METH_NOARGS, scribus_getpagemargins__doc__},
-	{"getPageSize", (PyCFunction)scribus_pagedimension, METH_NOARGS, scribus_pagedimension__doc__}, // just an alias to PageDimension()
-	{"getPosition", scribus_getposi, METH_VARARGS, scribus_getposi__doc__},
-	{"getRotation", scribus_getrotation, METH_VARARGS, scribus_getrotation__doc__},
-	{"getSelectedObject", scribus_getselobjnam, METH_VARARGS, scribus_getselobjnam__doc__},
-	{"getSize", scribus_getsize, METH_VARARGS, scribus_getsize__doc__},
-	{"getTextColor", scribus_getlinecolor, METH_VARARGS, scribus_getlinecolor__doc__},
-	{"getTextLength", scribus_gettextsize, METH_VARARGS, scribus_gettextsize__doc__},
-	{"getText", scribus_getframetext, METH_VARARGS, scribus_getframetext__doc__},
-	{"getTextShade", scribus_getlineshade, METH_VARARGS, scribus_getlineshade__doc__},
-	{"getUnit", (PyCFunction)scribus_getunit, METH_NOARGS, scribus_getunit__doc__},
-	{"getVGuides", (PyCFunction)scribus_getVguides, METH_NOARGS, scribus_getVguides__doc__},
-	{"getXFontNames", (PyCFunction)scribus_xfontnames, METH_NOARGS, scribus_xfontnames__doc__},
-	{"gotoPage", scribus_gotopage, METH_VARARGS, scribus_gotopage__doc__},
-	{"groupObjects", scribus_groupobj, METH_VARARGS, scribus_groupobj__doc__},
-	{"haveDoc", (PyCFunction)scribus_havedoc, METH_NOARGS, scribus_havedoc__doc__},
-	{"insertText", scribus_inserttext, METH_VARARGS, scribus_inserttext__doc__},
-	{"isLayerPrintable", scribus_glayerprint, METH_VARARGS, scribus_glayerprint__doc__},
-	{"isLayerVisible", scribus_glayervisib, METH_VARARGS, scribus_glayervisib__doc__},
-	{"isLocked", scribus_islocked, METH_VARARGS, scribus_islocked__doc__},
-	{"linkTextFrames", scribus_linktextframes, METH_VARARGS, scribus_linktextframes__doc__},
-	{"loadImage", scribus_loadimage, METH_VARARGS, scribus_loadimage__doc__},
-	{"loadStylesFromFile", scribus_loadstylesfromfile, METH_VARARGS, scribus_loadstylesfromfile__doc__},
-	{"lockObject", scribus_lockobject, METH_VARARGS, scribus_lockobject__doc__},
-	{"messagebarText", scribus_messagebartext, METH_VARARGS, scribus_messagebartext__doc__},
-	{"messageBox", scribus_messdia, METH_VARARGS, scribus_messdia__doc__},
-	{"moveObjectAbs", scribus_moveobjabs, METH_VARARGS, scribus_moveobjabs__doc__},
-	{"moveObject", scribus_moveobjrel, METH_VARARGS, scribus_moveobjrel__doc__},
-	{"newDocDialog", (PyCFunction)scribus_newdocdia, METH_NOARGS, scribus_newdocdia__doc__},
-	{"newDoc", scribus_newdoc, METH_VARARGS, scribus_newdoc__doc__},
-	{"newPage", scribus_newpage, METH_VARARGS, scribus_newpage__doc__},
-	{"objectExists",scribus_objectexists, METH_VARARGS, scribus_objectexists__doc__},
-	{"openDoc", scribus_opendoc, METH_VARARGS, scribus_opendoc__doc__},
-	{"pageCount", (PyCFunction)scribus_pagecount, METH_NOARGS, scribus_pagecount__doc__},
-	{"pageDimension", (PyCFunction)scribus_pagedimension, METH_NOARGS, scribus_pagedimension__doc__},
-	{"progressReset", scribus_progressreset, METH_VARARGS, scribus_progressreset__doc__},
-	{"progressSet", scribus_progresssetprogress, METH_VARARGS, scribus_progresssetprogress__doc__},
-	{"progressTotal", scribus_progresssettotalsteps, METH_VARARGS, scribus_progresssettotalsteps__doc__},
-	{"redrawAll", (PyCFunction)scribus_redraw, METH_NOARGS, scribus_redraw__doc__},
-	{"renderFont", scribus_renderfont, METH_VARARGS, scribus_renderfont__doc__},
-	{"replaceColor", scribus_replcolor, METH_VARARGS, scribus_replcolor__doc__},
-	{"rotateObjectAbs", scribus_rotobjabs, METH_VARARGS, scribus_rotobjabs__doc__},
-	{"rotateObject", scribus_rotobjrel, METH_VARARGS, scribus_rotobjrel__doc__},
-	{"saveDocAs", scribus_savedocas, METH_VARARGS, scribus_savedocas__doc__},
-	{"saveDoc", (PyCFunction)scribus_savedoc, METH_NOARGS, scribus_savedoc__doc__},
-	{"savePageAsEPS", scribus_savepageeps, METH_VARARGS, scribus_savepageeps__doc__},
-	{"scaleGroup", scribus_scalegroup, METH_VARARGS, scribus_scalegroup__doc__},
-	{"scaleImage", scribus_scaleimage, METH_VARARGS, scribus_scaleimage__doc__},
-	{"selectionCount", (PyCFunction)scribus_selcount, METH_NOARGS, scribus_selcount__doc__},
-	{"selectObject", scribus_selectobj, METH_VARARGS, scribus_selectobj__doc__},
-	{"selectText", scribus_selecttext, METH_VARARGS, scribus_selecttext__doc__},
-	{"sentToLayer", scribus_senttolayer, METH_VARARGS, scribus_senttolayer__doc__},
-	{"setActiveLayer", scribus_setactlayer, METH_VARARGS, scribus_setactlayer__doc__},
-	{"setColumnGap", scribus_setcolumngap, METH_VARARGS, scribus_setcolumngap__doc__},
-	{"setColumns", scribus_setcolumns, METH_VARARGS, scribus_setcolumns__doc__},
-	{"setCornerRadius", scribus_setcornerrad, METH_VARARGS, scribus_setcornerrad__doc__},
-	{"setCursor", scribus_setcursor, METH_VARARGS, scribus_setcursor__doc__},
-	{"setDocType", scribus_setdoctype, METH_VARARGS, scribus_setdoctype__doc__},
-	{"setFillColor", scribus_setfillcolor, METH_VARARGS, scribus_setfillcolor__doc__},
-	{"setFillShade", scribus_setfillshade, METH_VARARGS, scribus_setfillshade__doc__},
-	{"setFont", scribus_setfont, METH_VARARGS, scribus_setfont__doc__},
-	{"setFontSize", scribus_setfontsize, METH_VARARGS, scribus_setfontsize__doc__},
-	{"setGradientFill", scribus_setgradfill, METH_VARARGS, scribus_setgradfill__doc__},
-	{"setHGuides", scribus_setHguides, METH_VARARGS, scribus_setHguides__doc__},
-	{"setInfo", scribus_setinfo, METH_VARARGS, scribus_setinfo__doc__},
-	{"setLayerPrintable", scribus_layerprint, METH_VARARGS, scribus_layerprint__doc__},
-	{"setLayerVisible", scribus_layervisible, METH_VARARGS, scribus_layervisible__doc__},
-	{"setLineCap", scribus_setlineend, METH_VARARGS, scribus_setlineend__doc__},
-	{"setLineColor", scribus_setlinecolor, METH_VARARGS, scribus_setlinecolor__doc__},
-	{"setLineJoin", scribus_setlinejoin, METH_VARARGS, scribus_setlinejoin__doc__},
-	{"setLineShade", scribus_setlineshade, METH_VARARGS, scribus_setlineshade__doc__},
-	{"setLineSpacing", scribus_setlinespace, METH_VARARGS, scribus_setlinespace__doc__},
-	{"setLineStyle", scribus_setlinestyle, METH_VARARGS, scribus_setlinestyle__doc__},
-	{"setLineWidth", scribus_setlinewidth, METH_VARARGS, scribus_setlinewidth__doc__},
-	{"setMargins", scribus_setmargins, METH_VARARGS, scribus_setmargins__doc__},
-	{"setMultiLine", scribus_setmultiline, METH_VARARGS, scribus_setmultiline__doc__},
+	{"changeColor", scribus_setcolor, METH_VARARGS, tr(scribus_setcolor__doc__)},
+	{"closeDoc", (PyCFunction)scribus_closedoc, METH_NOARGS, tr(scribus_closedoc__doc__)},
+	{"createBezierLine", scribus_bezierline, METH_VARARGS, tr(scribus_bezierline__doc__)},
+	{"createEllipse", scribus_newellipse, METH_VARARGS, tr(scribus_newellipse__doc__)},
+	{"createImage", scribus_newimage, METH_VARARGS, tr(scribus_newimage__doc__)},
+	{"createLayer", scribus_createlayer, METH_VARARGS, tr(scribus_createlayer__doc__)},
+	{"createLine", scribus_newline, METH_VARARGS, tr(scribus_newline__doc__)},
+	{"createPathText", scribus_pathtext, METH_VARARGS, tr(scribus_pathtext__doc__)},
+	{"createPolygon", scribus_polygon, METH_VARARGS, tr(scribus_polygon__doc__)},
+	{"createPolyLine", scribus_polyline, METH_VARARGS, tr(scribus_polyline__doc__)},
+	{"createRect", scribus_newrect, METH_VARARGS, tr(scribus_newrect__doc__)},
+	{"createText", scribus_newtext, METH_VARARGS, tr(scribus_newtext__doc__)},
+	{"currentPage", (PyCFunction)scribus_actualpage, METH_NOARGS, tr(scribus_actualpage__doc__)},
+	{"defineColor", scribus_newcolor, METH_VARARGS, tr(scribus_newcolor__doc__)},
+	{"deleteColor", scribus_delcolor, METH_VARARGS, tr(scribus_delcolor__doc__)},
+	{"deleteLayer", scribus_removelayer, METH_VARARGS, tr(scribus_removelayer__doc__)},
+	{"deleteObject", scribus_deleteobj, METH_VARARGS, tr(scribus_deleteobj__doc__)},
+	{"deletePage", scribus_deletepage, METH_VARARGS, tr(scribus_deletepage__doc__)},
+	{"deleteText", scribus_deletetext, METH_VARARGS, tr(scribus_deletetext__doc__)},
+	{"deselectAll", (PyCFunction)scribus_deselect, METH_NOARGS, tr(scribus_deselect__doc__)},
+	{"docChanged", scribus_docchanged, METH_VARARGS, tr(scribus_docchanged__doc__)},
+	{"fileDialog", scribus_filedia, METH_VARARGS, tr(scribus_filedia__doc__)},
+	{"getActiveLayer", (PyCFunction)scribus_getactlayer, METH_NOARGS, tr(scribus_getactlayer__doc__)},
+	{"getAllObjects", scribus_getallobj, METH_VARARGS, tr(scribus_getallobj__doc__)},
+	{"getAllStyles", (PyCFunction)scribus_getstylenames, METH_NOARGS, tr(scribus_getstylenames__doc__)},
+	{"getAllText", scribus_gettext, METH_VARARGS, tr(scribus_gettext__doc__)},
+	{"getColorNames", (PyCFunction)scribus_colornames, METH_NOARGS, tr(scribus_colornames__doc__)},
+	{"getColor", scribus_getcolor, METH_VARARGS, tr(scribus_getcolor__doc__)},
+	{"getColumnGap", scribus_getcolumngap, METH_VARARGS, tr(scribus_getcolumngap__doc__)},
+	{"getColumns", scribus_getcolumns, METH_VARARGS, tr(scribus_getcolumns__doc__)},
+	{"getCornerRadius", scribus_getcornerrad, METH_VARARGS, tr(scribus_getcornerrad__doc__)},
+	{"getFillColor", scribus_getfillcolor, METH_VARARGS, tr(scribus_getfillcolor__doc__)},
+	{"getFillShade", scribus_getfillshade, METH_VARARGS, tr(scribus_getfillshade__doc__)},
+	{"getFontNames", (PyCFunction)scribus_fontnames, METH_NOARGS, tr(scribus_fontnames__doc__)},
+	{"getFont", scribus_getfont, METH_VARARGS, tr(scribus_getfont__doc__)},
+	{"getFontSize", scribus_getfontsize, METH_VARARGS, tr(scribus_getfontsize__doc__)},
+	{"getGuiLanguage", (PyCFunction)scribus_getlanguage, METH_NOARGS, tr(scribus_getlanguage__doc__)},
+	{"getHGuides", (PyCFunction)scribus_getHguides, METH_NOARGS, tr(scribus_getHguides__doc__)},
+	{"getImageFile", scribus_getimgname, METH_VARARGS, tr(scribus_getimgname__doc__)},
+	{"getImageScale", scribus_getimgscale, METH_VARARGS, tr(scribus_getimgscale__doc__)},
+	{"getLayers", (PyCFunction)scribus_getlayers, METH_NOARGS, tr(scribus_getlayers__doc__)},
+	{"getLineCap", scribus_getlineend, METH_VARARGS, tr(scribus_getlineend__doc__)},
+	{"getLineColor", scribus_getlinecolor, METH_VARARGS, tr(scribus_getlinecolor__doc__)},
+	{"getLineJoin", scribus_getlinejoin, METH_VARARGS, tr(scribus_getlinejoin__doc__)},
+	{"getLineShade", scribus_getlineshade, METH_VARARGS, tr(scribus_getlineshade__doc__)},
+	{"getLineSpacing", scribus_getlinespace, METH_VARARGS, tr(scribus_getlinespace__doc__)},
+	{"getLineStyle", scribus_getlinestyle, METH_VARARGS, tr(scribus_getlinestyle__doc__)},
+	{"getLineWidth", scribus_getlinewidth, METH_VARARGS, tr(scribus_getlinewidth__doc__)},
+	{"getPageItems", (PyCFunction)scribus_getpageitems, METH_NOARGS, tr(scribus_getpageitems__doc__)},
+	{"getPageMargins", (PyCFunction)scribus_getpagemargins, METH_NOARGS, tr(scribus_getpagemargins__doc__)},
+	{"getPageSize", (PyCFunction)scribus_pagedimension, METH_NOARGS, tr(scribus_pagedimension__doc__)}, // just an alias to PageDimension()
+	{"getPosition", scribus_getposi, METH_VARARGS, tr(scribus_getposi__doc__)},
+	{"getRotation", scribus_getrotation, METH_VARARGS, tr(scribus_getrotation__doc__)},
+	{"getSelectedObject", scribus_getselobjnam, METH_VARARGS, tr(scribus_getselobjnam__doc__)},
+	{"getSize", scribus_getsize, METH_VARARGS, tr(scribus_getsize__doc__)},
+	{"getTextColor", scribus_getlinecolor, METH_VARARGS, tr(scribus_getlinecolor__doc__)},
+	{"getTextLength", scribus_gettextsize, METH_VARARGS, tr(scribus_gettextsize__doc__)},
+	{"getText", scribus_getframetext, METH_VARARGS, tr(scribus_getframetext__doc__)},
+	{"getTextShade", scribus_getlineshade, METH_VARARGS, tr(scribus_getlineshade__doc__)},
+	{"getUnit", (PyCFunction)scribus_getunit, METH_NOARGS, tr(scribus_getunit__doc__)},
+	{"getVGuides", (PyCFunction)scribus_getVguides, METH_NOARGS, tr(scribus_getVguides__doc__)},
+	{"getXFontNames", (PyCFunction)scribus_xfontnames, METH_NOARGS, tr(scribus_xfontnames__doc__)},
+	{"gotoPage", scribus_gotopage, METH_VARARGS, tr(scribus_gotopage__doc__)},
+	{"groupObjects", scribus_groupobj, METH_VARARGS, tr(scribus_groupobj__doc__)},
+	{"haveDoc", (PyCFunction)scribus_havedoc, METH_NOARGS, tr(scribus_havedoc__doc__)},
+	{"insertText", scribus_inserttext, METH_VARARGS, tr(scribus_inserttext__doc__)},
+	{"isLayerPrintable", scribus_glayerprint, METH_VARARGS, tr(scribus_glayerprint__doc__)},
+	{"isLayerVisible", scribus_glayervisib, METH_VARARGS, tr(scribus_glayervisib__doc__)},
+	{"isLocked", scribus_islocked, METH_VARARGS, tr(scribus_islocked__doc__)},
+	{"linkTextFrames", scribus_linktextframes, METH_VARARGS, tr(scribus_linktextframes__doc__)},
+	{"loadImage", scribus_loadimage, METH_VARARGS, tr(scribus_loadimage__doc__)},
+	{"loadStylesFromFile", scribus_loadstylesfromfile, METH_VARARGS, tr(scribus_loadstylesfromfile__doc__)},
+	{"lockObject", scribus_lockobject, METH_VARARGS, tr(scribus_lockobject__doc__)},
+	{"messagebarText", scribus_messagebartext, METH_VARARGS, tr(scribus_messagebartext__doc__)},
+	{"messageBox", scribus_messdia, METH_VARARGS, tr(scribus_messdia__doc__)},
+	{"moveObjectAbs", scribus_moveobjabs, METH_VARARGS, tr(scribus_moveobjabs__doc__)},
+	{"moveObject", scribus_moveobjrel, METH_VARARGS, tr(scribus_moveobjrel__doc__)},
+	{"newDocDialog", (PyCFunction)scribus_newdocdia, METH_NOARGS, tr(scribus_newdocdia__doc__)},
+	{"newDoc", scribus_newdoc, METH_VARARGS, tr(scribus_newdoc__doc__)},
+	{"newPage", scribus_newpage, METH_VARARGS, tr(scribus_newpage__doc__)},
+	{"objectExists",scribus_objectexists, METH_VARARGS, tr(scribus_objectexists__doc__)},
+	{"openDoc", scribus_opendoc, METH_VARARGS, tr(scribus_opendoc__doc__)},
+	{"pageCount", (PyCFunction)scribus_pagecount, METH_NOARGS, tr(scribus_pagecount__doc__)},
+	{"pageDimension", (PyCFunction)scribus_pagedimension, METH_NOARGS, tr(scribus_pagedimension__doc__)},
+	{"progressReset", scribus_progressreset, METH_VARARGS, tr(scribus_progressreset__doc__)},
+	{"progressSet", scribus_progresssetprogress, METH_VARARGS, tr(scribus_progresssetprogress__doc__)},
+	{"progressTotal", scribus_progresssettotalsteps, METH_VARARGS, tr(scribus_progresssettotalsteps__doc__)},
+	{"redrawAll", (PyCFunction)scribus_redraw, METH_NOARGS, tr(scribus_redraw__doc__)},
+	{"renderFont", scribus_renderfont, METH_VARARGS, tr(scribus_renderfont__doc__)},
+	{"replaceColor", scribus_replcolor, METH_VARARGS, tr(scribus_replcolor__doc__)},
+	{"rotateObjectAbs", scribus_rotobjabs, METH_VARARGS, tr(scribus_rotobjabs__doc__)},
+	{"rotateObject", scribus_rotobjrel, METH_VARARGS, tr(scribus_rotobjrel__doc__)},
+	{"saveDocAs", scribus_savedocas, METH_VARARGS, tr(scribus_savedocas__doc__)},
+	{"saveDoc", (PyCFunction)scribus_savedoc, METH_NOARGS, tr(scribus_savedoc__doc__)},
+	{"savePageAsEPS", scribus_savepageeps, METH_VARARGS, tr(scribus_savepageeps__doc__)},
+	{"scaleGroup", scribus_scalegroup, METH_VARARGS, tr(scribus_scalegroup__doc__)},
+	{"scaleImage", scribus_scaleimage, METH_VARARGS, tr(scribus_scaleimage__doc__)},
+	{"selectionCount", (PyCFunction)scribus_selcount, METH_NOARGS, tr(scribus_selcount__doc__)},
+	{"selectObject", scribus_selectobj, METH_VARARGS, tr(scribus_selectobj__doc__)},
+	{"selectText", scribus_selecttext, METH_VARARGS, tr(scribus_selecttext__doc__)},
+	{"sentToLayer", scribus_senttolayer, METH_VARARGS, tr(scribus_senttolayer__doc__)},
+	{"setActiveLayer", scribus_setactlayer, METH_VARARGS, tr(scribus_setactlayer__doc__)},
+	{"setColumnGap", scribus_setcolumngap, METH_VARARGS, tr(scribus_setcolumngap__doc__)},
+	{"setColumns", scribus_setcolumns, METH_VARARGS, tr(scribus_setcolumns__doc__)},
+	{"setCornerRadius", scribus_setcornerrad, METH_VARARGS, tr(scribus_setcornerrad__doc__)},
+	{"setCursor", scribus_setcursor, METH_VARARGS, tr(scribus_setcursor__doc__)},
+	{"setDocType", scribus_setdoctype, METH_VARARGS, tr(scribus_setdoctype__doc__)},
+	{"setFillColor", scribus_setfillcolor, METH_VARARGS, tr(scribus_setfillcolor__doc__)},
+	{"setFillShade", scribus_setfillshade, METH_VARARGS, tr(scribus_setfillshade__doc__)},
+	{"setFont", scribus_setfont, METH_VARARGS, tr(scribus_setfont__doc__)},
+	{"setFontSize", scribus_setfontsize, METH_VARARGS, tr(scribus_setfontsize__doc__)},
+	{"setGradientFill", scribus_setgradfill, METH_VARARGS, tr(scribus_setgradfill__doc__)},
+	{"setHGuides", scribus_setHguides, METH_VARARGS, tr(scribus_setHguides__doc__)},
+	{"setInfo", scribus_setinfo, METH_VARARGS, tr(scribus_setinfo__doc__)},
+	{"setLayerPrintable", scribus_layerprint, METH_VARARGS, tr(scribus_layerprint__doc__)},
+	{"setLayerVisible", scribus_layervisible, METH_VARARGS, tr(scribus_layervisible__doc__)},
+	{"setLineCap", scribus_setlineend, METH_VARARGS, tr(scribus_setlineend__doc__)},
+	{"setLineColor", scribus_setlinecolor, METH_VARARGS, tr(scribus_setlinecolor__doc__)},
+	{"setLineJoin", scribus_setlinejoin, METH_VARARGS, tr(scribus_setlinejoin__doc__)},
+	{"setLineShade", scribus_setlineshade, METH_VARARGS, tr(scribus_setlineshade__doc__)},
+	{"setLineSpacing", scribus_setlinespace, METH_VARARGS, tr(scribus_setlinespace__doc__)},
+	{"setLineStyle", scribus_setlinestyle, METH_VARARGS, tr(scribus_setlinestyle__doc__)},
+	{"setLineWidth", scribus_setlinewidth, METH_VARARGS, tr(scribus_setlinewidth__doc__)},
+	{"setMargins", scribus_setmargins, METH_VARARGS, tr(scribus_setmargins__doc__)},
+	{"setMultiLine", scribus_setmultiline, METH_VARARGS, tr(scribus_setmultiline__doc__)},
 	// duplicity? {"setMultiLine", scribus_setmultiline, METH_VARARGS, "TODO: docstring"},
-	{"setRedraw", scribus_setredraw, METH_VARARGS, scribus_setredraw__doc__},
+	{"setRedraw", scribus_setredraw, METH_VARARGS, tr(scribus_setredraw__doc__)},
 	// missing? {"setSelectedObject", scribus_setselobjnam, METH_VARARGS, "Returns the Name of the selecteted Object. \"nr\" if given indicates the Number of the selected Object, e.g. 0 means the first selected Object, 1 means the second selected Object and so on."},
-	{"setStyle", scribus_setstyle, METH_VARARGS, scribus_setstyle__doc__},
-	{"setTextAlignment", scribus_setalign, METH_VARARGS, scribus_setalign__doc__},
-	{"setTextColor", scribus_settextfill, METH_VARARGS, scribus_settextfill__doc__},
-	{"setText", scribus_setboxtext, METH_VARARGS, scribus_setboxtext__doc__},
-	{"setTextShade", scribus_settextshade, METH_VARARGS, scribus_settextshade__doc__},
-	{"setTextStroke", scribus_settextstroke, METH_VARARGS, scribus_settextstroke__doc__},
-	{"setUnit", scribus_setunit, METH_VARARGS, scribus_setunit__doc__},
-	{"setVGuides", scribus_setVguides, METH_VARARGS, scribus_setVguides__doc__},
-	{"sizeObject", scribus_sizeobjabs, METH_VARARGS, scribus_sizeobjabs__doc__},
-	{"statusMessage", scribus_messagebartext, METH_VARARGS, scribus_messagebartext__doc__},
-	{"textFlowsAroundFrame", scribus_textflow, METH_VARARGS, scribus_textflow__doc__},
-	{"traceText", scribus_tracetext, METH_VARARGS, scribus_tracetext__doc__},
-	{"unGroupObject", scribus_ungroupobj, METH_VARARGS, scribus_ungroupobj__doc__},
-	{"unlinkTextFrames", scribus_unlinktextframes, METH_VARARGS, scribus_unlinktextframes__doc__},
-	{"valueDialog", scribus_valdialog, METH_VARARGS, scribus_valdialog__doc__},
+	{"setStyle", scribus_setstyle, METH_VARARGS, tr(scribus_setstyle__doc__)},
+	{"setTextAlignment", scribus_setalign, METH_VARARGS, tr(scribus_setalign__doc__)},
+	{"setTextColor", scribus_settextfill, METH_VARARGS, tr(scribus_settextfill__doc__)},
+	{"setText", scribus_setboxtext, METH_VARARGS, tr(scribus_setboxtext__doc__)},
+	{"setTextShade", scribus_settextshade, METH_VARARGS, tr(scribus_settextshade__doc__)},
+	{"setTextStroke", scribus_settextstroke, METH_VARARGS, tr(scribus_settextstroke__doc__)},
+	{"setUnit", scribus_setunit, METH_VARARGS, tr(scribus_setunit__doc__)},
+	{"setVGuides", scribus_setVguides, METH_VARARGS, tr(scribus_setVguides__doc__)},
+	{"sizeObject", scribus_sizeobjabs, METH_VARARGS, tr(scribus_sizeobjabs__doc__)},
+	{"statusMessage", scribus_messagebartext, METH_VARARGS, tr(scribus_messagebartext__doc__)},
+	{"textFlowsAroundFrame", scribus_textflow, METH_VARARGS, tr(scribus_textflow__doc__)},
+	{"traceText", scribus_tracetext, METH_VARARGS, tr(scribus_tracetext__doc__)},
+	{"unGroupObject", scribus_ungroupobj, METH_VARARGS, tr(scribus_ungroupobj__doc__)},
+	{"unlinkTextFrames", scribus_unlinktextframes, METH_VARARGS, tr(scribus_unlinktextframes__doc__)},
+	{"valueDialog", scribus_valdialog, METH_VARARGS, tr(scribus_valdialog__doc__)},
 	// end of aliases
 	{"retval", scribus_retval, METH_VARARGS, "TODO: docstring"},
 	{"getval", scribus_getval, METH_VARARGS, "TODO: docstring"},
+	{"frametype", (PyCFunction)scribus_getframetype, METH_VARARGS|METH_KEYWORDS, "Return the internal type ID of the frame\n"},
 	{NULL,		NULL}		/* sentinel */
 };
 
@@ -703,6 +721,14 @@
 	NoDocOpenError = PyErr_NewException("scribus.NoDocOpenError", ScribusException, NULL);
 	Py_INCREF(NoDocOpenError);
 	PyModule_AddObject(m, "NoDocOpenError", NoDocOpenError);
+	// wrong type of frame for operation
+	WrongFrameTypeError = PyErr_NewException((char*)"scribus.WrongFrameTypeError", ScribusException, NULL);
+	Py_INCREF(WrongFrameTypeError);
+	PyModule_AddObject(m, (char*)"WrongFrameTypeError", WrongFrameTypeError);
+	// Couldn't find named object, or no named object and no selection
+	NoValidObjectError = PyErr_NewException((char*)"scribus.NoValidObjectError", ScribusException, NULL);
+	Py_INCREF(NoValidObjectError);
+	PyModule_AddObject(m, (char*)"NoValidObjectError", NoValidObjectError);
 	// Done with exception setup
 
 	// CONSTANTS
@@ -780,7 +806,6 @@
 	PyDict_SetItemString(d, "PAPER_LEGAL", Py_BuildValue("(ff)", 612.0, 1008.0));
 	PyDict_SetItemString(d, "PAPER_LETTER", Py_BuildValue("(ff)", 612.0, 792.0));
 	PyDict_SetItemString(d, "PAPER_TABLOID", Py_BuildValue("(ff)", 792.0, 1224.0));
-	// end of legacy
 
 	Carrier = pl;
 	// Function aliases for compatibility
@@ -1030,5 +1055,51 @@
 	constantAlias(d, "PAPER_LETTER", "Paper_Letter");
 	constantAlias(d, "PAPER_TABLOID", "Paper_Tabloid");
 	// end of deprecated cosntants
+
+	// Create the module-level docstring. This can be a proper unicode string, unlike
+	// the others, because we can just create a Unicode object and insert it in our
+	// module dictionary.
+	QString docstring = QObject::tr("Scribus Python interface module\n\
+		\n\
+		This module is the Python interface for Scribus. It provides functions\n\
+		to control scribus and to manipulate objects on the canvas. Each\n\
+		function is documented individually below.\n\
+		\n\
+		A few things are common across most of the interface.\n\
+		\n\
+		Most functions operate on frames. Frames are identified by their name,\n\
+		a string - they are not real Python objects. Many functions take an\n\
+		optional (non-keyword) parameter, a frame name.\n\
+		Many exceptions are also common across most functions. These are\n\
+		not currently documented in the docstring for each function.\n\
+		\n\
+		    - Many functions will raise a NoDocOpenError if you try to use them\n\
+		      without a document to operate on.\n\
+		\n\
+		    - If you do not pass a frame name to a function that requires one,\n\
+		      the function will use the currently selected frame, if any, or\n\
+		      raise a NoValidObjectError if it can't find anything to operate\n\
+		      on.\n\
+		\n\
+		    - Many functions will raise WrongFrameTypeError if you try to use them\n\
+		      on a frame type that they do not make sense with. For example, setting\n\
+		      the text colour on a graphics frame doesn't make sense, and will result\n\
+		      in this exception being raised.\n\
+		\n\
+		    - Errors resulting from calls to the underlying Python API will be\n\
+		      passed through unaltered. As such, the list of exceptions thrown by\n\
+		      any function as provided here and in its docstring is incomplete.\n\
+		\n\
+		Details of what exceptions each function may throw are provided on the\n\
+		function's documentation.\n\
+		");
+
+	// Py_UNICODE is a typedef for unsigned short
+	PyObject* uniDocStr = Py_BuildValue("u", (Py_UNICODE*)(docstring.ucs2()));
+	if (uniDocStr == NULL)
+		qDebug("Failed to create module-level docstring object!");
+	else
+		PyDict_SetItemString(d, "__doc__", uniDocStr);
+	Py_DECREF(uniDocStr);
 }
 
