Commit b8e67e89 authored by Sandro Andrade's avatar Sandro Andrade
Browse files

Fix translation issues in Android

parent 03ca0ac1
......@@ -55,7 +55,9 @@ include_directories(${minuet_SOURCE_DIR}/src/ ${minuet_BINARY_DIR}/src/)
add_subdirectory(src)
add_subdirectory(data)
add_subdirectory(doc)
IF(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Android")
add_subdirectory(doc)
ENDIF(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Android")
IF(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Android")
install(FILES org.kde.minuet.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
......
......@@ -73,7 +73,7 @@ Popup {
Loader {
sourceComponent: aboutLabel
onLoaded: item.text = "Minuet is a <a href='http://kde.org'>KDE</a> " + "application for music education."
onLoaded: item.text = "Minuet is a <a href='http://kde.org'>KDE</a> application for music education."
}
Loader {
......
......@@ -53,7 +53,7 @@ Item {
for (var i = 0; i < length; ++i)
answerOption.createObject(answerGrid, {model: currentExerciseOptions[i], index: i, color: internal.colors[i%24]})
}
messageText.text = "Click 'new question' to start!"
messageText.text = i18n("Click 'new question' to start!")
exerciseView.state = "waitingForNewQuestion"
}
}
......@@ -75,7 +75,7 @@ Item {
break
}
}
messageText.text = (internal.answersAreRight) ? "Congratulations, you answered correctly!":"Oops, not this time! Try again!"
messageText.text = (internal.answersAreRight) ? i18n("Congratulations, you answered correctly!"):i18n("Oops, not this time! Try again!")
if (currentExercise.numberOfSelectedOptions == 1)
highlightRightAnswer()
else
......@@ -112,8 +112,7 @@ Item {
font.pointSize: Screen.width >= 1024 ? 18:14
anchors.horizontalCenter: parent.horizontalCenter
wrapMode: Text.WordWrap
//text: (currentExercise != undefined) ? i18nc("technical term, do you have a musician friend?", currentExercise["userMessage"]):""
text: (currentExercise != undefined) ? currentExercise["userMessage"]:""
text: (currentExercise != undefined) ? i18nc("technical term, do you have a musician friend?", currentExercise["userMessage"]):""
}
Text {
id: messageText
......@@ -131,7 +130,7 @@ Item {
id: newPlayQuestionButton
width: 120; height: 40
text: (exerciseView.state == "waitingForNewQuestion") ? "new question":"play question"
text: (exerciseView.state == "waitingForNewQuestion") ? i18n("new question"):i18n("play question")
enabled: !animation.running
onClicked: {
......@@ -152,8 +151,7 @@ Item {
id: giveUpButton
width: 120; height: 40
//text: i18n("give up")
text: "give up"
text: i18n("give up")
enabled: exerciseView.state == "waitingForAnswer" && !animation.running
onClicked: {
......@@ -164,8 +162,7 @@ Item {
GroupBox {
id: availableAnswers
//title: qsTr("Available Answers")
title: "Available Answers"
title: i18n("Available Answers")
anchors.horizontalCenter: parent.horizontalCenter
Layout.preferredWidth: parent.width
Layout.fillHeight: true
......@@ -201,8 +198,7 @@ Item {
property string originalText: model.name
visible: currentExercise != undefined && currentExercise["playMode"] != "rhythm"
//text: i18nc("technical term, do you have a musician friend?", model.name)
text: model.name
text: i18nc("technical term, do you have a musician friend?", model.name)
width: parent.width - 4
anchors.centerIn: parent
horizontalAlignment: Qt.AlignHCenter
......@@ -259,8 +255,7 @@ Item {
GroupBox {
id: yourAnswers
//title: qsTr("Your Answer(s)")
title: "Your Answer(s)"
title: i18n("Your Answer(s)")
Layout.preferredWidth: parent.width
anchors.horizontalCenter: parent.horizontalCenter
......@@ -275,7 +270,7 @@ Item {
Button {
id: backspaceButton
text: "backspace"
text: i18n("backspace")
anchors.horizontalCenter: parent.horizontalCenter
visible: currentExercise != undefined && currentExercise["playMode"] == "rhythm"
enabled: internal.currentAnswer > 0 && internal.currentAnswer < 4
......
......@@ -83,7 +83,7 @@ Item {
currentExercise = undefined
stackView.pop()
internal.exercisePath.pop()
currentExerciseParent.text = internal.exercisePath.toString()
currentExerciseParent.text = i18nc("technical term, do you have a musician friend?", internal.exercisePath.toString())
backPressed()
/*
titleText = "Minuet"
......@@ -107,8 +107,7 @@ Item {
delegate: ImageItemDelegate {
id: control
width: parent.width; height: 50
// text: i18nc("technical term, do you have a musician friend?", modelData.name)
text: modelData.name
text: i18nc("technical term, do you have a musician friend?", modelData.name)
onClicked: {
var children = modelData.children
if (!children) {
......@@ -117,7 +116,7 @@ Item {
else {
internal.exercisePath.push(modelData.name)
stackView.push(categoryMenu.createObject(stackView, {model: children}))
currentExerciseParent.text = modelData.name
currentExerciseParent.text = i18nc("technical term, do you have a musician friend?", modelData.name)
}
}
}
......
......@@ -97,7 +97,7 @@ Flickable {
model: 7
Label {
text: "Octave " + (1 + modelData)
text: i18nc("technical term, do you have a musician friend?", "Octave") + " " + (1 + modelData)
width: 7 * keyWidth
color: "white"
height: parent.height
......
......@@ -29,6 +29,10 @@
#include <QQmlContext>
#include <QQmlApplicationEngine>
#ifndef Q_OS_ANDROID
#include <KLocalizedContext>
#endif
namespace Minuet
{
......@@ -46,6 +50,11 @@ bool UiController::initialize(Core *core)
QQmlApplicationEngine *engine = new QQmlApplicationEngine(this);
QQmlContext *rootContext = engine->rootContext();
rootContext->setContextProperty(QStringLiteral("core"), core);
#ifndef Q_OS_ANDROID
rootContext->setContextObject(new KLocalizedContext(engine));
#else
rootContext->setContextObject(new DummyAndroidLocalizer(engine));
#endif
engine->load(QUrl("qrc:/Main.qml"));
return true;
......
......@@ -25,6 +25,28 @@
#include <interfaces/iuicontroller.h>
#ifdef Q_OS_ANDROID
#include <QVariant>
class DummyAndroidLocalizer : public QObject
{
Q_OBJECT
public:
explicit DummyAndroidLocalizer(QObject *parent = 0) : QObject(parent) { }
Q_INVOKABLE QString i18n (const QString &message, const QVariant &p1=QVariant(), const QVariant &p2=QVariant(), const QVariant &p3=QVariant(), const QVariant &p4=QVariant(), const QVariant &p5=QVariant(), const QVariant &p6=QVariant(), const QVariant &p7=QVariant(), const QVariant &p8=QVariant(), const QVariant &p9=QVariant(), const QVariant &p10=QVariant()) const
{
return message;
}
Q_INVOKABLE QString i18nc (const QString &context, const QString &message, const QVariant &p1=QVariant(), const QVariant &p2=QVariant(), const QVariant &p3=QVariant(), const QVariant &p4=QVariant(), const QVariant &p5=QVariant(), const QVariant &p6=QVariant(), const QVariant &p7=QVariant(), const QVariant &p8=QVariant(), const QVariant &p9=QVariant(), const QVariant &p10=QVariant()) const
{
return message;
}
};
#endif
namespace Minuet
{
......
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