Skip to content

Commit

Permalink
Merge pull request #50 from yorugac/lang_sounds
Browse files Browse the repository at this point in the history
#38 letter sounds are chosen from TR settings
  • Loading branch information
Jo Grimstad authored May 29, 2017
2 parents ac93269 + de8d680 commit 90e3d4b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
9 changes: 8 additions & 1 deletion VoltAir/qml/actors/Orb.qml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ Actor {
return chosenLetter;
}

function langDir() {
var l = TR.getCurrentLanguage();
if(l === "English") return "en";
if(l === "Swahili") return "sw";
return "en";
}

AnimatedImageRenderer {
id: graphic

Expand Down Expand Up @@ -138,7 +145,7 @@ Actor {
PickupLogic {
id: pickupLogic
pickupSound: Util.getPathToSound("pickup.wav")
echoSound: Util.getPathToSound("en/letter_sound_" + chosenLetter + ".wav")
echoSound: Util.getPathToSound(langDir() + "/letter_sound_" + chosenLetter + ".wav")
active: false

onCollected: {
Expand Down
3 changes: 2 additions & 1 deletion VoltAir/translations/tr.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class TR : public QObject
Q_OBJECT
public:
Q_INVOKABLE void setCurrentLanguage(QString language);
Q_INVOKABLE QString getCurrentLanguage() { return _currentLanguage; };

Q_INVOKABLE QString value(const QString &key);

Expand All @@ -17,7 +18,7 @@ class TR : public QObject
TR(QObject* parent = nullptr);

void loadDictionary();
void parseFileLine(const QString &line);
void parseFileLine(const QString &line);

QMap<QString, QString> _dictionary;
QString _currentLanguage;
Expand Down

0 comments on commit 90e3d4b

Please sign in to comment.