Commit 2d560c4a authored by Boudewijn Rempt's avatar Boudewijn Rempt

Add i18nc to the scripting api

CCMAIL:karl@huftis.org
parent b55104a6
......@@ -408,6 +408,11 @@ QString Krita::krita_i18n(const QString &text)
return i18n(text.toUtf8().constData());
}
QString Krita::krita_i18nc(const QString &context, const QString &text)
{
return i18nc(context.toUtf8().constData(), text.toUtf8().constData());
}
void Krita::mainWindowIsBeingCreated(KisMainWindow *kisWindow)
{
Q_FOREACH(Extension *extension, d->extensions) {
......
......@@ -328,6 +328,7 @@ add_document_to_window()
static QObject *fromVariant(const QVariant& v);
static QString krita_i18n(const QString &text);
static QString krita_i18nc(const QString &context, const QString &text);
private Q_SLOTS:
......
......@@ -33,6 +33,7 @@ if sys.version_info[0] > 2:
else:
import __builtin__ as builtins
builtins.i18n = Krita.krita_i18n
builtins.i18nc = Krita.krita_i18nc
builtins.Scripter = Krita.instance()
builtins.Application = Krita.instance()
builtins.Krita = Krita.instance()
......
......@@ -59,6 +59,7 @@ public Q_SLOTS:
static Krita * instance();
static QObject * fromVariant(const QVariant & v);
static QString krita_i18n(const QString &text);
static QString krita_i18nc(const QString &context, const QString &text);
private:
Krita(const Krita &); // Generated
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment