Commit 4e5a32fe authored by Pino Toscano's avatar Pino Toscano
Browse files

Translate map titles only when needed

They are used only when applying a map to the main window or when
showing the results of certain askers; hence, return the default
fallbacks only when these titles are queried.
parent 37c2db20
......@@ -114,12 +114,14 @@ KLocalizedString KGmap::getDivisionToCapitalQuestionPattern() const
QString KGmap::getCapitalToDivisionTitle() const
{
return p_capitalToDivisionTitle;
if (p_capitalToDivisionTitle.isNull()) return i18n("%1 by Capital", getDivisionsString());
else return p_capitalToDivisionTitle;
}
QString KGmap::getDivisionToCapitalTitle() const
{
return p_divisionToCapitalTitle;
if (p_divisionToCapitalTitle.isNull()) return i18n("Capitals of %1", getDivisionsString());
else return p_divisionToCapitalTitle;
}
QString KGmap::getFile() const
......
......@@ -82,20 +82,12 @@ KGmap *mapReader::parseMap(const QString &path)
{
kgmap->setCapitalToDivisionTitle(i18nc("@title", title.toUtf8()));
}
else
{
kgmap->setCapitalToDivisionTitle(i18n("%1 by Capital", kgmap -> getDivisionsString()));
}
title = getElementString(QStringLiteral("divisionToCapitalTitle"), root, Optional);
if ( ! title.isEmpty() )
{
kgmap->setDivisionToCapitalTitle(i18nc("@title", title.toUtf8()));
}
else
{
kgmap->setDivisionToCapitalTitle(i18n("Capitals of %1", kgmap -> getDivisionsString()));
}
// Author string
......
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