rename Text into MText for plugins

This commit is contained in:
Werner Schweer 2012-12-04 15:51:06 +01:00
parent 81843b56fd
commit 39529445b3
6 changed files with 62 additions and 35 deletions

View file

@ -23,7 +23,7 @@ class TextProp;
struct SymCode;
//---------------------------------------------------------
// @@ Text
// @@ MText
// @P text QString
//---------------------------------------------------------

View file

@ -48,6 +48,8 @@
#include "libmscore/accidental.h"
#include "libmscore/lyrics.h"
extern QString localeName;
//---------------------------------------------------------
// QmlPlugin
//---------------------------------------------------------
@ -139,6 +141,21 @@ void MuseScore::registerPlugin(PluginDescription* plugin)
}
return;
}
//
// load translation
//
QLocale locale;
QString t = np.absolutePath() + "/qml_" + MuseScore::getLocaleISOCode().left(2) + ".qm";
QTranslator* translator = new QTranslator;
if (!translator->load(t)) {
qDebug("cannot load qml translations <%s>", qPrintable(t));
delete translator;
}
else {
qDebug("load qml translations <%s>", qPrintable(t));
qApp->installTranslator(translator);
}
QmlPlugin* item = qobject_cast<QmlPlugin*>(obj);
QString menuPath = item->menuPath();
plugin->menuPath = menuPath;
@ -188,7 +205,7 @@ QDeclarativeEngine* MuseScore::qml()
qmlRegisterType<Tie> ("MuseScore", 1, 0, "Tie");
qmlRegisterType<NoteDot> ("MuseScore", 1, 0, "NoteDot");
qmlRegisterType<FiguredBass>("MuseScore", 1, 0, "FiguredBass");
qmlRegisterType<Text> ("MuseScore", 1, 0, "Text");
qmlRegisterType<Text> ("MuseScore", 1, 0, "MText");
qmlRegisterType<Lyrics> ("MuseScore", 1, 0, "Lyrics");
qmlRegisterType<FiguredBassItem>("MuseScore", 1, 0, "FiguredBassItem");
qmlRegisterUncreatableType<Element>("MuseScore", 1, 0,

View file

@ -1,32 +0,0 @@
#=============================================================================
# Mscore
# Linux Music Score Editor
# $Id:$
#
# Copyright (C) 2012 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#=============================================================================
install(FILES
helloqml.qml
colornotes.qml
notenames.qml
createscore.qml
panel.qml
run.qml
scorelist.qml
view.qml
DESTINATION ${Mscore_SHARE_NAME}${Mscore_INSTALL_NAME}plugins
)

Binary file not shown.

View file

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="de_DE">
<context>
<name>helloqml</name>
<message>
<location filename="helloqml.qml" line="8"/>
<source>This demo plugin shows some basic tasks.</source>
<translation>Dieses Demp-Plugins zeigt einige einface Funktionen.</translation>
</message>
<message>
<location filename="helloqml.qml" line="13"/>
<source>hello world</source>
<translation>Hallo!</translation>
</message>
<message>
<location filename="helloqml.qml" line="23"/>
<source>measure</source>
<translation>Takt</translation>
</message>
<message>
<location filename="helloqml.qml" line="26"/>
<source> segment</source>
<translation> Segment</translation>
</message>
<message>
<location filename="helloqml.qml" line="29"/>
<source> ---hello segment</source>
<translation> ---hallo Segment</translation>
</message>
<message>
<location filename="helloqml.qml" line="36"/>
<source> element</source>
<translation> Element</translation>
</message>
<message>
<location filename="helloqml.qml" line="52"/>
<source>Hello Qml</source>
<translation>Hallo Qml</translation>
</message>
</context>
</TS>