Commit 1bf7e1ee authored by Pino Toscano's avatar Pino Toscano Committed by Albert Astals Cid
Browse files

Store division::p_capital as translated

All the users use it that way already.
parent c43a3d61
...@@ -27,11 +27,10 @@ bool capitalDivisionAsker::nextBoxAskerQuestionHook(const QString &division, int ...@@ -27,11 +27,10 @@ bool capitalDivisionAsker::nextBoxAskerQuestionHook(const QString &division, int
if (isAnswer) if (isAnswer)
{ {
p_capital = p_map -> getDivisionCapital(division); p_capital = p_map -> getDivisionCapital(division);
p_currentAnswer.setQuestion(i18nc("@item:intable column Question, %1 is capital name", "%1", i18nc(p_map -> getFileName().toUtf8(), p_capital.toUtf8()))); p_currentAnswer.setQuestion(i18nc("@item:intable column Question, %1 is capital name", "%1", p_capital));
p_currentAnswer.setCorrectAnswer(i18nc("@option:radio <City> is the capital of...", "%1", i18nc(p_map -> getFileName().toUtf8(), division.toUtf8()))); p_currentAnswer.setCorrectAnswer(i18nc("@option:radio <City> is the capital of...", "%1", i18nc(p_map -> getFileName().toUtf8(), division.toUtf8())));
QString capitalName = i18nc(p_map -> getFileName().toUtf8(), p_capital.toUtf8()); setQuestion(i18nc("@title:group", p_map->getCapitalToDivisionQuestionPattern().toUtf8(), p_capital));
setQuestion(i18nc("@title:group", p_map->getCapitalToDivisionQuestionPattern().toUtf8(), capitalName));
p_radioButtons[i] -> setText(i18nc("@option:radio <City> is the capital of...", "%1", i18nc(p_map -> getFileName().toUtf8(), division.toUtf8()))); p_radioButtons[i] -> setText(i18nc("@option:radio <City> is the capital of...", "%1", i18nc(p_map -> getFileName().toUtf8(), division.toUtf8())));
b = true; b = true;
} }
......
...@@ -31,8 +31,8 @@ bool divisionCapitalAsker::nextBoxAskerQuestionHook(const QString &division, int ...@@ -31,8 +31,8 @@ bool divisionCapitalAsker::nextBoxAskerQuestionHook(const QString &division, int
setQuestion(i18nc("@title:group", p_map->getDivisionToCapitalQuestionPattern().toUtf8(), divisionName)); setQuestion(i18nc("@title:group", p_map->getDivisionToCapitalQuestionPattern().toUtf8(), divisionName));
p_currentAnswer.setQuestion(i18nc("@item:intable column Question, %1 is region name", "%1", i18nc(p_map -> getFileName().toUtf8(), division.toUtf8()))); p_currentAnswer.setQuestion(i18nc("@item:intable column Question, %1 is region name", "%1", i18nc(p_map -> getFileName().toUtf8(), division.toUtf8())));
p_capital = p_map -> getDivisionCapital(division); p_capital = p_map -> getDivisionCapital(division);
p_currentAnswer.setCorrectAnswer(i18nc("@option:radio The capital of <Region> is...", "%1", i18nc(p_map -> getFileName().toUtf8(), p_capital.toUtf8()))); p_currentAnswer.setCorrectAnswer(i18nc("@option:radio The capital of <Region> is...", "%1", p_capital));
p_radioButtons[i] -> setText(i18nc("@option:radio The capital of <Region> is...", "%1", i18nc(p_map -> getFileName().toUtf8(), p_capital.toUtf8()))); p_radioButtons[i] -> setText(i18nc("@option:radio The capital of <Region> is...", "%1", p_capital));
b = true; b = true;
QStringList falseCapitals = p_map -> getDivisionFalseCapitals(division); QStringList falseCapitals = p_map -> getDivisionFalseCapitals(division);
...@@ -62,7 +62,7 @@ bool divisionCapitalAsker::nextBoxAskerQuestionHook(const QString &division, int ...@@ -62,7 +62,7 @@ bool divisionCapitalAsker::nextBoxAskerQuestionHook(const QString &division, int
// Moss // Moss
if (capital != p_capital) if (capital != p_capital)
{ {
p_radioButtons[i] -> setText(i18nc("@option:radio The capital of <Region> is...", "%1", i18nc(p_map -> getFileName().toUtf8(), capital.toUtf8()))); p_radioButtons[i] -> setText(i18nc("@option:radio The capital of <Region> is...", "%1", capital));
b = true; b = true;
} }
else b = false; else b = false;
......
...@@ -147,7 +147,7 @@ void mapAsker::handleMapClick(QRgb c, const QPoint &p) ...@@ -147,7 +147,7 @@ void mapAsker::handleMapClick(QRgb c, const QPoint &p)
{ {
QString flagFile = p_map -> getDivisionFlagFile(aux); QString flagFile = p_map -> getDivisionFlagFile(aux);
if (p_map -> getDivisionCanAsk(aux, division::eCapital)) cap = p_map -> getDivisionCapital(aux); if (p_map -> getDivisionCanAsk(aux, division::eCapital)) cap = p_map -> getDivisionCapital(aux);
if (!cap.isEmpty()) cap = i18nc("@item Capital name in map popup", "%1", i18nc(p_map -> getFileName().toUtf8(), cap.toUtf8())); if (!cap.isEmpty()) cap = i18nc("@item Capital name in map popup", "%1", cap);
QString wikiLink (guessWikipediaDomain()); QString wikiLink (guessWikipediaDomain());
wikiLink.append(i18nc(p_map -> getFileName().toUtf8(), aux.toUtf8())); wikiLink.append(i18nc(p_map -> getFileName().toUtf8(), aux.toUtf8()));
......
...@@ -111,7 +111,7 @@ KGmap *mapReader::parseMap(const QString &path) ...@@ -111,7 +111,7 @@ KGmap *mapReader::parseMap(const QString &path)
// division capital // division capital
QString capital = getElementString(QStringLiteral("capital"), divisionTag, Optional); QString capital = getElementString(QStringLiteral("capital"), divisionTag, Optional);
if (!capital.isNull()) kgdiv -> setCapital( capital ); if (!capital.isEmpty()) kgdiv -> setCapital(i18nc(ctxt, capital.toUtf8()));
// division flag // division flag
QString flagFile = getElementString(QStringLiteral("flag"), divisionTag, Optional); QString flagFile = getElementString(QStringLiteral("flag"), divisionTag, Optional);
......
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